Skip to content

Refunds: give back a mobile money payment

A refund gives your customer back all or part of a successful charge, for example after a canceled order, an item out of stock or a duplicate payment. You create the request through the API, then Senfenico processes it.

  1. You create the refund. It is recorded as pending, and the amount is immediately removed from your deposit balance (available) and shown in pending (see Balances).
  2. The Senfenico team processes the request and moves the refund to success or failed.
  3. You receive the refund.success or refund.failed webhook. If it fails, the amount goes back to available.

The refund is taken from the deposit balance of the operator that collected the charge (Burkina, Moov Benin or MTN Benin). The collection fee of the original charge is not returned, so refunding 10,000 XOF costs your balance 10,000 XOF.

POST/v1/payment/refunds/
Parameter Type Required Description
charge string yes reference of the charge to refund. It must be success, belong to you and have been created in the same mode (test or live) as the key used.
amount integer yes Amount to give back, in XOF, greater than 0. May be lower than the charge amount (partial refund).
reason string no requested_by_customer, fraudulent or abandoned.
note string no Free text explaining the context (visible to the team processing the request).
ext_id string no Your own reference (max 200 characters), for example the support ticket number. Not unique.
Fenêtre de terminal
curl https://api.senfenico.com/v1/payment/refunds/ \
-H "X-API-KEY: sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"charge": "CH261126-101512-ORANGE_BF-7c41e9a0b2",
"amount": 1000,
"reason": "requested_by_customer",
"note": "Order 5531 canceled by the customer",
"ext_id": "support-5531"
}'

A 201 response means the request is recorded but not yet executed.

{
"status": true,
"message": "Refund attempted",
"data": {
"reference": "re_8d2f6a1c0b9e4d7fa3c5e1b2d4f6a8c0",
"charge": "CH261126-101512-ORANGE_BF-7c41e9a0b2",
"amount": 1000,
"reason": "requested_by_customer",
"status": "pending",
"live_mode": false,
"note": "Order 5531 canceled by the customer",
"ext_id": "support-5531",
"created_at": "2026-11-26T11:40:09.512330Z"
}
}

A checkout payment creates a charge, and that charge is what you refund. The charge field doesn’t accept the checkout reference (CHK…).

  1. Read the checkout with GET /v1/payment/checkouts/{reference}/ and take its charge_reference.
  2. Create the refund with that value in charge.
Fenêtre de terminal
curl https://api.senfenico.com/v1/payment/checkouts/CHK261126-101431--3f9a0c1d2e/ \
-H "X-API-KEY: sk_test_..."
# then, with data.charge_reference:
curl https://api.senfenico.com/v1/payment/refunds/ \
-H "X-API-KEY: sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"charge": "CH261126-101502-ORANGE_BF-8b41079ee8",
"amount": 1000,
"reason": "requested_by_customer",
"ext_id": "support-5531"
}'

Response from GET /v1/payment/checkouts/{reference}/ (excerpt):

{
"status": true,
"message": "Checkout details retrieved",
"data": {
"reference": "CHK261126-101431--3f9a0c1d2e",
"charge_reference": "CH261126-101502-ORANGE_BF-8b41079ee8",
"amount": 1000,
"phone": "76000000",
"provider": "orange_bf",
"live_mode": false,
"status": "success"
}
}

The refund responds as shown in Create a refund, with a 201 and the status pending.

  • charge_reference is null if no payment was attempted, and points to the last attempt made on the page. If that charge isn’t success, the refund is rejected (Only successful charges can be refunded.).
  • The API takes no destination number. The refund is tied to the charge, which carries the customer’s number (phone) and operator (provider). Senfenico copies that operator into the refund’s mmo field (visible in the webhook) and debits the matching deposit balance. The Senfenico team then pays the customer back by hand. If the customer has changed numbers, write to contact@senfenico.com before creating the refund.
Field Type Description
reference string Refund ID, re_ prefix.
charge string Reference of the refunded charge.
amount integer Amount given back, in XOF.
reason string or null requested_by_customer, fraudulent or abandoned.
status string pending, success or failed.
live_mode boolean Mode of the key used.
note string or null Your note.
ext_id string or null Your reference.
created_at ISO 8601 date (UTC) Creation date.

You can refund the same charge in several steps. The total of a charge’s pending and success refunds cannot exceed its amount. failed refunds do not count.

For a 5,000 XOF charge, a first refund of 2,000 and then a second of 3,000 are accepted. A third one, even of 100, is refused:

{
"status": false,
"message": "Invalid data provided. Please check the input and try again.",
"error_code": "INVALID_DATA",
"errors": {
"amount": ["Refund amount exceeds the remaining charge balance."]
}
}

The charge’s amount_refunded field only counts success refunds. It therefore only goes up once the refund has been processed.

  1. pendingamount reserved, waiting
  2. successcustomer refunded
    failedamount returned
Refund status lifecycle
Status Meaning Webhook
pending Request recorded, amount reserved on your deposit balance. refund.pending
success The customer has been refunded. Final status. refund.success
failed The refund could not be made. The amount goes back to your balance. refund.failed

See Webhooks to subscribe and verify the signature.

In the data of a refund.* webhook, the format differs from the API’s. charge is the charge’s internal numeric id (for example 48213) rather than its reference, and an mmo field (the charge’s operator) is added. Match the event on reference, the re_… reference returned at creation, or on your ext_id.

GET/v1/payment/refunds/{reference}/
Fenêtre de terminal
curl https://api.senfenico.com/v1/payment/refunds/re_8d2f6a1c0b9e4d7fa3c5e1b2d4f6a8c0/ \
-H "X-API-KEY: sk_test_..."

An unknown reference, or one from the other mode, returns 404 with error_code: "TRANSACTION_NOT_FOUND".

GET/v1/payment/refunds/

50 refunds per page (not 10 like the other lists), newest first by default. The response contains data and pagination (count, total_pages, current_page, page_size, has_next, has_previous).

Parameter Description
page Page number. A page past the end returns the last one, so stop when has_next is false.
charge_reference Refunds of a specific charge (exact match).
refund_reference Refund reference containing this text.
ext_id Exact match on your reference.
status pending, success or failed.
reason requested_by_customer, fraudulent or abandoned.
date_from, date_to YYYY-MM-DD dates (UTC), inclusive.
amount_min, amount_max Amount bounds, inclusive.
order_by created_at, -created_at, amount, -amount, status, -status.
Fenêtre de terminal
curl "https://api.senfenico.com/v1/payment/refunds/?charge_reference=CH261126-101512-ORANGE_BF-7c41e9a0b2" \
-H "X-API-KEY: sk_test_..."

Refusals return 400, error_code: "INVALID_DATA" and details in errors:

Field in errors Message Cause
charge The charge with the provided reference does not exist. Unknown reference.
charge This charge does not belong to you. The charge belongs to another account.
charge This charge is in the wrong mode. Test charge refunded with a live key, or the reverse.
charge Only successful charges can be refunded. The charge is not success.
amount This field is required. amount missing or equal to 0.
amount Refund amount exceeds the remaining charge balance. Exceeds the remaining amount.
reason "…" is not a valid choice. Reason not in the list.

See also Error codes.

First create a successful test charge with an sk_test_ key, for example with these values:

Then refund it with the same key. The test refund is recorded as pending and stays there, which is enough to check your integration (response, refund.pending webhook received, test balance reduced).

The move to success or failed depends on manual processing by the Senfenico team. No API call triggers it, and you can’t get refund.success or refund.failed on demand in test mode. Test those handlers with simulated responses.