How a Reward-Based Card Game Turned Into an SAP BTP Project
I started this project with an idea for my son: build a collectible-card game where he could earn virtual currency for things like completing chores, doing well in school, and demonstrating good behavior.
Instead of simply giving him points or rewards, I wanted to make the experience more engaging. He could earn currency through his accomplishments, visit an in-game store, purchase card packs, and open them to discover and collect original creatures. The more he earns, the more opportunities he has to grow his collection.
The game itself will be called CardQuest Collectibles, and the creatures and cards will be entirely original.
But as I started thinking about how the game would work, I saw an opportunity to build something much more interesting from a technology perspective.
What if CardQuest didn’t simply generate an unlimited supply of card packs? What if it had to purchase its inventory from a separate wholesale distributor, just like a real retail business?
That’s where CreatureWorks Distribution came into the picture.
CreatureWorks would be the supplier, responsible for its product catalog, wholesale pricing, inventory, customer orders, and shipments. CardQuest would be the retailer inside the game experience, purchasing packs from CreatureWorks before making them available in the store.
The two applications would operate independently and communicate through APIs.
Since much of my professional experience involves SAP architecture and enterprise integration, I decided to build CreatureWorks on SAP Business Technology Platform (BTP).
I wanted to explore how CAP, HANA Cloud, Fiori elements, and SAP Build Work Zone could support a functioning supplier application without relying on an existing S/4HANA system.
What started as a reward-based game for my son became an opportunity to design and build an end-to-end business application, complete with transactional inventory management, sales orders, fulfillment, and integration between two independent systems.
This three-part series documents that SAP side of the project: how I built the supplier application, connected it to an external retailer through Integration Suite and API Management, and implemented outbound notifications for order confirmations and shipments.
The game and its reward system are still being developed separately, but the SAP supplier and integration foundation is already functioning.

CreatureWorks on the left, CardQuest on the right, SAP BTP in the middle. Process Automation and the finished game experience on this graphic are still ahead — this article is the supplier application.
This CreatureWorks series is separate from the Dockvera vendor-directory posts. If you need trial setup notes, see Part 0.
What the supplier has to do
CreatureWorks owns the catalog, wholesale prices, stock, and fulfillment. CardQuest — as the game’s purchasing side — sends SKUs and quantities. It doesn’t invent wholesale prices, and it doesn’t get supplier admin access.
A concrete example used throughout testing:
CardQuest requests ten Forest Discovery packs (CW-FOR-001 at 12.00 CRD) and five Ocean Discovery packs (CW-OCN-001 at 14.00 CRD). CreatureWorks needs to accept that as a sales order totaling 190.00 CRD, confirm it when I’m ready, reserve inventory, prepare a delivery, ship it, and leave a record of what left the warehouse.
That’s a wholesale workflow. The technical question: how do you implement it on SAP BTP without S/4HANA?

I operate CreatureWorks in Work Zone and Fiori. CardQuest’s reward game, storefront, and pack opening are still being built. Parts 2 and 3 cover the API bridge between them.
I call CreatureWorks a lightweight supplier ERP or supplier order-to-fulfillment application on purpose. It isn’t a full ERP suite. It is enough wholesale process to be honest about inventory and status.
Building the application
CAP and the data model
I created the CAP Node.js project creatureworks-supplier in Business Application Studio. Development started with products and inventory; customers, sales orders, deliveries, and stock movements followed once the catalog felt real.

Early project layout: db/schema.cds, srv/supplier-service.cds, and seed CSVs for products and inventory.
entity Products : cuid, managed {
sku : String(40) not null;
name : String(120) not null;
wholesalePrice : Decimal(13,2) not null;
currency : String(3) default 'CRD';
cardsPerPack : Integer default 5;
inventory : Association to one Inventory
on inventory.product = $self;
}
entity Inventory : cuid, managed {
product : Association to one Products not null;
quantityOnHand : Integer default 0;
reservedQuantity : Integer default 0;
availableQuantity: Integer =
quantityOnHand - reservedQuantity;
}
A few design choices mattered more than the field list:
availableQuantityis calculated. Operators shouldn’t “fix” stock by editing a free field. Receiving stock and shipping go through business actions.- Inventory is read-only on the OData service for the same reason. Unrestricted PATCH on stock would defeat the process.
- Sales order lines store
unitPriceandlineAmountat order time. If I change the catalog tomorrow, yesterday’s order still shows what CardQuest was charged. - Orders are unique per customer + external PO reference. The same CardQuest PO number can’t land twice with different line content.

Products allow admin write; Inventory is exposed for read only — stock changes go through business actions.
CRD is our in-world currency (“Creature Dollars”). Customers carry shipping address fields so deliveries can snapshot ship-to data when fulfillment starts.

Extending beyond products — customers, sales orders, and related entities.
SupplierService exposes OData V4 with XSUAA roles: SupplierAdmin for create/update and actions, SupplierViewer for read. That separation becomes more important once Work Zone is in the picture.
Local CDS preview made the early surface area obvious — products, inventory, customers, sales orders, and the placeOrder action before Work Zone packaging.

