Recipes and Examples
Most outcomes on XKOVA are a short, ordered sequence of operations where one step's output feeds the next. These recipes walk the common flows end to end. Each maps to a workflow you can also run as one SDK call.
How to read these
Every recipe is workflow shaped. A single write rarely finishes the job: a payment still needs a member signature, a treasury transfer still needs a signer quorum, and settlement is observed on chain rather than returned inline. The off chain steps (a member's EIP-712 signature in their own wallet, relayer submission and on chain settlement) are noted where they occur, and terminal status is reached by polling the relevant read. For why the API is shaped this way, see the Non-custodial Model.
All examples use the sandbox base URL https://sandbox-api.xkova.com/v1 and a tenant key
xkv_test_... that you keep server side.
Accept your first payment
- Preview feasibility and fees (optional; create re-prices):
POST /v1/payments/quote. - Create it:
POST /v1/payments. The response carriesid,status, and asigning_url. - Hand the member the
signing_url, or drive the signing yourself with the?token=it carries:GET .../signing-sessionthenGET .../member-jwt. - The member signs the TransferIntent plus Permit in their wallet; submit the signatures to
POST .../signatures. - Poll
GET /v1/payments/{id}untilstatus: confirmed.
client.workflows.directPaymentSend({ payment, sign }).
See SDK Workflows.Send to someone without an account (escrow plus claim)
- Create the held payment:
POST /v1/escrows. A claim token is issued. - The sender signs (same signing session pattern as above) and you submit the signature.
- The recipient opens the claim link:
GET /v1/claims/{token}thenPOST .../send-otpthenPOST .../verify-otpthenPOST .../resolve.
The claim path uses a capability token, not an API key, so the recipient never needs credentials. See Escrow and Claims.
Stand up a treasury vault and move funds
- Create the Safe and add signers plus a threshold:
POST /v1/treasury/wallets. - Draft a transfer:
POST /v1/treasury/wallets/{walletId}/transfers. - Each signer signs the Safe hash;
POST /v1/treasury/transfers/{id}/signaturesuntil quorum. - Execute, then poll until confirmed:
POST .../executethenGET .../{id}untilstate: confirmed.
The request creator cannot self approve when the clause is satisfiable without them. See Treasury and Policies and Quorum Governance.
Issue and distribute a real-world asset token
- Deploy:
POST /v1/tokenization/erc1155, then pollGET /v1/tokenization/tokens/{id}untilstatus: active. - Bind metadata: publish an asset schema,
POST /v1/rwa/tokens/{id}/schema-binding, then commit fields withPOST .../fields/{fieldPath}. - Mint to holders, then create and execute a distribution:
POST /v1/rwa/tokens/{id}/distributionsthenPOST .../{distId}/execute, then poll until the distribution readscompleted.
The batched payout leaves the treasury Safe as one quorum approved transfer; sanctioned holders are excluded server side. See Real-World Assets and Cap Tables and Distributions.
Receive events reliably
- Subscribe to the event types you care about:
POST /v1/webhook-endpoints. - On each delivery, verify
XKOVA-Webhook-Signatureplus its Ed25519 companion over the raw body, then handle idempotently by the event id (XKOVA-Webhook-Event-Id, equal to the envelopeid); reserve the delivery id (XKOVA-Webhook-Delivery-Id) for delivery-level tracing. - Rotate the secret with
POST .../{id}/rotate. A grace window keeps the old secret valid during the cutover.
The SDK ships verifyWebhookSignature for step two. See Webhooks.
Set up your workspace
Setup is console-first, then API. In the console: sign up, follow the emailed Login Link, pick a
direction on the intent screen (this pins the sandbox network), then work the checklist: enable a token,
commit a fee schedule, and create an API key (held for owner approval on a fresh workspace; attest under
Governance, Approvals, then re-submit). From your backend: poll GET /v1/onboarding/status
until setup reads complete, provision account holders, and make the first payment. See
Operator Onboarding for the console path and the
Quickstart for the first call.
Related
For the exact request and response shapes of every operation referenced here, see the interactive reference or the operations list. For these same flows as single SDK calls, see SDK Workflows.