OTP Verification
Some Mobile Money operators require USSD confirmation before validating a collection. Learn how to handle this flow in your integration.
What is OTP Verification?
Manual confirmation by the subscriber
Some operators (Orange CI, Orange BF, Orange SN…) require the payer to confirm the transaction on their end before the debit occurs. This protects the subscriber from unauthorized payment initiations.
A USSD code to dial
The subscriber dials a USSD code on their phone (e.g. *144*4*4#). The operator returns a temporary OTP code valid for a few minutes, which the subscriber enters in your application.
Step-by-step process
- 1
Query GET /operators
Fetch the list of operators. Each operator exposes an otp_required field (boolean) and ussd_code (the USSD code to dial).
- 2
Check otp_required
If the selected operator has otp_required: true, proceed with the following steps. Otherwise, call POST /collections directly without otp_code.
- 3
Display the USSD code to the customer
Tell the user the USSD code to dial (ussd_code field from the operator). Example: "Dial *144*4*4# on your phone to receive your Orange OTP."
- 4
The user dials USSD and receives an OTP
The mobile operator sends a USSD session to the subscriber. The subscriber receives a temporary code valid for a few minutes.
- 5
Collect the OTP in your interface
Provide an input field for the user to enter the received code.
- 6
Call POST /collections with otp_code
Include the entered code in the otp_code field of the request. The transaction will be validated immediately.
Operators requiring OTP
This list is loaded in real time from GET /operators and filtered to operators where otp_required is true.
| Country | Operator | Slug | USSD Code |
|---|---|---|---|
Integration in POST /collections
Complete example: checking the operator then initiating the collection with the otp_code field.
# 1. Vérifier si l'opérateur nécessite un OTP
curl -X GET "https://newapi.sebpay.bj/api/v1/operators?country=CI" \
-H "X-Public-Key: pk_live_your_key" \
-H "X-Secret-Key: sk_live_your_secret"
# → Si otp_required: true, afficher le ussd_code à l'utilisateur
# 2. Initier la collecte avec l'OTP saisi par l'utilisateur
curl -X POST https://newapi.sebpay.bj/api/v1/collections \
-H "X-Public-Key: pk_live_your_key" \
-H "X-Secret-Key: sk_live_your_secret" \
-H "Content-Type: application/json" \
-d '{
"amount": 5000,
"currency": "XOF",
"phone": "2250700000000",
"operator": "orange",
"country": "CI",
"external_reference": "ORDER-001",
"otp_code": "123456"
}'OTP is mandatory for these operators
If you do not provide otp_code for an operator that requires it, the transaction will be immediately rejected by the operator.
Dynamic check via GET /operators
Do not hardcode the list of OTP operators — it may change. Always query GET /operators when the operator is selected and dynamically read otp_required and ussd_code.