Skip to main content

Commerce API

Commerce endpoints exposed by the Devotel CPaaS API Base path: /api/v1/commerce Endpoint count: 24

Issue an agent payment mandate

POST /api/v1/commerce/agent-mandate
Issue a fresh scoped, revocable, spend-capped payment mandate for an agent.
string
required
string
required
string
required
number
required
number
required
string
required
array | null
array | null
integer | null

Dry-run authorize a charge against a mandate

POST /api/v1/commerce/agent-mandate/authorize
Dry-run a charge against a mandate and return the decision WITHOUT advancing spend.
object
required
Serializable AP2-style payment mandate snapshot. Carries a SHA-256 consent digest re-verified before every spend.
object
required

Authorize and commit a charge

POST /api/v1/commerce/agent-mandate/charge
Authorize AND commit a charge, returning the advanced mandate plus the authorization. A charge outside the mandate is rejected with VALIDATION_ERROR.
object
required
Serializable AP2-style payment mandate snapshot. Carries a SHA-256 consent digest re-verified before every spend.
object
required

Revoke a mandate

POST /api/v1/commerce/agent-mandate/revoke
Withdraw consent, moving the mandate to the terminal revoked status. Re-revoking is a VALIDATION_ERROR.
object
required
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/verify
Recompute the consent digest and report whether the mandate’s scope is intact (tamper-evidence for auditors).
object
required
Serializable AP2-style payment mandate snapshot. Carries a SHA-256 consent digest re-verified before every spend.

Create cart

POST /api/v1/commerce/cart
Create a fresh, empty omnichannel cart in the browsing state.
string
required
Caller-supplied opaque cart id, stable across channels.

Check whether the cart is abandoned

POST /api/v1/commerce/cart/abandonment-check
True when the cart has gone quiet past idleThresholdMs while holding items in a recoverable, pre-payment state.
object
required
Serializable omnichannel cart snapshot. Derived fields (subtotal, itemCount, …) are re-computed server-side and never trusted.
integer
Idle threshold in ms. Defaults to 30 minutes; capped at 30 days.

Select checkout-channel preference order

POST /api/v1/commerce/cart/checkout-channel
Ordered checkout-channel preference for the cart, restricted to the tenant’s capable channels. An empty array signals fall back to a hosted payment link.
object
required
Serializable omnichannel cart snapshot. Derived fields (subtotal, itemCount, …) are re-computed server-side and never trusted.
string (enum: whatsapp|rcs|amb)[]
required

Merge a channel contribution into the cart

POST /api/v1/commerce/cart/merge
Fold a per-channel order contribution into the cart and re-derive totals server-side.
object
required
Serializable omnichannel cart snapshot. Derived fields (subtotal, itemCount, …) are re-computed server-side and never trusted.
object
required
string (enum: whatsapp|rcs|amb)
required
Conversational-commerce channel a cart contribution came from.

Reconcile a cross-channel payment against the cart

POST /api/v1/commerce/cart/reconcile-payment
Match a payment captured on ANY channel against the cart subtotal (totals re-derived server-side first).
object
required
Serializable omnichannel cart snapshot. Derived fields (subtotal, itemCount, …) are re-computed server-side and never trusted.
object
required

Advance the checkout state machine

POST /api/v1/commerce/cart/transition
Apply one checkout event to the cart. An illegal transition is rejected with VALIDATION_ERROR.
object
required
Serializable 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/charge
Validate a charge against the merchant’s coverage + per-transaction cap and return an initiated charge snapshot. The operator dip is submitted separately via the carrier-billing route.
object
required
Serializable DCB merchant config — settlement currency, per-transaction cap, and tenant-level operator coverage map.
object
required

Capture a DCB charge

POST /api/v1/commerce/dcb/charge/capture
Mark an initiated charge captured once the operator confirms billing. capturedAmount defaults to the initiated amount and may not exceed it (partial capture honoured).
object
required
Serializable DCB charge snapshot. The buyer MSISDN is stored masked; the operator dip rides the carrier-billing route.
number

Record a DCB chargeback

POST /api/v1/commerce/dcb/charge/chargeback
Record an operator-initiated chargeback, reversing the full net captured value and moving the charge to the terminal charged_back status.
object
required
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/fail
Mark an initiated charge failed (operator declined). Terminal.
object
required
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/refund
Refund part or all of a captured charge. A full-headroom refund moves the charge to refunded, a partial one to partially_refunded. Rejects a refund above the refundable headroom.
object
required
Serializable DCB charge snapshot. The buyer MSISDN is stored masked; the operator dip rides the carrier-billing route.
number
required

Configure a DCB merchant

POST /api/v1/commerce/dcb/merchant
Onboard / reconfigure a Direct Carrier Billing merchant: settlement currency, digital-goods category, per-transaction cap, and the tenant-level operator coverage map.
string
required
string
required
string
required
string
required
number
required
object[]

Build the carrier-billing operator request

POST /api/v1/commerce/dcb/operator-request
Shape the /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.
object
required
Serializable DCB charge snapshot. The buyer MSISDN is stored masked; the operator dip rides the carrier-billing route.
string
required

Reconcile a DCB settlement

POST /api/v1/commerce/dcb/reconcile
Reconcile a batch of charges against operator settlement records. Each captured (or partially-refunded) charge is expected to settle for its net value; the report flags amount/currency mismatches, missing settlements, and unexpected lines, all derived server-side.
object[]
required
object[]
required

POST /api/v1/commerce/payment-request
Mint a fresh channel-agnostic hosted PSP-checkout link (PaymentRequest).
string
required
number
required
string
required
string
required
string | null
string | null
integer | null

Reconcile a captured PSP payment

POST /api/v1/commerce/payment-request/reconcile
Match a captured PSP payment against the request. On an exact amount+currency match the request advances to paid.
object
required
Serializable channel-agnostic hosted pay-by-link snapshot. The caller round-trips it in each request body.
object
required

POST /api/v1/commerce/payment-request/render
Render the hosted link for a single channel; the caller hands the result to the existing per-channel send infra.
object
required
Serializable channel-agnostic hosted pay-by-link snapshot. The caller round-trips it in each request body.
string (enum: whatsapp|sms|email|telegram|viber|voice)
required

POST /api/v1/commerce/payment-request/transition
Apply one lifecycle event to the payment request. An illegal transition is rejected with VALIDATION_ERROR.
object
required
Serializable channel-agnostic hosted pay-by-link snapshot. The caller round-trips it in each request body.
string (enum: MARK_VIEWED|MARK_PAID|EXPIRE|CANCEL)
required

Resolve an in-thread WhatsApp checkout

POST /api/v1/commerce/whatsapp-checkout
Resolve native WhatsApp Pay (where Meta supports it) or the hosted pay link, both anchored to one PaymentRequest snapshot.
object
required
object
required