Direct mobile money payments (Charges API)
A charge debits a customer’s mobile money account without the customer leaving your website or app. You build the interface (number, operator, OTP field), and Senfenico passes the request on to the operator.
Use charges when you want full control of the payment experience, or when you collect in Benin, which the hosted page does not offer.
| Operation | Route |
|---|---|
| Create a charge | POST /v1/payment/charges/ |
| Submit the OTP | POST /v1/payment/charges/submit |
| Retrieve a charge | GET /v1/payment/charges/{reference}/ |
| List charges | GET /v1/payment/charges/ |
Two ways to confirm a payment
Section titled “Two ways to confirm a payment”Depending on the operator, a new charge waits either for an OTP that you submit, or for the customer to approve on their phone.
send_otpYou submit the OTPpay_offlineCustomer approves on their phonesuccessfailed
| Operator | provider |
Status at creation | How the customer confirms |
|---|---|---|---|
| Orange Money | orange_bf |
send_otp |
Generates an OTP by dialing *144*4*6*amount#, receives it by SMS and enters it in your app. |
| Moov Money | moov_bf |
send_otp or pay_offline |
Enters the OTP received by SMS (default), or approves via *555*6# with confirmation_method: "ussd". |
| Coris Money | coris_bf |
send_otp |
Enters the OTP received by SMS. |
| Sank Money | sank_bf |
send_otp |
Enters the OTP received by SMS. |
| MTN Mobile Money (Benin) | mtn_bj |
pay_offline |
Approves the request on their phone. |
| Moov Money (Benin) | moov_bj |
pay_offline |
Approves the request on their phone. |
Create a charge
Section titled “Create a charge”/v1/payment/charges/| Parameter | Type | Description |
|---|---|---|
amount |
integer, required | Amount in XOF, whole number, from 100 to 1000000. |
payment_method_details.provider |
string, required | orange_bf, moov_bf, coris_bf, sank_bf, mtn_bj or moov_bj. The operator must be enabled on your account. |
payment_method_details.phone |
string, required | Customer number, digits only, no country code. Burkina: 8 digits. Benin: 10 digits. |
payment_method_details.confirmation_method |
string, optional | otp (default) or ussd. Only Moov Money Burkina uses it. |
ext_id |
string, optional | Your own reference (order number), max 200 characters. Neither unique nor idempotent. |
currency |
string, optional | XOF (only value, default). |
payment_method |
string, optional | mobile_money (only value, default). |
-
Create the charge from your server
Fenêtre de terminal curl https://api.senfenico.com/v1/payment/charges/ \-H "X-API-KEY: $SENFENICO_KEY" \-H "Content-Type: application/json" \-d '{"amount": 1000,"ext_id": "ORD-2026-0042","payment_method_details": {"provider": "orange_bf","phone": "76000000"}}'<?php// composer require guzzlehttp/guzzle$http = new GuzzleHttp\Client(['base_uri' => 'https://api.senfenico.com/v1/payment/','headers' => ['X-API-KEY' => getenv('SENFENICO_KEY')],'http_errors' => false,]);$res = $http->post('charges/', ['json' => ['amount' => 1000,'ext_id' => 'ORD-2026-0042','payment_method_details' => ['provider' => 'orange_bf','phone' => '76000000',],]]);$body = json_decode((string) $res->getBody(), true);if ($res->getStatusCode() === 201 && $body['status']) {$charge = $body['data']; // reference, status...} else {// failure: $body['error_code'], $body['message']}import osimport requestsAPI = "https://api.senfenico.com/v1/payment"HEADERS = {"X-API-KEY": os.environ["SENFENICO_KEY"]}res = requests.post(f"{API}/charges/", headers=HEADERS, json={"amount": 1000,"ext_id": "ORD-2026-0042","payment_method_details": {"provider": "orange_bf","phone": "76000000",},}, timeout=60)body = res.json()if res.status_code == 201 and body["status"]:charge = body["data"] # reference, status...else:print(body.get("error_code"), body["message"])const API = 'https://api.senfenico.com/v1/payment';const headers = {'X-API-KEY': process.env.SENFENICO_KEY,'Content-Type': 'application/json',};const res = await fetch(`${API}/charges/`, {method: 'POST',headers,body: JSON.stringify({amount: 1000,ext_id: 'ORD-2026-0042',payment_method_details: {provider: 'orange_bf',phone: '76000000',},}),});const body = await res.json();if (res.status === 201 && body.status) {const charge = body.data; // reference, status...} else {console.error(body.error_code, body.message);}The Node.js examples use top-level
await. Run them as ES modules (a.mjsfile or"type": "module"inpackage.json), or wrap them in anasyncfunction.201 Createdresponse:{"status": true,"message": "Charge attempted","data": {"reference": "CH261126-101431-ORANGE_BF-1a2b3c4d5e","status": "send_otp","display_text": "Composez *144*4*6*1000# pour obtenir un code OTP, puis entrez-le sur notre plateforme pour finaliser la transaction.","live_mode": false}}Store
referencewith your order. Showdisplay_textto the customer, because it tells them what to do. This text is always in French; translate it on your side if needed. -
Read
data.statusto know what comes nextWith
send_otp, show an OTP field, then submit the OTP. Withpay_offline, showdisplay_textand wait for confirmation.
Initialization failure: HTTP 200 and status: false
Section titled “Initialization failure: HTTP 200 and status: false”If the operator rejects the request straight away (unknown number, insufficient balance, operator unavailable), the API returns 200 OK with status: false. Always check the HTTP code and the status field.
{ "status": false, "message": "Transaction failed. The phone number is not valid or is not associated with an account with operator. Please check the phone number and try again.", "error_code": "INVALID_ACCOUNT"}In that case, ask the customer to check their number or to try another operator, then create a new charge.
Submit the OTP
Section titled “Submit the OTP”/v1/payment/charges/submit| Parameter | Type | Description |
|---|---|---|
charge_reference |
string, required | The reference returned at creation. |
otp |
string, required | The code given by the customer. Spaces and non-digit characters are stripped. It must stay between 2 and 10 digits. |
curl https://api.senfenico.com/v1/payment/charges/submit \ -H "X-API-KEY: $SENFENICO_KEY" \ -H "Content-Type: application/json" \ -d '{ "charge_reference": "CH261126-101431-ORANGE_BF-1a2b3c4d5e", "otp": "123456" }'<?php$res = $http->post('charges/submit', ['json' => [ 'charge_reference' => $charge['reference'], 'otp' => $_POST['otp'],]]);$body = json_decode((string) $res->getBody(), true);
if ($res->getStatusCode() === 200 && $body['status']) { // paid: $body['data']['status'] === 'success'} else { // $body['error_code']: OTP_INVALID, OTP_EXPIRED...}res = requests.post(f"{API}/charges/submit", headers=HEADERS, json={ "charge_reference": charge["reference"], "otp": otp_entered,}, timeout=60)body = res.json()
if res.status_code == 200 and body["status"]: print("paid", body["data"]["status"])else: print(body.get("error_code"), body["message"])const r = await fetch(`${API}/charges/submit`, { method: 'POST', headers, body: JSON.stringify({ charge_reference: charge.reference, otp: otpEntered, }),});const result = await r.json();
if (r.status === 200 && result.status) { // paid: result.data.status === 'success'} else { console.error(result.error_code, result.message);}200 OK response when the payment is accepted:
{ "status": true, "message": "charge completed successfully", "data": { "reference": "CH261126-101431-ORANGE_BF-1a2b3c4d5e", "amount": 1000, "fees": 2.99, "currency": "XOF", "transaction_date": "2026-11-26T10:14:31.208411+00:00", "ip_address": "203.0.113.10", "status": "success", "live_mode": false, "payment_method": "mobile_money", "provider": "orange_bf", "ext_id": "ORD-2026-0042", "operator_id": "MP261126.1015.A12345", "cancelled_at": null, "cancellation_reason": null, "confirmation_attempts": [ { "ip_address": "203.0.113.10", "attempt_date": "2026-11-26T10:15:02.114093+00:00", "confirmation_status": "success" } ] }}This response differs from GET /charges/{reference}/ in two ways. The operator identifier is called operator_id here (operator_trans_id when reading), and fees is a number here (a string when reading). There is also no phone field.
200 OK response when the operator rejects it:
{ "status": false, "message": "Charge operation failed. The OTP is invalid. Please try again.", "error_code": "OTP_INVALID"}Retry after a refusal
Section titled “Retry after a refusal”| Operator | After a rejected OTP |
|---|---|
| Orange Money (live) | The charge becomes failed. Create a new charge; the customer generates a new OTP. |
| Moov, Coris, Sank | The charge stays send_otp, and the customer can re-enter the OTP on the same charge. |
| All (test mode) | The charge stays send_otp, and you can submit again. |
When in doubt, fetch the charge. If it is failed, create a new one. Do not submit an OTP on a failed charge.
A charge that is already success no longer accepts an OTP, and the API returns 404 CHARGE_NOT_FOUND.
Wait for confirmation (pay_offline)
Section titled “Wait for confirmation (pay_offline)”For Moov Money in USSD mode and for Benin, there is no OTP to submit. The customer approves on their phone, then the status becomes success.
- Show
display_text. For Moov, it asks the customer to dial*555*6#and follow the instructions. - Wait for the
charge.successwebhook, or pollGET /v1/payment/charges/{reference}/about every 5 seconds. - Set your own timeout (for example 10 to 15 minutes), after which you offer the customer to try again.
Retrieve a charge
Section titled “Retrieve a charge”/v1/payment/charges/{reference}/curl https://api.senfenico.com/v1/payment/charges/CH261126-101431-ORANGE_BF-1a2b3c4d5e/ \ -H "X-API-KEY: $SENFENICO_KEY"<?php$res = $http->get("charges/{$reference}/");$charge = json_decode((string) $res->getBody(), true)['data'] ?? null;r = requests.get(f"{API}/charges/{reference}/", headers=HEADERS, timeout=30)charge = r.json().get("data")const r = await fetch(`${API}/charges/${reference}/`, { headers });const { data: charge } = await r.json();{ "status": true, "message": "Charge attempted", "data": { "reference": "CH261126-101431-ORANGE_BF-1a2b3c4d5e", "amount": 1000, "fees": "2.990", "currency": "XOF", "transaction_date": "2026-11-26T10:14:31.208411Z", "ip_address": "203.0.113.10", "status": "success", "live_mode": false, "payment_method": "mobile_money", "provider": "orange_bf", "phone": "76000000", "ext_id": "ORD-2026-0042", "operator_trans_id": "MP261126.1015.A12345", "cancelled_at": null, "cancellation_reason": null, "created_at": "2026-11-26T10:14:31.209027Z", "updated_at": "2026-11-26T10:15:02.117652Z", "confirmation_attempts": [ { "ip_address": "203.0.113.10", "attempt_date": "2026-11-26T10:15:02.114093Z", "confirmation_status": "success" } ] }}The message is "Charge attempted" whatever the status, so always read data.status. An unknown reference, or one created with the other key (test or live), returns 404 and "Charge not found".
Charge fields
Section titled “Charge fields”| Field | Type | Description |
|---|---|---|
reference |
string | Unique charge identifier. Treat it as an opaque string. |
status |
string | send_otp, pay_offline, success, failed (plus pending, canceled, reserved). See Lifecycle. |
amount |
integer | Amount debited, in XOF. |
fees |
decimal (string) | Fee rate applied, as a percentage of the amount: "2.990" = 2.99%. It is not an amount in XOF. |
currency |
string | XOF. |
provider |
string | Operator code, for example orange_bf. |
phone |
string | Number debited. |
ext_id |
string or null |
Your reference. null for a charge created by a checkout. |
operator_trans_id |
string or null |
Transaction ID at the operator, when known. Useful for disputes. |
live_mode |
boolean | true in live mode. |
transaction_date |
ISO 8601 date (UTC) | Timestamp recorded when the charge was created (not the confirmation time). |
created_at, updated_at |
ISO 8601 date (UTC) | Creation and last update. updated_at reflects the latest status change. |
ip_address |
string | IP address that created the charge. |
confirmation_attempts |
list | Each OTP submission: ip_address, attempt_date, confirmation_status (success / failed). |
cancelled_at, cancellation_reason |
null in practice |
Reserved for cancellation. |
payment_method |
string | mobile_money. |
List charges
Section titled “List charges”/v1/payment/charges/The list returns 10 charges per page (page parameter, for example ?page=2), newest first.
| Filter | Example | Effect |
|---|---|---|
status |
success |
One of the charge statuses. |
ext_id |
ORD-2026-0042 |
Exact match on your reference. |
reference |
CH2611 |
Reference containing this value. |
provider, phone |
moov_bf |
Exact match. |
operator_trans_id |
MP2611… |
Operator identifier. |
date_from, date_to |
2026-11-01 |
Creation date, inclusive, YYYY-MM-DD. |
amount_min, amount_max |
500 |
Amount in XOF. |
order_by |
-amount |
created_at, -created_at (default), amount, -amount, status, -status. |
curl "https://api.senfenico.com/v1/payment/charges/?ext_id=ORD-2026-0042" \ -H "X-API-KEY: $SENFENICO_KEY"{ "status": true, "message": "Charge list retreived", "data": [ { "reference": "CH261126-101431-ORANGE_BF-1a2b3c4d5e", "status": "success", "amount": 1000, "ext_id": "ORD-2026-0042", "…": "…" } ], "pagination": { "count": 1, "total_pages": 1, "current_page": 1, "page_size": 10, "has_next": false, "has_previous": false }}To find the charge behind a checkout, fetch the checkout and read its charge_reference.
Errors
Section titled “Errors”| HTTP | error_code |
When | What to do |
|---|---|---|---|
201 |
none | Charge created (status: true). |
Continue based on data.status. |
200 |
For example INVALID_ACCOUNT, INSUFFICIENT_FUNDS, EXTERNAL_API_ERROR, INTERNAL_ERROR or UNKNOWN_ERROR |
Creation rejected by the operator (status: false). |
Offer the customer to fix the number or to try another operator. |
200 |
For example OTP_INVALID, OTP_EXPIRED, INSUFFICIENT_FUNDS, MONTHLY_TRANSACTION_LIMIT_REACHED or DAILY_TRANSACTION_LIMIT_REACHED |
OTP rejected (status: false). |
See Retry after a refusal. |
400 |
INVALID_DATA |
Invalid field, for example an amount out of range, a malformed number, an operator not enabled on your account, or an empty or malformed OTP. Details in errors. |
Fix the request. |
403 |
UNAUTHORIZED_CHARGE_PROVIDER |
Operator not authorized for your account. In practice this is almost always caught earlier, as 400 INVALID_DATA (example below). Handle both. |
Email contact@senfenico.com to enable it. |
403 |
none | Missing or invalid API key. status is a string here (see Authentication). |
Check the X-API-KEY header. |
404 |
CHARGE_NOT_FOUND |
On submit, the reference is unknown or the charge is already success. |
Fetch the charge to see its status. |
500 |
INTERNAL_ERROR |
Unexpected error. | Fetch the charge before retrying, to avoid a double debit. |
Example 400 when the operator is not enabled on your account:
{ "status": false, "message": "Invalid data provided. Please check the input and try again.", "error_code": "INVALID_DATA", "errors": { "payment_method_details": { "provider": ["You does not have permission to charge with coris_bf."] } }}403 response for an invalid key. Check the HTTP code before status (see Missing or invalid key).
{ "status": "False", "message": "Invalid API Key." }The full list, with the message to show the customer, is on the Error codes page.
Limits
Section titled “Limits”| Limit | Details |
|---|---|
| Amount | Whole number from 100 to 1,000,000 XOF per charge. |
| No idempotency | Every POST /charges/ creates a new charge, even with the same ext_id. Before retrying, follow Reconciliation. |
| No cancellation through the API | A pending charge stays pending until confirmed or failed. Ignore it on your side. |
| Refunds | See Refunds. |
With an sk_test_ key, use these numbers with their paired amount. The test OTP is always 123456.
| Operator | Behavior in test mode |
|---|---|
| Orange, Coris, Sank, Moov (OTP) | The charge is send_otp. Submit 123456. |
Moov with confirmation_method: "ussd" |
The charge is pay_offline and becomes success about 5 seconds later if number and amount match, otherwise failed. |
Benin (mtn_bj, moov_bj) |
Not available in test mode. |