Payment accounts: where your settlements go
The payment account tells Senfenico where to pay out your settlements. It can be a bank account, a mobile money account or a USDT wallet. It is required before you create a settlement. It is not used by transfers, which pay third parties.
One account, shared by test and live
Section titled “One account, shared by test and live”- Each merchant has a single payment account. To change the destination, update the existing account (
PUT) or delete it and create a new one. - The same account is used in test mode and live mode. A change made with an
sk_test_key therefore also applies to your live settlements. - Each settlement copies the details at creation time. Changing the account does not redirect a settlement already created.
Account types and required fields
Section titled “Account types and required fields”account_type |
Required fields | Notes |
|---|---|---|
bank |
rib or iban |
If you provide an iban, also add bank_name, bank_address, account_holder_name, account_holder_address and swift_bic_code. |
mobile |
provider and phone |
provider is orange_bf, moov_bf or coris_bf. |
usdt |
usdt_wallet_address |
Your USDT wallet address. |
Payment account fields
Section titled “Payment account fields”| Field | Type | Description |
|---|---|---|
reference |
string (UUID) | Account ID, for example 0b7d5c3e-9a41-4f2b-8c6e-1d2f3a4b5c6d. |
account_type |
string | bank, mobile or usdt. |
iban, rib |
string or null |
Bank identifiers. |
bank_name, bank_address |
string or null |
Bank and branch address. |
account_holder_name, account_holder_address |
string or null |
Account holder and their address. |
swift_bic_code |
string or null |
SWIFT/BIC code. |
provider |
string or null |
Mobile money operator (orange_bf, moov_bf or coris_bf). |
phone |
string or null |
Mobile money number, local format. |
usdt_wallet_address |
string or null |
USDT address. |
Create the payment account
Section titled “Create the payment account”/v1/payment/payment_accounts/curl https://api.senfenico.com/v1/payment/payment_accounts/ \ -H "X-API-KEY: sk_test_..." \ -H "Content-Type: application/json" \ -d '{ "account_type": "mobile", "provider": "orange_bf", "phone": "76000000" }'$client = new \GuzzleHttp\Client([ 'base_uri' => 'https://api.senfenico.com/v1/payment/', 'headers' => ['X-API-KEY' => getenv('SENFENICO_KEY')], 'http_errors' => false,]);
$res = $client->post('payment_accounts/', ['json' => [ 'account_type' => 'mobile', 'provider' => 'orange_bf', 'phone' => '76000000',]]);$body = json_decode($res->getBody(), true);$reference = $body['data']['reference'] ?? null;import osimport requests
res = requests.post( "https://api.senfenico.com/v1/payment/payment_accounts/", headers={"X-API-KEY": os.environ["SENFENICO_KEY"]}, json={ "account_type": "mobile", "provider": "orange_bf", "phone": "76000000", }, timeout=30,)body = res.json()reference = body.get("data", {}).get("reference")const res = await fetch( 'https://api.senfenico.com/v1/payment/payment_accounts/', { method: 'POST', headers: { 'X-API-KEY': process.env.SENFENICO_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ account_type: 'mobile', provider: 'orange_bf', phone: '76000000', }), },);const body = await res.json();const reference = body.data?.reference;Response (201):
{ "status": true, "message": "PaymentAccount created", "data": { "reference": "0b7d5c3e-9a41-4f2b-8c6e-1d2f3a4b5c6d", "account_type": "mobile", "iban": null, "rib": null, "bank_name": null, "bank_address": null, "account_holder_name": null, "account_holder_address": null, "swift_bic_code": null, "provider": "orange_bf", "phone": "76000000", "usdt_wallet_address": null }}Example body for a bank account identified by RIB:
{ "account_type": "bank", "rib": "BF042 01001 012345678901 23", "bank_name": "My Bank", "account_holder_name": "Example SARL"}If an account already exists, creation returns 400 with "message": "A PaymentAccount already exists. Please use the update endpoint if you want to make changes.".
Read the account
Section titled “Read the account”/v1/payment/payment_accounts/Returns a data list holding zero or one account, without pagination. It is the simplest way to get the reference.
curl https://api.senfenico.com/v1/payment/payment_accounts/ \ -H "X-API-KEY: sk_test_..."{ "status": true, "message": "PaymentAccount list retrieved", "data": [ { "reference": "0b7d5c3e-9a41-4f2b-8c6e-1d2f3a4b5c6d", "account_type": "mobile", "provider": "orange_bf", "phone": "76000000", "iban": null, "rib": null, "bank_name": null, "bank_address": null, "account_holder_name": null, "account_holder_address": null, "swift_bic_code": null, "usdt_wallet_address": null } ]}/v1/payment/payment_accounts/{reference}/Returns the account on its own ("message": "PaymentAccount retrieved").
Update the account
Section titled “Update the account”/v1/payment/payment_accounts/{reference}/PUT expects the full account, account_type included. Fields you do not send keep their old value. When you change type, for example from bank to mobile, explicitly send null for the old type’s fields, otherwise they would be copied into your next settlements.
curl -X PUT https://api.senfenico.com/v1/payment/payment_accounts/0b7d5c3e-9a41-4f2b-8c6e-1d2f3a4b5c6d/ \ -H "X-API-KEY: sk_test_..." \ -H "Content-Type: application/json" \ -d '{ "account_type": "mobile", "provider": "moov_bf", "phone": "70000000", "rib": null, "iban": null, "usdt_wallet_address": null }'$ref = '0b7d5c3e-9a41-4f2b-8c6e-1d2f3a4b5c6d';$res = $client->put("payment_accounts/{$ref}/", ['json' => [ 'account_type' => 'mobile', 'provider' => 'moov_bf', 'phone' => '70000000', 'rib' => null, 'iban' => null, 'usdt_wallet_address' => null,]]);ref = "0b7d5c3e-9a41-4f2b-8c6e-1d2f3a4b5c6d"res = requests.put( f"https://api.senfenico.com/v1/payment/payment_accounts/{ref}/", headers={"X-API-KEY": os.environ["SENFENICO_KEY"]}, json={ "account_type": "mobile", "provider": "moov_bf", "phone": "70000000", "rib": None, "iban": None, "usdt_wallet_address": None, }, timeout=30,)const ref = '0b7d5c3e-9a41-4f2b-8c6e-1d2f3a4b5c6d';const res = await fetch( `https://api.senfenico.com/v1/payment/payment_accounts/${ref}/`, { method: 'PUT', headers: { 'X-API-KEY': process.env.SENFENICO_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ account_type: 'mobile', provider: 'moov_bf', phone: '70000000', rib: null, iban: null, usdt_wallet_address: null, }), },);The 200 response contains "message": "PaymentAccount updated" and the updated account.
Delete the account
Section titled “Delete the account”/v1/payment/payment_accounts/{reference}/curl -X DELETE https://api.senfenico.com/v1/payment/payment_accounts/0b7d5c3e-9a41-4f2b-8c6e-1d2f3a4b5c6d/ \ -H "X-API-KEY: sk_test_..."The response is 204 No Content. Do not read the response body, and rely on the HTTP code. Without a payment account you can no longer create settlements, but existing ones keep their destination.
Errors
Section titled “Errors”| HTTP | error_code |
Cause |
|---|---|---|
400 |
INVALID_DATA |
A required field is missing for the chosen type (for example "For mobile money account, you must provide both provider and phone number.") or a value is not allowed (provider, account_type). Details in errors. |
400 |
none | An account already exists (creation). |
403 |
none | The reference belongs to another merchant ("message": "Not Authorized"). |
404 |
none | Unknown reference ("PaymentAccount does not exist with this reference."). |
Always use the reference returned by the API, in UUID format.