Local @sap/cds welcome page while the service model was still growing.
HANA Cloud persistence
Local SQLite was fine for early development. Deployed runtime uses SAP HANA Cloud with an HDI container.

Trial HANA Cloud instance used for CreatureWorks persistence.
My first hybrid deploy failed until I opened the trial HANA allowlist for broader IP access — a connectivity problem that looked like a CDS failure until I checked the database settings.

SAP’s trial guidance: allow broader IP access so hybrid deploy and tools can reach the instance.

HDI container after connecting CAP to HANA Cloud for hybrid deployment.
After adding the HANA adapter, compiling XSUAA from the service model, and running a production build, the MTA deployed to Cloud Foundry. The CAP backend and the Fiori HTML5 applications are separate deployables. Seeing an app under HTML5 Applications is not the same as having it on a Work Zone page, and neither is the same as having permission to run a CAP action.

Deployed HTML5 applications available for Work Zone content discovery.
Fiori and Work Zone
I generated Fiori elements List Reports and Object Pages against SupplierService, then published them into a Work Zone site: content channel, catalog, roles, space, and page.

Product, Customer, Sales Order, and Delivery Management assigned in the supplier catalog.

Content Manager: pull the HTML5 app onto a Work Zone page from the CreatureWorks catalog.

Work Zone role assignment — tiles only appear for users who get the role and the space.
The first Product list was honest and thin — raw fields, little context, not something I’d want as the face of a wholesale catalog.

First-pass product list: functional, not useful enough for day-to-day work.
After CDS UI annotations and object-page work, Forest and Ocean packs show wholesale price, cards per pack, and available stock together.

Same app after annotations — catalog context next to stock.
That pattern repeated across the other apps. Customer Management needed draft-enabled editing so I could maintain CardQuest’s shipping address; without that, delivery ship-to snapshots stayed empty and fulfillment demos looked unfinished.

Customer CQ-001 with contact, shipping, and order history sections.
Work Zone decides whether someone sees a tile. CAP / XSUAA decide whether they can call confirm or ship. A user can have a beautiful launchpad and still get authorization errors on the backend if those layers disagree. Keeping that distinction clear saved me from chasing the wrong problem more than once.
Making it operate like a supplier
This is the part that turns screens into a process.
Order lifecycle
Sales order status on CreatureWorks:
SUBMITTED → CONFIRMED → READY_TO_SHIP → SHIPPED
Deliveries use their own status (READY, then SHIPPED) while the sales order advances.
Shared order creation (used by internal placeOrder and later by the B2B service) validates the customer, resolves products, copies wholesale prices onto lines, and creates a SUBMITTED order. It locks the customer row during create to reduce concurrent duplicate submissions. It does not reserve inventory yet.

srv/lib/order-processing.js — the create path both Fiori and B2B reuse, including customer and PO reference checks.
Inventory reservation happens on confirm. When I confirm a SUBMITTED order, CAP locks the order and inventory rows, checks available stock (quantityOnHand - reservedQuantity), increases reservedQuantity, and sets status to CONFIRMED. If stock isn’t there, confirmation fails — the order doesn’t silently pretend we have packs we don’t.
That timing mattered. Accepting a purchase order as submitted lets the retailer get an acknowledgement quickly. Committing reservation when I confirm matches how I actually work the warehouse: I review the order, then hold stock.
createDelivery only runs on CONFIRMED orders. It copies line items into delivery items, snapshots ship-to from the customer master, and moves the sales order to READY_TO_SHIP. maintainShippingDetails captures carrier and tracking. ship deducts quantityOnHand, releases the reservation, writes stock movement history, marks delivery and order SHIPPED, and (in Part 3) queues a shipment notification.
Fiori actions are gated with @Core.OperationAvailable so Confirm only appears on submitted orders and Ship only on ready deliveries. When the UI and CAP disagree, operators stop trusting the app.
An example run
One of the first full cycles used CardQuest PO CQ-PO-0001: ten Forest packs and five Ocean packs, 190.00 CRD, through to shipped. (Later articles show other test POs such as CQ-PO-0002 and CQ-PO-0003 from separate runs — same catalog and pricing, different test days.)

Sales Order Management after confirm, delivery, and ship — line items, totals, and status visible together.

Delivery list reflecting the same fulfillment outcome.
Practical friction
A few issues taught more than the happy path:
- Expanding UI annotations without breaking projections takes iteration; Fiori only shows what the service exposes.
- Customer shipping maintenance blocked realistic deliveries until drafts and update grants matched how Fiori expects edits.
- Trial HANA connectivity failures often look like CAP deploy bugs until you check the allowlist.
What Part 1 leaves you with
CreatureWorks can maintain products, receive inventory, manage customers, confirm sales orders, create deliveries, and ship — as a lightweight supplier application on CAP, HANA Cloud, Fiori, and Work Zone.
That’s enough for me to operate the warehouse. It isn’t enough for CardQuest to buy without sharing my admin session. That’s Part 2.
Next
Part 2 — Connecting Two Companies with SAP Integration Suite and API Management
