Customer actions apply to payins and to the collection leg of transfers. Payouts need nothing from the recipient.
The two moments
When a route has no
customer_action, the customer just approves a prompt on their phone and you have nothing to show.
Requirement types
The requirement tells you what to ask for before you callPOST /payins.
A requirement can also carry
ussd_code and bilingual instructions (en, fr) you can show as they are:
Action types
Once the provider accepted the request, the payin carries aprovider_action while it waits for the customer.
next_action, redirect_url, otp_required, ussd_code) can still appear inside provider_action. They keep working for existing integrations; new code should read provider_action.type.
The flow
1
Read the requirement
Call
GET /coverage or create the payin quote. If the route has a customer_action, prepare your screen for it.2
Collect what is needed up front
For
otp_before, ask the customer for the code before creating the payin and send it as otp_code. Without it the request fails with 400 and reason otp_required.3
Create the payin
POST /payins returns pending. Keep the payin id.4
Show the action
When
payin.action_required arrives (or provider_action shows up when you poll), show the link, the USSD code, or the code field.5
Send the code, if asked
For
submit_otp, call POST /payins/{payin_id}/authorize with the customer’s code.6
Wait for the final status
The payin stays
pending until the provider confirms. Use payin.completed or payin.failed, or poll.Sending a code before: otp_before
Sending a code after: otp_after
When provider_action.type is submit_otp, the customer has received a code. Send it:
pending, with provider_action removed. The final status arrives like any other payin. A wrong code returns 422 with reason otp_invalid and leaves the payin waiting, so the customer can try again. See POST /payins/{payin_id}/authorize for every response.
Transfers
The collection leg of a transfer follows the same rules, with these differences:- Transfer quotes return
customer_actionfor the payer leg, so you can collect anotp_beforecode before creating the transfer. - Send
otp_codeonPOST /transfersfor anotp_beforeroute. - While the collection waits for the customer, the transfer carries
payin_action(same shape asprovider_action), and you receivetransfer.payin.action_required. - For
otp_after(payin_action.typeissubmit_otp), send the customer’s code toPOST /transfers/{transfer_id}/authorize. The transfer stayscollectinguntil the provider confirms; a wrong code returns422with reasonotp_invalidand can be retried.
- Always wait for
transfer.payin.completedortransfer.payin.failedbefore treating the collection as done.
Show the right screen
Checkout checklist
- Read
customer_actionfrom the quote. Forotp_before, show the instructions and collect the code before you create the payin. Codes are short-lived, so create the payin as soon as the customer enters one. - After creating the payin, show a waiting screen. Listen for
payin.action_required, or pollGET /payins/{payin_id}every few seconds for up to a minute. redirect: open the link in a new tab or the operator’s app. Do not embed it in an iframe. On a phone, prefer an entry fromapp_linkswhen there is one.dial_ussd: show the code large enough to read, with a copy button.messageis the operator’s own text and is often in French. Prefer your own wording based ontype.- Always wait for
payin.completedorpayin.failed. Coming back from a redirect, or a successful/authorize, does not mean the money has arrived.