Overview
POST /v1/payments is the highest-level operation in the core Business API. It returns a PaymentPlan: an ordered set of steps that can combine on-chain actions (swap instructions) with off-chain coordination (for example, payouts).
Like swaps, the Business API produces the plan but does not execute it.
Request parameters
Key request fields:clientReference: your stable reference (ERP/payment idempotency key)corridorId: which route to use (discoverable via Markets corridors)amountIn: input amount in smallest units (string)recipient: flexible object for recipient details (bank, wallet, etc.)options.mode:STANDARDorDIGITAL_COLLECT
Understanding the response
The response contains:planId: a unique plan identifiersteps[]: an ordered list of steps
stepIdtype(for example,AWAIT_DEPOSIT,EXECUTE_SWAP,CUSTODIAN_PAYOUT,SEND_DIGITAL_COLLECT)status(PENDING,READY,DONE,FAILED)- optionally
instructions[](for on-chain execution) - optionally
custodianAction(for off-chain coordination)
Payment lifecycle
A typical lifecycle for an ERP or application integrating payments:- Create the plan and store
planIdalongside yourclientReference. - Await deposit: you monitor for funds arriving (step transitions to
DONE). - Execute swap: you execute
instructions[]on-chain (step transitions toDONE). - Complete payout or collect: you coordinate the off-chain payout, or the recipient completes Digital Collect (step transitions to
DONE). - Reconcile using stable references:
clientReference↔ your internal recordplanId↔ the plan returned by FiettxHash(where applicable) ↔ on-chain settlement- provider references (where applicable) ↔ off-chain payout records
Payment modes
- Standard
- Digital Collect
In standard mode, recipient details are provided upfront. A typical plan includes:
AWAIT_DEPOSITEXECUTE_SWAP(includesinstructions[])CUSTODIAN_PAYOUT(includes acustodianActionenvelope)