Languages: every operation supports cURL, Node.js (TypeScript), Python, Go, Ruby, and PHP. The first 15 operations on this page show all six languages; the remaining 39 show cURL and TypeScript — the two most-used.
Commerce API
Commerce endpoints exposed by the Devotel CPaaS API Base path:/api/v1/commerce
Endpoint count: 52
title: “Errors worth branching on” description: “Per-endpoint failure templates matching the envelope — what actually fires, what to retry, what to surface to the operator.”
Worked request and response samples
POSTing a charge requires an issued mandate. Issue the mandate first, post the charge against its id, then handle the authorize round-trip the endpoint’s gateway needs. The envelope below nests two objections:mandate id formatting (422 VALIDATION_ERROR) and replay credit protection (409 COMMERCE_MANDATE_ALREADY_SPENT). Steps 1 and 2 below are the frame that avoids both.
1. Issue the mandate
POST /api/v1/commerce/agent-mandatemandate carries on the authorize/charge body — is this data. Hold it; every subsequent endpoint that touches a charge sends it back verbatim so the consent digest re-verifies before spend.
2. Dry-run authorize, then charge
POST /api/v1/commerce/agent-mandate/authorize — same shape the charge endpoint accepts; /charge commits the spend (returns charge and the updated mandate), /authorize checks the digest and allowance without committing. /authorize answers authorized: true | false because a mandate either passes or returns intentional detail ahead of the final call.POST /api/v1/commerce/agent-mandate/charge with the same body to commit the charge, or POST /api/v1/commerce/agent-mandate/revoke to invalidate the mandate before expiry. COMMERCE_MANDATE_ALREADY_SPENT below only fires when the same replay-protection reference spends twice — a client that always authorizes then charges once per mandate never pays the 409 tax.
Errors worth branching on
These five failures cover the charge create (POST /api/v1/commerce/charges), which one-tap checkout fires per order. Each block below is a full{ error, meta } envelope as the API returns it, and the matrix at the bottom answers retry vs surface for the same five classes. For the platform-wide decision table these branches plug into, see the error handling guide.
401 — Unauthorized
401 on this page is the bearer key failing before the route ran — it never means the resource is wrong. Rotate the key or re-mint the scoped token; retrying the same request changes nothing.
403 — Forbidden
403 means the key authenticated but the operation is gated by scope — check the key’s scopes on the developer page; a 403 is never a data-not-found shape.
422 — Schema
422 means the payload did not match the request schema — branch on error.details.field and resend with the full mandate id instead of blind-retrying the same body.
429 — Rate
Retry-After header and error.details.retry_after are both set on every 429 — resend the SAME request after the lower of the two.
409 — Conflict
60-second retry matrix
Read the stored public ACP storefront config
GET /api/v1/commerce/agentic/storefront/public/commerce/acp/:storefrontId/..., plus the public storefront URL a merchant hands to a shopping agent. config is null when no storefront has been configured.
Issue an agent payment mandate
POST /api/v1/commerce/agent-mandateDry-run authorize a charge against a mandate
POST /api/v1/commerce/agent-mandate/authorizeSerializable AP2-style payment mandate snapshot. Carries a SHA-256 consent digest re-verified before every spend.
Authorize and commit a charge
POST /api/v1/commerce/agent-mandate/chargeSerializable AP2-style payment mandate snapshot. Carries a SHA-256 consent digest re-verified before every spend.
Mint a card-network agent payment token or trusted-agent credential
POST /api/v1/commerce/agent-mandate/network-tokenSerializable AP2-style payment mandate snapshot. Carries a SHA-256 consent digest re-verified before every spend.
Revoke a mandate
POST /api/v1/commerce/agent-mandate/revokerevoked status. Re-revoking is a VALIDATION_ERROR.
Serializable AP2-style payment mandate snapshot. Carries a SHA-256 consent digest re-verified before every spend.
Verify mandate integrity
POST /api/v1/commerce/agent-mandate/verifySerializable AP2-style payment mandate snapshot. Carries a SHA-256 consent digest re-verified before every spend.
Open an ACP checkout session
POST /api/v1/commerce/agentic/checkoutnot_ready_for_payment.
Complete an ACP checkout under a signed mandate
POST /api/v1/commerce/agentic/checkout/completeready_for_payment session under an AP2 payment mandate. The session is re-priced SERVER-SIDE against the supplied catalog first (the incoming total is never trusted), then that re-priced total is charged against the mandate (consent digest + spend caps re-verified); a charge outside the mandate is rejected with VALIDATION_ERROR so an agent can never spend past signed consent. Mandate-only by default — no money moves and nothing is sent (invariant #45). When X402_ENABLED=1, the re-priced, mandate-authorized total is ALSO settled on-chain in USDC via the P1 x402 facilitator (requires an X-PAYMENT header — a missing/invalid header returns a 402 x402 challenge); the mandate spend is committed / the session moved to completed ONLY after settlement succeeds, otherwise the completion is rejected with a clean 402 SETTLEMENT_FAILED and the mandate is left untouched.
Serializable ACP checkout-session snapshot. Totals are re-derived server-side from the catalog and never trusted from the wire. Amounts are in MAJOR currency units.
Serializable AP2-style payment mandate snapshot. Carries a SHA-256 consent digest re-verified before every spend.
Re-price an ACP checkout session
POST /api/v1/commerce/agentic/checkout/updateSerializable ACP checkout-session snapshot. Totals are re-derived server-side from the catalog and never trusted from the wire. Amounts are in MAJOR currency units.
Build the ACP product feed
POST /api/v1/commerce/agentic/feedBuild the ACP storefront manifest
POST /api/v1/commerce/agentic/manifestResolve an in-thread Apple Messages for Business checkout
POST /api/v1/commerce/amb-checkoutCreate cart
POST /api/v1/commerce/cartbrowsing state.
Check whether the cart is abandoned
POST /api/v1/commerce/cart/abandonment-checkidleThresholdMs while holding items in a recoverable, pre-payment state.
Serializable omnichannel cart snapshot. Derived fields (subtotal, itemCount, …) are re-computed server-side and never trusted.
Select checkout-channel preference order
Need this flow in Python, Go, Ruby, or PHP? The Worked sequences section renders this surface’s hero flows in the full six-language group.
POST /api/v1/commerce/cart/checkout-channelSerializable omnichannel cart snapshot. Derived fields (subtotal, itemCount, …) are re-computed server-side and never trusted.
Merge a channel contribution into the cart
POST /api/v1/commerce/cart/mergeSerializable omnichannel cart snapshot. Derived fields (subtotal, itemCount, …) are re-computed server-side and never trusted.
Conversational-commerce channel a cart contribution came from.
Reconcile a cross-channel payment against the cart
POST /api/v1/commerce/cart/reconcile-paymentSerializable omnichannel cart snapshot. Derived fields (subtotal, itemCount, …) are re-computed server-side and never trusted.
Advance the checkout state machine
POST /api/v1/commerce/cart/transitionSerializable omnichannel cart snapshot. Derived fields (subtotal, itemCount, …) are re-computed server-side and never trusted.
string (enum: ADD_ITEM|REMOVE_ITEM|INITIATE_CHECKOUT|REQUEST_PAYMENT|PAYMENT_CONFIRMED|FULFILL|…)
required
—
Initiate a DCB charge
POST /api/v1/commerce/dcb/chargeinitiated charge snapshot. The operator dip is submitted separately via the carrier-billing route.
Serializable DCB merchant config — settlement currency, per-transaction cap, and tenant-level operator coverage map.
Capture a DCB charge
POST /api/v1/commerce/dcb/charge/captureinitiated charge captured once the operator confirms billing. capturedAmount defaults to the initiated amount and may not exceed it (partial capture honoured).
Serializable DCB charge snapshot. The buyer MSISDN is stored masked; the operator dip rides the carrier-billing route.
Record a DCB chargeback
POST /api/v1/commerce/dcb/charge/chargebackcharged_back status.
Serializable DCB charge snapshot. The buyer MSISDN is stored masked; the operator dip rides the carrier-billing route.
Fail a DCB charge
POST /api/v1/commerce/dcb/charge/failinitiated charge failed (operator declined). Terminal.
Serializable DCB charge snapshot. The buyer MSISDN is stored masked; the operator dip rides the carrier-billing route.
Refund a DCB charge
POST /api/v1/commerce/dcb/charge/refundrefunded, a partial one to partially_refunded. Rejects a refund above the refundable headroom.
Serializable DCB charge snapshot. The buyer MSISDN is stored masked; the operator dip rides the carrier-billing route.
Configure a DCB merchant
POST /api/v1/commerce/dcb/merchantBuild the carrier-billing operator request
POST /api/v1/commerce/dcb/operator-request/network-apis/carrier-billing:charge request body for an initiated charge + the raw buyer MSISDN (never stored on the snapshot). The caller submits the returned body to that route, which owns the cost cap + metering.
Serializable DCB charge snapshot. The buyer MSISDN is stored masked; the operator dip rides the carrier-billing route.
Reconcile a DCB settlement
POST /api/v1/commerce/dcb/reconcileOpen an MPP pre-authorized session
POST /api/v1/commerce/mpp-sessionMeter and settle one call streamed against an MPP session
POST /api/v1/commerce/mpp-session/callSerializable MPP (Machine Payments Protocol) pre-authorized session snapshot — a spend cap + REQUIRED expiry an agent opens ONCE, then streams metered micropayments against. Carries a SHA-256 consent digest re-verified before every metered call.
Dry-run meter a call against an MPP session
POST /api/v1/commerce/mpp-session/meterSerializable MPP (Machine Payments Protocol) pre-authorized session snapshot — a spend cap + REQUIRED expiry an agent opens ONCE, then streams metered micropayments against. Carries a SHA-256 consent digest re-verified before every metered call.
Revoke an MPP session
POST /api/v1/commerce/mpp-session/revokerevoked status. Re-revoking is a VALIDATION_ERROR.
Serializable MPP (Machine Payments Protocol) pre-authorized session snapshot — a spend cap + REQUIRED expiry an agent opens ONCE, then streams metered micropayments against. Carries a SHA-256 consent digest re-verified before every metered call.
Verify MPP session integrity
POST /api/v1/commerce/mpp-session/verifySerializable MPP (Machine Payments Protocol) pre-authorized session snapshot — a spend cap + REQUIRED expiry an agent opens ONCE, then streams metered micropayments against. Carries a SHA-256 consent digest re-verified before every metered call.
Mint a hosted pay-by-link
POST /api/v1/commerce/payment-requestReconcile a captured PSP payment
POST /api/v1/commerce/payment-request/reconcilepaid.
Serializable channel-agnostic hosted pay-by-link snapshot. The caller round-trips it in each request body.
Render a pay-by-link for one channel
POST /api/v1/commerce/payment-request/renderSerializable channel-agnostic hosted pay-by-link snapshot. The caller round-trips it in each request body.
Advance a pay-by-link lifecycle
POST /api/v1/commerce/payment-request/transitionSerializable channel-agnostic hosted pay-by-link snapshot. The caller round-trips it in each request body.
Resolve an in-thread RCS checkout
POST /api/v1/commerce/rcs-checkoutBind an in-call PCI capture to a commerce charge
POST /api/v1/commerce/secure-payment/chargeCharges already recorded by the caller, for the server-side double-charge guard (snapshot round-trip, mirrors omni-cart/PaymentRequest).
Start a recurring subscription
POST /api/v1/commerce/subscriptionsCancel a subscription
POST /api/v1/commerce/subscriptions/cancelSerializable recurring subscription schedule snapshot. The renewal reuses the stored agent-payment-mandate authorization; the caller round-trips this snapshot in each request body.
Annotate + sort a set of subscriptions
POST /api/v1/commerce/subscriptions/listPause a subscription
POST /api/v1/commerce/subscriptions/pauseSerializable recurring subscription schedule snapshot. The renewal reuses the stored agent-payment-mandate authorization; the caller round-trips this snapshot in each request body.
Fire a due subscription renewal cycle
POST /api/v1/commerce/subscriptions/renewSerializable recurring subscription schedule snapshot. The renewal reuses the stored agent-payment-mandate authorization; the caller round-trips this snapshot in each request body.
Serializable AP2-style payment mandate snapshot. Carries a SHA-256 consent digest re-verified before every spend.
Resume a paused subscription
POST /api/v1/commerce/subscriptions/resumeSerializable recurring subscription schedule snapshot. The renewal reuses the stored agent-payment-mandate authorization; the caller round-trips this snapshot in each request body.
Open a UCP cart session
POST /api/v1/commerce/ucp/cartnot_ready_for_payment. Design-partner pilot — gated behind a per-tenant flag.
Complete a UCP cart under a signed mandate
POST /api/v1/commerce/ucp/cart/completeready_for_payment UCP cart session under an AP2 payment mandate. The session is re-priced SERVER-SIDE against the supplied catalog first (the incoming total is never trusted), then that re-priced total is charged against the mandate (consent digest + spend caps re-verified); a charge outside the mandate is rejected with VALIDATION_ERROR so an agent can never spend past signed consent. Authorizes the buy only — no money moves and nothing is sent (invariant #45). Design-partner pilot — gated behind a per-tenant flag.
Serializable ACP checkout-session snapshot. Totals are re-derived server-side from the catalog and never trusted from the wire. Amounts are in MAJOR currency units.
Serializable AP2-style payment mandate snapshot. Carries a SHA-256 consent digest re-verified before every spend.
Re-price a UCP cart session
POST /api/v1/commerce/ucp/cart/updateSerializable ACP checkout-session snapshot. Totals are re-derived server-side from the catalog and never trusted from the wire. Amounts are in MAJOR currency units.
Build the UCP product catalog
POST /api/v1/commerce/ucp/catalogBuild the UCP storefront manifest
POST /api/v1/commerce/ucp/manifestResolve an in-conversation web-chat checkout
POST /api/v1/commerce/webchat-checkoutResolve an in-thread WhatsApp checkout
POST /api/v1/commerce/whatsapp-checkoutPublish/replace the public ACP storefront config
PUT /api/v1/commerce/agentic/storefrontenabled, the public edge serves the discovery manifest + product feed at the returned publicUrl and prices checkouts SERVER-SIDE against the stored catalog. The catalog is bounded (max 250 products). No money moves and nothing is sent (invariant #45).