Skip to main content
Requires the Tables and command validator from step 1.

Implement the reservation Component

Create a CODE_TS Component named Reserve order balance. The code below uses the same public declarations delivered to Monaco.
api.transactionDatabase() commits when its callback resolves and rolls back when it throws. Await each tx.* call sequentially; parallel transaction operations are rejected. The default timeout is 15 seconds, and explicit timeoutMs values are limited to 1–30 seconds.
The idempotency guard suppresses concurrent duplicates. The unique transactions.requestKey and existing ledger row are the durable business truth after the cache entry expires.

Configure the Endpoint

Open Endpoints, create the definition inactive, and configure it before activation. Use the smallest practical timeout and memory budget. Inspect the generated OpenAPI operation and exercise both accepted and rejected requests while the definition remains inactive.

Request

Response

Also retain the x-revo-oid response header in the calling system. It is the fastest starting point for a cross-service trace when a client did not preserve the JSON response. Continue with first production workflow. Previous: step 1. Next: step 3.
Last modified on November 8, 2026