Next actions
Handle every H2H response through the next_action discriminated union.
Always branch on next_action.type. Do not infer the payer experience from the
requested payment method.
Action types
next_action.type | What your checkout does | How completion is confirmed |
|---|---|---|
display_instructions | Show the returned account, amount, and operation | Submit the payer's transaction ID to the returned verification endpoint |
redirect | Open the returned URL | Observe the deposit status or signed webhooks |
For display instructions, make_payment represents a P2C payment and
cash_out represents a P2P payment.
display_instructions
{
"type": "display_instructions",
"channel": "bkash",
"operation": "cash_out",
"recipient": {
"type": "phone",
"value": "01800000000",
"name": "Example Account"
},
"qr_payload": null,
"amount": "500.00",
"currency": "BDT",
"verification": {
"endpoint": "/api/v1/deposits/cm7deposit02/verify",
"required_fields": ["provider_transaction_id"]
}
}Render every value from the action instead of reconstructing instructions:
- show
make_paymentfor P2C andcash_outfor P2P; - show the exact
recipient.value; - include
recipient.namewhen present so the payer can cross-check it; - render
qr_payloadonly when non-null; - make amount and currency read-only;
- collect the payer's payment transaction ID and send it as
provider_transaction_idtoverification.endpoint.
The action is valid only while it is returned by the status endpoint and before
expires_at. Do not reuse recipient data across deposits.
redirect
{
"type": "redirect",
"url": "https://pay.omnipay.page/checkout/session-123"
}Open the returned URL directly. Do not call the manual verification endpoint for a redirect action. Continue observing the deposit status and webhooks until the deposit reaches a terminal state.
No action
next_action is null when a deposit is terminal or can no longer accept a
payment. Treat a non-null action as the only permission to continue checkout.
Never restore an action from cache after the API returns null.
Method unavailable
If the requested payment method is temporarily unavailable, creation returns
503 method_unavailable and no deposit is created. Retry after a short backoff
or let the payer choose another supported payment method.