Ir al contenido

Referencia de la API

The Sonco Pay API lets your server create crypto payments, follow them until they are paid, read your balance and withdraw it. Every request and response is JSON over HTTPS.

URL base
https://soncopay.example

Endpoints

EndpointDescription
POST/v1/paymentsCrear un pago
GET/v1/paymentsListar pagos
GET/v1/payments/{id}Consultar un pago
GET/v1/payments/{id}/methodsMétodos ofrecidos para un pago
POST/v1/payments/{id}/methodElegir un método
POST/v1/payments/{id}/simulateSimular un pago (modo de prueba)
GET/v1/payments/{id}/timelineCronología de un pago
GET/v1/methodsMétodos, activos y redes disponibles
GET/v1/ratesTipos de cambio actuales en USD
GET/v1/balancesSaldo por activo
GET/v1/ledgerMovimientos del saldo
GET/v1/statementsExtracto de cuenta
GET/v1/statements.csvExtracto de cuenta (CSV)
POST/v1/payoutsCrear un retiro
GET/v1/payoutsListar retiros
GET/v1/payouts/{id}Consultar un retiro
GET/v1/payouts/{id}/timelineCronología de un retiro
GET/v1/payout-feesComisiones de red y retiro mínimo
GET/v1/payout-destinationsListar los destinos de retiro
POST/v1/payout-destinationsGuardar un destino de retiro
GET/v1/payout-destinations/{id}Consultar un destino de retiro
PATCH/v1/payout-destinations/{id}Cambiar el nombre de un destino de retiro
DELETE/v1/payout-destinations/{id}Desactivar un destino de retiro
POST/v1/refundsCrear un reembolso
GET/v1/refundsListar reembolsos
GET/v1/refunds/{id}Consultar un reembolso
POST/v1/refunds/{id}/cancelCancelar un reembolso
POST/v1/refunds/previewVista previa de un reembolso
GET/v1/payments/{id}/refund-optionsOpciones de reembolso de un pago
GET/v1/settlementModo de liquidación y destinos
GET/v1/settlement/itemsPagos por liquidar
PUT/v1/settlement/routesElegir un destino de liquidación
GET/v1/feesSus comisiones y límites
POST/v1/customersClientes, facturas, suscripciones
GET/v1/customersFacturas y suscripciones
POST/v1/invoicesCrear una factura
GET/v1/invoicesFacturas y suscripciones
POST/v1/invoices/{id}/sendFacturas y suscripciones
POST/v1/invoices/{id}/remindFacturas y suscripciones
POST/v1/invoices/{id}/voidFacturas y suscripciones
POST/v1/subscriptionsCrear una suscripción
POST/v1/subscriptions/{id}/pauseFacturas y suscripciones
POST/v1/subscriptions/{id}/cancelFacturas y suscripciones
GET/v1/billing/summaryResumen de facturación y reloj de prueba

SDKs

Official libraries for Node.js, PHP and Python call the API for you: authentication with your key, JSON errors turned into exceptions, and webhook signature checks.

Version 2.2.0 adds customers, invoices and subscriptions (customers, plans, invoices, subscriptions and billing resources, invoice.* and subscription.* events). It is backward compatible with 2.0.0, the first release under the Sonco Pay name.

Version 2.3.0 adds fee_paid_by when creating a payment (who pays the service fee) and documents the new fields fee_paid_by, amount_due and fee_quote.

Version 2.12.1 changes no call: it documents the amount the payer really pays. For mobile money, show payer_total or next_action.amount (operator fee included), never pay_amount alone; payment methods give estimated_payer_total.

Version 2.12.0 completes billing through the API: invoices.pdf returns the exact bytes of the PDF (a Buffer in Node.js; now in Python too), billing.previewMessage shows a message, and in test mode billing.testClock and customers.simulateStop. It adds settlement.settleNow and types every invoice.* and subscription.* event. It is backward compatible, except invoices.pdf in Node.js, which returns a Buffer instead of a string.

Version 2.11.0 adds fees_percent to GET /v1/payout-fees: the percentage part of the mobile money payout fees per currency and method (XOF:mtn_bj). The fee of a payout is the fixed part plus the amount times this percentage, rounded up. It is backward compatible.

Version 2.10.0 adds refunds to the number that paid (destination kind original), the fields available and on_hold of the balances and funded_by of a payout, and the error codes payment_already_withdrawn, payout_funds_on_hold, refund_above_maximum and refunds_paused. It is backward compatible.

Version 2.9.0 adds the events payout_destination.created, payout_destination.removed and payment.settlement_held, and the error code payout_method_not_allowed. It is backward compatible.

Version 2.8.0 adds the field from_address of a payout (the address the money left from, when Sonco Pay knows it, otherwise null) and the events payout_destination.confirmed and payout_destination.usable. It is backward compatible.

Version 2.7.0 adds refunds and cancellations: refunds.create, list, retrieve, cancel, preview and payments.refundOptions (in Python: refund_options), the payment statuses partially_refunded and refunded and the events refund.* and payment.refunded.

Version 2.6.0 runs your own payment page without redirection: payments.methods (methods of a payment, with fees and amounts), chooseCrypto, chooseMobileMoney, chooseCard, chooseBinancePay (in Python: choose_crypto, choose_mobile_money, choose_card, choose_binance_pay), poll, the field next_action and the events payment.attempt_failed and payment.failed.

Version 2.5.0 verifies the timestamped webhook signature (t=…,v1=…, 5 minute window, protection against replays) and keeps accepting the legacy signature while your account uses it. Pass all the request headers to constructEvent.

Version 2.4.0 documents multi-approval of payouts: the status awaiting_approval, the field approval, the errors policy_denied and multisig_quorum_unreachable, and the events payout.awaiting_approval, payout.approved, payout.rejected, payout.expired and pendingapproval.

Using WordPress? See WordPress and WooCommerce: no code needed.

Install
npm install https://soncopay.example/assets/sdk/soncopay-node-2.12.1.tgz
Inicio rápido
import SoncoPay from 'soncopay-node';
// const { SoncoPay } = require('soncopay-node');

const sp = new SoncoPay(process.env.SONCOPAY_API_KEY);

const payment = await sp.payments.create({
  amount: '25.00',
  currency: 'USD',
  order_id: 'demo-1042',
  return_url: 'https://shop.example/thanks',
});
res.redirect(303, payment.checkout_url);

Verificar un webhook

Pruebe primeroUse a sp_test_… key while you build: the SDKs work the same way in both modes.
Verificar un webhook
app.post('/webhooks/soncopay', express.raw({ type: 'application/json' }), (req, res) => {
  let event;
  try {
    event = SoncoPay.webhooks.constructEvent(req.body, req.headers, process.env.SONCOPAY_WEBHOOK_SECRET);
  } catch (err) {
    return res.status(400).send('invalid signature');
  }
  if (event.event === 'payment.paid') {
    // deliver event.data.order_id
  }
  res.sendStatus(200);
});

WordPress y WooCommerce

The Sonco Pay extension adds Sonco Pay to the WooCommerce checkout and a payment button to any WordPress page, without writing code. It needs WordPress 6.2 and PHP 8.1 or later. WooCommerce is only needed for the shop checkout.

Descargar la extensión soncopay-wordpress-1.0.0.zip

  1. Download the extension and install the zip from Plugins, Add New, Upload Plugin, then activate it.
  2. Open the Sonco Pay menu, paste your sp_test_… key and your webhook signing secret, then click Test the API key of the current mode.
  3. For a shop, enable Sonco Pay in WooCommerce, Settings, Payments. It works with the classic checkout and the block checkout.
  4. Place a test order. When it is confirmed, paste your sp_live_… key and switch the mode to Live.

Orders are confirmed by a signed webhook. The extension gives Sonco Pay its own address (/wp-json/soncopay/v1/webhook) with every payment: there is nothing to set up in the dashboard. Your site must be on a public https address; otherwise the order is confirmed when the customer comes back to your shop. Refunds are made from the WooCommerce order screen: the customer receives a link to choose where the money goes.

The [soncopay_button] shortcode adds a payment button to any page or post, with or without WooCommerce. Options: amount, currency (XOF, XAF, USD, EUR), description, label, min, max and ask_email="yes". Without amount, the visitor types the amount (donations). Payments made with the button are listed under Sonco Pay, Button payments.

Clave API con lista de direcciones IPAdd the address of your web server to the key in your dashboard, otherwise payments are refused.
Shortcode
<!-- fixed amount -->
[soncopay_button amount="5000" currency="XOF" description="Workshop ticket"]

<!-- amount typed by the visitor -->
[soncopay_button currency="XOF" min="1000" label="Donate" ask_email="yes"]

Authentication

Send your API key in the X-Api-Key header. Create keys in your dashboard under Developers.

Each key has scopes: payments (payments, methods, rates, customers, invoices) and payouts (payouts and payout destinations), and an optional list of allowed IP addresses. A live key with the payouts scope needs at least one allowed address. A call outside the scopes of the key fails with 403 and the code api_key_scope; from an address that is not allowed, with 403 and api_key_ip_not_allowed. Keys created before October 6, 2026 keep both scopes and accept any address until you edit them.

sp_live_…

Moves real money. Use it only on your production server. Live keys work once your business verification is approved.

sp_test_…

Works on separate test data: no real payment is taken and payments can be simulated.

Mantenga sus claves en secretoKeep your keys on your server. Never put them in a web page or a mobile app.
Request
curl https://soncopay.example/v1/balances -H "X-Api-Key: sp_test_…"

Flujo de pago

  1. Your server creates a payment with the amount and your order ID.
  2. You show the payment on your own page with the API (see Your own payment page), or, as an option, you redirect your customer to checkout_url.
  3. The customer pays in crypto on the chosen network (the exact amount), with Binance Pay, by mobile money or by bank card where it is available.
  4. We confirm the payment, send you a payment.paid webhook and credit your balance, minus the fee.
Conciliación por importe exactoOn networks, every open payment receives a unique exact amount (for example 25.0137 USDT). That is how a deposit is matched to its order: tell your customer to send exactly this amount.

Su propia página de pago (sin redirección)

The redirection to checkout_url is optional. Your server can run the whole payment through the API while your own page shows each step to the payer: every method offered on the payment page works this way (crypto on each network offered, including TRX and BNB, Binance Pay, mobile money and bank card). Your API key stays on your server: your page calls your server, which calls the API.

  1. Create the payment (POST /v1/payments), with the payer information you already have.
  2. List the methods offered for this payment (GET /v1/payments/{id}/methods): each one gives its service fee, the estimated amount in its currency, the fields to ask the payer and the choose body to send.
  3. Send the choice of the payer (POST /v1/payments/{id}/method). You can also create and choose in one call with method on creation.
  4. Show what next_action says (table below), then follow the payment with the webhooks and by reading it (GET /v1/payments/{id}).
  5. Fulfil the order on payment.paid.

Métodos ofrecidos para un pago

GET/v1/payments/{id}/methods

Answers payment_id, status, amount, currency, fee_paid_by, expires_at, payer_requirements (the fields your account collects and the missing fields to send in payer) and methods. Each method has method, code, label, asset and network (crypto), pay_currency, service_fee (in the currency of the payment, when the payer pays it), estimated_pay_amount (total in pay_currency, service fee included), and for mobile money operator_fee_percent, estimated_operator_fee and estimated_payer_total (what the phone will ask, operator fee included: show this amount), fields, redirect and choose. The exact amount is set when the method is chosen. The list is empty once the payment is no longer open.

The service fee is paid by the payer unless you decided otherwise (fee_paid_by): the amount in next_action is always the exact total to pay, fee included. Never add anything to it.

Qué mostrar a continuación

Siguiente acciónMostrar en su página
choose_methodNo method yet, or the last request was declined (retry is true, last_error says why). Show the methods; the payer may retry the same one.
send_cryptoShow address, network_label, amount and a QR code of qr_content, with the time left until expires_at. amount_rule exact: the payer sends exactly this amount, which identifies the payment. at_least: the address belongs to this payment. Show memo when there is one.
wait_for_confirmationA transaction was seen on the network (tx_hash). Show that the payment is being confirmed; never ask to send again.
open_walletBinance Pay: a button to url and a QR code of qr_content, with amount and asset.
approve_on_phoneMobile money: ask the payer to approve the request on the phone phone (operator operator) for amount currency. Until change_method_after, another method or a new request is refused with 409.
redirectBank card or mobile money on the operator page: send the payer to url (secure page). Add return_url to the choice so that the payer comes straight back to your page.
nullNothing left for the payer to do: paid, expired, failed or partially paid. Read status.

Mobile money: amount in next_action is what the phone of the payer will ask, operator fee included (operator_fee, null when there is none; base_amount is the amount without it). Show this amount to the payer, never pay_amount. The payment also carries payer_total (the same total) and operator_fee; pay_amount and amount_due stay the amount to pay without the operator fee (the amount credited and reconciled).

Métodos del pago
curl https://soncopay.example/v1/payments/pay_3f9a5c0d21e4b7a6c8d1/methods -H "X-Api-Key: sp_test_…"
Response200
{
  "object": "payment_methods",
  "payment_id": "pay_3f9a5c0d21e4b7a6c8d1",
  "status": "new", "amount": "25", "currency": "USD", "fee_paid_by": "payer",
  "payer_requirements": { "fields": [{ "key": "name", "required": true, "provided": false }], "missing": ["name"] },
  "methods": [
    { "method": "crypto", "code": "crypto", "label": "USDT · Tron (TRC-20)", "asset": "USDT", "network": "TRON",
      "pay_currency": "USDT", "service_fee": "0.13", "estimated_pay_amount": "25.13", "fields": [], "redirect": false,
      "choose": { "method": "crypto", "asset": "USDT", "network": "TRON" } },
    { "method": "mobile_money", "code": "orange_ci", "label": "Orange Money", "operator": "ORANGE",
      "pay_currency": "XOF", "service_fee": "0.13", "estimated_pay_amount": "15074", "operator_fee_percent": "2.75", "estimated_operator_fee": "415", "estimated_payer_total": "15489", "fields": ["phone"],
      "redirect": false, "choose": { "method": "mobile_money", "code": "orange_ci" } },
    { "method": "card", "code": "card", "label": "Bank card", "pay_currency": "XOF", "redirect": true,
      "choose": { "method": "card", "code": "card" } }
  ]
}
{
  "type": "send_crypto", "asset": "USDT", "network": "TRON", "network_label": "Tron (TRC-20)",
  "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE", "memo": null,
  "amount": "25.1337", "amount_rule": "exact", "underpaid": false, "received_amount": null,
  "qr_content": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
  "expires_at": "2026-10-07T15:30:00+00:00", "quote_expires_at": null
}

Cada método en su página

Crypto: {"method": "crypto", "asset": "USDT", "network": "TRON"} (or BSC and every network offered for this payment, TRX on TRON, BNB on BSC). For TRX and BNB, the amount is guaranteed until quote_expires_at, then updated on the same address: read the payment again at that time.

Partial crypto payment: the status becomes underpaid and next_action.amount is what is left to send to the same address before expires_at, as one amount (underpaid is true, received_amount gives what arrived). Show this amount as it is. Without the rest in time, the status becomes partially_paid.

Mobile money: {"method": "mobile_money", "code": "orange_ci", "phone": "+2250700000000"}, plus operator when fields asks for it. The request reaches the phone of the payer (approve_on_phone), or the payer confirms on the operator page (redirect). A declined request brings the payment back to new with last_error and the webhook payment.attempt_failed: send the request again (another number if needed) or offer another method.

Bank card, where available: {"method": "card", "return_url": "https://shop.example/pay/1042"}. Card details are entered on the secure card page only (redirect); the payer then comes back to return_url.

Binance Pay: {"method": "binance_pay"}, then open_wallet.

Change of method: send another choice while the payment is new or waiting. After a partial payment, the method can no longer change.

Cripto (USDT, TRX, BNB)
curl -X POST https://soncopay.example/v1/payments/pay_3f9a5c0d21e4b7a6c8d1/method \
  -H "X-Api-Key: sp_test_…" -H "Content-Type: application/json" \
  -d '{"method":"crypto","asset":"USDT","network":"TRON","payer":{"name":"Demo Customer"}}'
# or create and choose in one call
curl -X POST https://soncopay.example/v1/payments -H "X-Api-Key: sp_test_…" -H "Content-Type: application/json" \
  -d '{"amount":"25","currency":"USD","order_id":"1042","method":"crypto","asset":"TRX","network":"TRON"}'
Dinero móvil
curl -X POST https://soncopay.example/v1/payments/pay_3f9a5c0d21e4b7a6c8d1/method \
  -H "X-Api-Key: sp_test_…" -H "Content-Type: application/json" \
  -d '{"method":"mobile_money","code":"orange_ci","phone":"+2250700000000"}'
# declined (status "new", last_error): send it again, or choose another method
Tarjeta bancaria
curl -X POST https://soncopay.example/v1/payments/pay_3f9a5c0d21e4b7a6c8d1/method \
  -H "X-Api-Key: sp_test_…" -H "Content-Type: application/json" \
  -d '{"method":"card","return_url":"https://shop.example/pay/1042"}'
# next_action: {"type":"redirect","url":"…/pay/pay_3f9a5c0d21e4b7a6c8d1/redirect"}
Binance Pay
curl -X POST https://soncopay.example/v1/payments/pay_3f9a5c0d21e4b7a6c8d1/method \
  -H "X-Api-Key: sp_test_…" -H "Content-Type: application/json" \
  -d '{"method":"binance_pay"}'

Seguir el pago

Webhooks: payment.confirming, payment.paid, payment.underpaid, payment.attempt_failed, payment.expired and payment.failed carry the whole payment, next_action included.

From your page, ask your server every few seconds; your server reads GET /v1/payments/{id}. Each read also checks a pending mobile money or card request, applies an expiry that is due and updates the TRX or BNB amount of an expired rate, exactly like the payment page. The SDKs offer poll, which reads until the status or the next action changes.

Modo de prueba Test mode: POST /v1/payments/{id}/simulate pays the chosen method. Mobile money test numbers: ending in 99 is declined, ending in 98 stays waiting, any other number is paid after a few seconds.
Seguir el pago
curl https://soncopay.example/v1/payments/pay_3f9a5c0d21e4b7a6c8d1 -H "X-Api-Key: sp_test_…"
# status, next_action, amount_remaining (partial payment), last_error

Crear un pago

POST/v1/payments

FieldDescription
amountrequiredcadena o númeroAmount to collect.
currencyrequiredstringUSD, EUR, XOF, XAF, or a crypto asset (USDT, USDC, BTC, ETH, BNB, TRX, LTC). Fiat amounts are converted at the current rate when the customer chooses a method.
order_idstringYour reference. Sending the same order_id again returns the same payment, so retries are safe.
descriptionstringShown to the customer on the payment page.
customer_emailstringYour customer's email, for your records.
return_urlstringWhere the customer goes back after paying.
callback_urlstringWebhook URL for this payment only, as a public HTTPS address. By default, the webhook of the API key that created the payment is used, or else the URL of your account.
lifetime_minutesintegerBetween 10 and 1440. By default, the lifetime set by Sonco Pay.
methodsarrayRestrict the choices, for example ["USDT"], ["binance_pay"], ["USDT:TRON"], ["mobile_money"] or a method code such as ["orange_ci"].
metadataobjectAny JSON object, returned as is.
countrystringCustomer country (ISO alpha-2, for example CI, SN or CM): only the methods of this country are offered.
methodstringStarts the payment right away, without redirection: crypto (with asset and network), binance_pay, card or a mobile money method code (see Mobile money). The payment then carries next_action.
assetstringWith method set to crypto: the asset to receive, for example USDT.
networkstringWith method set to crypto: the network, for example TRON or BSC.
phonestringWith method: the mobile money number, in international format.
operatorstringWith method: the operator, when the method needs one.
payerobjectInformation about the payer, all optional: name, email, phone (international format), country (ISO alpha-2) and reference (your own customer reference). See Payer information.
fee_paid_bystringWho pays the service fee for this payment: payer (the customer pays the amount plus the fee, you receive the full amount) or merchant (the fee is deducted from what you receive). By default, the choice made in your dashboard (Settings, Service fee).

Información del pagador

In the dashboard (Settings), choose for each field whether it is not collected, optional or required. A required field that your call does not send is asked to the customer on the payment page, before they choose how to pay. An email address also receives the payment receipt. Only the fields you collect are stored; they are kept for a limited time and never shown to anyone else.

The payment object carries payer (the collected fields, or null) in every response and in the signed webhooks. If you choose the method yourself with the API while a required field is missing, the call fails with 422 and the code payer_required (with fields); an invalid value fails with payer_invalid (with field).

Request
curl -X POST https://soncopay.example/v1/payments \
  -H "X-Api-Key: sp_test_…" \
  -H "Content-Type: application/json" \
  -d '{"amount":"25","currency":"USD","order_id":"1042","return_url":"https://shop.example/thanks",
       "payer":{"name":"Demo Customer","email":"[email protected]","reference":"client-42"}}'
Response201
{
  "id": "pay_3f9a5c0d21e4b7a6c8d1",
  "object": "payment",
  "livemode": false,
  "status": "new",
  "amount": "25", "currency": "USD",
  "order_id": "1042",
  "checkout_url": "…/pay/pay_3f9a5c0d21e4b7a6c8d1",
  "payer": { "name": "Demo Customer", "email": "[email protected]", "reference": "client-42" },
  "expires_at": "2026-10-01T15:30:00+00:00",
  …
}

Elegir un método

Skip this step if you redirect to checkout_url: the customer chooses on our page. On your own page, list the methods of the payment (GET /v1/payments/{id}/methods), then send the choice. GET /v1/methods gives the methods of your account in general.

The list depends on your account: Sonco Pay can enable or disable payment methods for each account. GET /v1/methods and GET /v1/payments/{id}/methods only return the methods open to your account. A method that is not open, sent in methods or chosen with POST /v1/payments/{id}/method, is refused with 422 and the code method_not_allowed. A payment already started on a method keeps working.

GET/v1/methods

Each entry of methods has a method (crypto, binance_pay, mobile_money or card), a code and a kind. Mobile money entries add operator, countries, currency, redirect and fields (what to send: phone, sometimes operator). The payment_methods list gives the methods usable by your account, with your effective fees.

Request
curl https://soncopay.example/v1/methods -H "X-Api-Key: sp_test_…"

POST/v1/payments/{id}/method

FieldDescription
methodrequiredstringcrypto, binance_pay, card, mobile_money (with code) or a mobile money method code.
assetstringFor crypto: the asset to receive, for example USDT.
networkstringFor crypto: TRON, BSC, ETH, POLYGON, BTC or LTC.
codestringWith mobile_money: the method code, for example orange_ci or mtn_cm.
phonestringFor mobile money: the customer number, in international format.
operatorstringFor mobile money: the operator, when the method needs one.
payerobjectPayer information collected on your page, merged with what the payment already has.
return_urlstringAfter a secure page (bank card, operator page), the payer comes straight back to this address (https; http in test mode) instead of the payment page. It also becomes the return_url of the payment.

The bank card is offered where it is available: GET /v1/methods then lists it with kind set to card.

The QR code of any payment is available at /pay/{id}/qr.svg.

Request
curl -X POST https://soncopay.example/v1/payments/pay_3f9a5c0d21e4b7a6c8d1/method \
  -H "X-Api-Key: sp_test_…" \
  -H "Content-Type: application/json" \
  -d '{"method":"crypto","asset":"USDT","network":"TRON"}'
{ "method": "crypto", "asset": "USDT", "network": "TRON" }

# the payment now carries:
# pay_address, pay_amount (send exactly this amount), network, expires_at

Dinero móvil

Mobile money works in several countries through local operators (Wave, Orange Money, MTN MoMo, Moov Money, Free Money and others). Each method has a code made of the operator and the country (for example orange_ci or mtn_cm), the countries where it works and the currency it collects: XOF or XAF.

Países, operadores y monedas

CountryOperadores (códigos de los métodos)Currency
Côte d'Ivoire CIWave wave_ci, Orange Money orange_ci, MTN Mobile Money mtn_ci, Moov Money moov_ciXOF
Senegal SNWave wave_sn, Orange Money orange_sn, Free Money free_snXOF
Benin BJMTN Mobile Money mtn_bj, Moov Money moov_bjXOF
Burkina Faso BFOrange Money orange_bf, Moov Money moov_bfXOF
Cameroon CMMTN Mobile Money mtn_cm, Orange Money orange_cmXAF

GET /v1/methods returns the methods open to your account right now, with kind set to mobile_money, code, operator, countries and currency.

  1. Choose the customer's country with country (ISO alpha-2, for example CI or CM) and the operator with method (its code), plus phone in international format. You can also choose the method later with POST /v1/payments/{id}/method.
  2. The customer approves the request on their phone. Show them instructions. When the method works in redirect mode, pay_url is filled in: send the customer there.
  3. When the operator confirms, the payment becomes paid and you receive the payment.paid webhook. Your balance is credited in the collected currency: XOF or XAF.

Campos del pago

FieldDescription
method_codeThe chosen method: crypto, binance_pay, card or a mobile money code.
providerFamily of the chosen method: crypto, binance_pay, mobile_money or card, and null before the choice. It never names an internal processor. Base your logic on method, method_code and status.
pay_urlBinance Pay: the Binance Pay link. Mobile money in redirect mode and bank card: a link to /pay/{id}/redirect on our domain, which sends the customer to the secure payment page while the payment waits for it, then back to the payment page.
customer_phoneThe number the request was sent to.
operatorThe mobile money operator, when known.
countryThe customer country (ISO alpha-2).
instructionsText to show the customer while they approve the request.
last_errorWhy the last request failed, for example a request declined by the customer.
Una solicitud a la vezWhile a request waits on the customer's phone, a new choice is refused with 409. A declined request puts the payment back to new with last_error: the customer can try again, up to 5 attempts, then 429.
Importes en XOF y XAFThese currencies have no decimals: the amount to pay is rounded up to the unit, and a mobile money payout amount must be a whole number.
Modo de prueba The number decides the outcome: ending in 99, the request is declined; ending in 98, it stays pending; any other number is paid after a few seconds, or at once with POST /v1/payments/{id}/simulate.
Request
# Côte d'Ivoire: Orange Money, amount in XOF (no decimals)
curl -X POST https://soncopay.example/v1/payments \
  -H "X-Api-Key: sp_test_…" \
  -H "Content-Type: application/json" \
  -d '{"amount":"5000","currency":"XOF","country":"CI","order_id":"demo-1043","method":"orange_ci","phone":"+2250700000000"}'

# Cameroon: MTN Mobile Money, amount in XAF (no decimals)
curl -X POST https://soncopay.example/v1/payments \
  -H "X-Api-Key: sp_test_…" \
  -H "Content-Type: application/json" \
  -d '{"amount":"5000","currency":"XAF","country":"CM","order_id":"demo-1044","method":"mtn_cm","phone":"+237670000000"}'

Retiros a dinero móvil

Send method (the method code of the country, for example wave_sn or orange_cm), phone and amount to POST /v1/payouts, plus operator when the method needs one. The currency is the one of the method: XOF or XAF, in whole amounts.

Request
# Senegal: Wave, XOF
curl -X POST https://soncopay.example/v1/payouts \
  -H "X-Api-Key: sp_test_…" \
  -H "Content-Type: application/json" \
  -d '{"method":"wave_sn","phone":"+221770000000","amount":"10000","reference":"demo-payout-8"}'

# Cameroon: Orange Money, XAF
curl -X POST https://soncopay.example/v1/payouts \
  -H "X-Api-Key: sp_test_…" \
  -H "Content-Type: application/json" \
  -d '{"method":"orange_cm","phone":"+237690000000","amount":"15000","reference":"demo-payout-9"}'

Consultar y listar

GET/v1/payments/{id}

GET/v1/payments

ParameterDescription
statusOnly payments with this status, for example paid.
qSearch by payment ID, order ID or customer email.
limitFrom 1 to 200. Default: 50.
offsetNumber of payments to skip. The response says has_more when there are more.
Modo de prueba POST /v1/payments/{id}/simulate marks a payment as paid with its exact amount, once a method is chosen, so you can test your webhook handler.
Request
curl https://soncopay.example/v1/payments/pay_3f9a5c0d21e4b7a6c8d1 -H "X-Api-Key: sp_test_…"

curl "https://soncopay.example/v1/payments?status=paid&limit=50" -H "X-Api-Key: sp_test_…"

# test mode
curl -X POST https://soncopay.example/v1/payments/pay_3f9a5c0d21e4b7a6c8d1/simulate -H "X-Api-Key: sp_test_…"

Estados de pago

StatusMeaning
newCreated; the customer has not chosen a method yet.
waitingMethod chosen; waiting for the funds.
confirmingDeposit detected; waiting for confirmations.
Confirmed and credited to your balance. Deliver the order.
expiredNot paid in time. A deposit that arrives within 24 hours of expiry still marks it paid, with late: true in the webhook.
underpaidCrypto on an address reserved for the payment: part of the amount arrived, the rest (amount_remaining) is expected at the same address before expires_at.
partially_paidThe rest did not arrive in time: the amount received is kept and our team can validate the payment or return the funds.
failedPaid with a wrong amount through Binance Pay.
partially_refundedPart of the payment was refunded (refunded_amount). See Refunds.
refundedEverything that could be refunded was refunded, after a full refund or a cancellation.

Activo equivocado recibido

Wrong asset received: when the customer sends another asset, or the same asset on another network, to the address reserved for a crypto payment, the payment keeps its status and gets a wrong_asset object, and you receive the payment.wrong_asset webhook. Our team then decides: switch the payment to the asset received, wait for the rest, or close the case. Do not fulfil the order before payment.paid.

FieldDescription
wrong_asset.statein_review (our team is handling it) or resolved.
wrong_asset.reasonwrong_asset (another asset) or wrong_network (the same asset on another network).
wrong_asset.expected, wrong_asset.receivedWhat the payment expected and what arrived: asset, network, amount, and tx_hash for the transfer received.
wrong_asset.resolutionswitched (the payment was accepted in the asset received), ignored or closed (nothing was credited to this payment), null while in review.
wrong_asset.handling_fee, wrong_asset.fee_percentWrong asset handling fee taken when the payment was switched, and its rate; null otherwise.

When our team switches the payment to the asset received, you receive the usual payment.paid, sent like any other (the callback_url of the payment, then the webhook of the key, then the webhook of your account): your existing code validates the order with no change. It also carries resolution (wrong_asset), received_asset, received_network and fee_details (commission, wrong_asset_fee, overpayment). asset, network and amount_due of the payment become those of the asset received.

A wrong asset handling fee (2 % of the amount credited by default) is taken on top of the commission when the payment is switched. It is included in fee, given in wrong_asset.handling_fee, and shown as its own line in your statement.

Balances

GET/v1/balances

Returns your available balance per asset, in the mode of the key you use.

reserved gives, per asset, the amount and the fee of your payouts that are still open. They are already deducted from balances.

available gives, per asset, what you can withdraw now; on_hold gives what is still in its waiting period before payout (amount and next_available_at). Each payout is taken from your payments, the oldest first, and GET /v1/payouts/{id} lists them in funded_by. A payout above available is refused with 422 payout_funds_on_hold.

GET /v1/payments/{id} carries payout_hold when the payment has a waiting period before payout: days, available_at (end of the waiting period, once the payment is paid) and card_rule. Card payments can always be withdrawn only 14 days after they are paid, as set by the card network rules (chargeback period): card_rule is then true. Otherwise payout_hold is null.

Request
curl https://soncopay.example/v1/balances -H "X-Api-Key: sp_test_…"
Response
{
  "livemode": false,
  "balances": { "USDT": "124.5", "XOF": "35000" },
  "reserved": { "USDT": "51" }
}

GET/v1/ledger

Lists every movement of your balance: payments, fees and payouts. Filter with asset, page with limit (up to 500) and offset.

Identificadores del registroWhen the platform moves its books to double entry, /v1/ledger keeps its format but each id becomes the ID of the accounting line: IDs from before and after the switch cannot be compared. Use statements to reconcile.
Request
curl "https://soncopay.example/v1/ledger?asset=USDT&limit=100" -H "X-Api-Key: sp_test_…"

Fees

GET/v1/fees

Returns the fee applied to your payments, as a percentage plus a fixed amount in USD, for each method you can use in this mode, with the payout fees and the limits. Each part comes from your own rate first, then from the method, then from the platform default: percent_source and fixed_source say which one applies.

The values above are examples: your dashboard and this endpoint show the fees that apply to you.

Each network (mobile money operator, card network, blockchain) charges its own payment fees, which vary from one network to another and over time. Sonco Pay always applies the rate declared in Sonco Pay itself: the one shown on the payment page and returned by the API (operator_fee, payer_total), even if the network changes its own. On the payment page, the exact amount to pay is only shown once the customer has chosen a payment method, without the detail of the fees; before that, each network shows its own total, all fees included.

Quién paga la tarifa de servicio

By default the customer pays the service fee: the payment page shows the amount, the service fee and the total, and the customer pays the total. Your balance receives the full amount. You can instead take the fee from what you receive, in the dashboard (Settings, Service fee) or for one payment with fee_paid_by. The choice is fixed on each payment when it is created.

Every payment and webhook carries fee_paid_by, amount_due (the amount to pay in asset, service fee included; for mobile money the phone asks payer_total, operator fee included), fee_quote (the service fee added to that total, or null), and after payment fee and net_amount. GET /v1/fees returns your setting in fee_bearer; when Sonco Pay has locked this setting, another value is ignored: the payment is accepted with the locked setting and fee_paid_by shows who pays.

Request
curl https://soncopay.example/v1/fees -H "X-Api-Key: sp_test_…"
Response
{
  "livemode": false,
  "payment": { "percent": "0.5", "fixed_usd": "0", "percent_source": "global", "fixed_source": "global" },
  "per_method": [ { "code": "orange_ci", "name": "Orange Money", "kind": "mobile_money", "percent": "1.5", … } ],
  "payout_fees": { "USDT:TRON": "1", … },
  "limits": { "min_payment_usd": 1, "min_payout_usd": 5 }
}

Mínimos y comisiones de retiro por red

Cada retiro, liquidación automática incluida, debe alcanzar el mínimo de su red; la comisión de la red se suma al importe y se toma de su saldo.

La liquidación automática sale en cuanto el total adeudado en una red alcanza su mínimo. Por debajo, los importes se suman en su saldo y salen juntos, en un solo retiro.

Moneda y redMínimo por retiroFeeTotal mínimo tomado del saldo
Cargando…

Estos valores vienen de la configuración en vivo y pueden cambiar con las redes. GET /v1/fees los devuelve para su cuenta (payout_limits).

Payouts

POST/v1/payouts

Withdraws from your balance to a crypto address, a mobile money number or a saved payout destination, bank account included. For crypto, the network fee from /v1/payout-fees is added to the amount; the same call returns the minimum payout.

In live mode, a payout created with an API key goes to a saved and confirmed payout destination (destination_id): an address typed in the request is refused with 422 and the code destination_required (during the transition period it is still accepted and the response carries a Sonco-Deprecation header). Payouts are also limited per 24 hours, in number and in USD: above the limit of your account, 429 and the code payout_velocity_exceeded.

FieldDescription
assetstringCrypto: the asset to withdraw, for example USDT (required). Mobile money: the currency, by default the one of the method.
networkstringCrypto (required): the network to send on, for example TRON.
amountrequiredcadena o númeroAmount the address receives.
addressstringCrypto (required): the destination address, checked against the network format.
methodstringMobile money: the method code, for example wave_sn or orange_cm.
phonestringMobile money: the number to pay, in international format.
operatorstringMobile money: the operator, when the method needs one.
memostringMemo or tag, when the destination needs one.
referencestringYour reference. Sending the same reference again returns the same payout.
destination_idstringA saved and confirmed payout destination. Its details replace asset, network, address, method and phone; asset, when sent, must equal its currency. It is the only way to pay out to a bank account.
Request
curl -X POST https://soncopay.example/v1/payouts \
  -H "X-Api-Key: sp_test_…" \
  -H "Content-Type: application/json" \
  -d '{ "asset": "USDT", "network": "TRON", "amount": "150",
  "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE", "reference": "withdraw-77" }'
StatusMeaning
pending_reviewA large payout waits for our team's review before it is sent.
queuedAccepted and waiting to be sent.
submittingBeing handed over for sending. If the answer is lost, the same request is retried safely: a payout is never sent twice.
sentSent; waiting for confirmation on the network.
unknownNo clear answer after sending: our team checks before anything else happens. The payout is never sent again automatically.
awaiting_manualBank transfer: waiting for our team to execute it. It then becomes completed with bank_reference.
completedDone: tx_hash (crypto) or bank_reference (bank transfer) is filled in.
failedThe payout failed; the amount and the fee are back in your balance.
rejectedRefused after review; the amount and the fee are back in your balance.
awaiting_approvalWaits for the signatures of your team (multi-approval). The amount and the fee are set aside meanwhile.
expiredNot signed in time (multi-approval); the amount and the fee are back in your balance.

Campos del retiro

FieldDescription
railcrypto, momo (mobile money) or bank.
destination_idThe saved destination used, or null.
destinationCopy of the destination at the time of the request (kind, label, currency, masked details), or null.
bank_referenceReference of the bank transfer, once it is executed.
tx_hashTransaction hash of a crypto payout.
from_addressThe address the money left from on the network, when Sonco Pay knows it (payouts sent from our own wallet), otherwise null. Optional: use it only to look the transfer up when the blockchain explorer is slow to show it. It is not a proof of payment: the proof stays tx_hash and its confirmation (payout.completed).
errorWhy the payout failed, when it did.
approval_idMulti-approval: the request to sign (GET /v1/payouts/{id} gives approval: status, required, approvals, expires_at, signatures, missing), or null.
Request
curl https://soncopay.example/v1/payouts/po_8b2d… -H "X-Api-Key: sp_test_…"

curl https://soncopay.example/v1/payout-fees -H "X-Api-Key: sp_test_…"

Destinos de retiro

Save where your money goes once, confirm it in your dashboard, then pay out with destination_id only. A stolen API key cannot add an address and empty your balance to it.

In the dashboard, these saved destinations are listed under Withdrawal methods: the Withdraw form of the dashboard only offers them, there is no field to type an address there.

EndpointDescription
GET/v1/payout-destinationsYour destinations (filters kind and status) and the settings that apply to them.
POST/v1/payout-destinationsSaves a destination. It starts as pending_confirmation.
GET/v1/payout-destinations/{id}Consultar un destino de retiro
PATCH/v1/payout-destinations/{id}Changes the label only. New details make a new destination, to confirm again.
DELETE/v1/payout-destinations/{id}Disables a destination. It is kept for your history, never erased.

Campos por tipo

FieldDescription
kindrequiredstringcrypto, mobile_money or bank.
labelstringYour own name for this destination, up to 80 characters.
asset
network
address
Crypto (required): the asset, the network and the address, checked against the network format.
memoCrypto: memo or tag, when the network needs one.
method
phone
Mobile money (required): the method code, for example wave_sn or orange_cm, and the number in international format.
operatorMobile money: the operator, when the method needs one.
country
holder
Mobile money, optional: the country of the number, one of the countries of the method (the number must start with its country code), and holder, the name of the account holder.
holder
bank_name
Bank (required): the account holder and the name of the bank.
iban
account_number
Bank: either an IBAN, which is checked, or a local account number (8 to 34 letters and digits).
swift_bicBank, optional: the SWIFT/BIC code.
countryBank: two-letter country code. With an IBAN, it is taken from the IBAN.
currencyBank (required): one of settings.bank_currencies. Mobile money: by default the currency of the method. Payouts are never converted.
Confirmación solo en el panelA new destination is pending_confirmation. A team member confirms it in the dashboard, under Withdrawal methods, by typing their password again. An API key can never confirm a destination. Depending on the platform settings, the confirmation must come from another team member than the one who added it.

Automatic confirmation: when Sonco Pay turns it on for your account, a destination added with an API key comes back active at once, with confirmed_by set to api_key:<prefix> and usable_from. It can be used for payouts only after the waiting period (the one of the platform in live mode, none in test mode), like a manual confirmation. settings.api_auto_confirm in GET /v1/payout-destinations tells whether it is on. You still receive payout_destination.created then payout_destination.confirmed, and your team is told of every address added.

Webhooks: payout_destination.confirmed when a destination is confirmed, then payout_destination.usable once it can be used for payouts. See Webhooks.

Webhooks: payout_destination.created when a destination is added (dashboard, API or app) and payout_destination.removed when it is removed or disabled, with removed_by: partner or sonco_pay.

Sonco Pay can enable or disable payout networks and methods for each account. A disabled one is not listed for your account: GET /v1/payout-fees, settings.payout_methods and settings.mobile_money_methods only list what is open to your account. Adding or confirming a destination, or a payout, on a disabled one is refused with 422 and the code payout_method_not_allowed. A destination saved before stays listed with payout_allowed: false and usable: false; automatic settlement to it waits with the reason payout_method_disabled.

Mobile money destinations: settings.mobile_money_methods lists the methods open to your account, with code, name, operator, countries, dial_codes, currencies, limits, notice and payouts. You can save a number on any listed method. When payouts is false, no payout can be sent to this method in this mode yet: a payout request to it is refused with 422 and the code payout_method_unavailable before any amount is reserved, and automatic settlement to it waits with the reason destination_not_ready (hold.state: method_unavailable). In test mode, payouts to mobile money are simulated. The phone number is encrypted at rest and only shown masked, in details.phone_masked.

Messages from Sonco Pay: settings.payout_method_notices maps a payout method (USDT:TRON, mtn_bj, bank) to a short message from our team about it, and each mobile money method has its notice (or null). Show it next to the method. A refused payout (payout_method_unavailable or payout_method_not_allowed) gives the message in detail and notice when there is one.

Request
# 1. save it: status 'pending_confirmation'
curl -X POST https://soncopay.example/v1/payout-destinations \
  -H "X-Api-Key: sp_test_…" \
  -H "Content-Type: application/json" \
  -d '{"kind":"crypto","asset":"USDT","network":"TRON","address":"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE","label":"Treasury"}'

# 2. a team member confirms it in the dashboard (the password is asked again)
# 3. pay out to it once usable is true
curl -X POST https://soncopay.example/v1/payouts \
  -H "X-Api-Key: sp_test_…" \
  -H "Content-Type: application/json" \
  -d '{"destination_id":"pd_5c1e…","amount":"50","reference":"demo-payout-9"}'

Periodo de espera de seguridad

In live mode, a confirmed destination can be used from usable_from, at the end of a security waiting period that starts at confirmation. usable tells you whether a payout can use it now. There is no waiting period in test mode.

In a hurry? For a destination in its waiting period, the dashboard offers Ask to lift the waiting period: our team decides. The last request is in cooldown_waiver (status open, granted, refused, lapsed or cancelled, decision_reason), or null. When the waiting period is lifted, the payout_destination.usable webhook is sent.

StatusMeaning
pending_confirmationSaved, waiting for confirmation in the dashboard.
activeConfirmed. Usable from usable_from.
disabledDisabled by you or by our team, kept for your history.
rejectedRefused by our team.

Ajustes devueltos por la lista

GET /v1/payout-destinations returns items and settings. These settings are set by the platform and can change: read them rather than writing them in your code.

SettingMeaning
cooldown_hoursWaiting period after confirmation, in hours (0 in test mode).
require_saved_destinationWhen true, every payout must use destination_id.
waiver_requestsWhen true, a destination in its waiting period can be sent to our team with a request to lift the waiting period.
second_confirmerWhen true, another team member must confirm a destination you added.
api_keys_can_createWhen false, destinations can only be added from the dashboard.
bank_currenciesCurrencies accepted for bank transfers.
bank_payout_fees
bank_payout_min
Fee and minimum amount of a bank transfer, per currency.
encryption_readyWhen false, mobile money and bank destinations cannot be saved right now.

Datos enmascarados

Full phone numbers, IBANs and account numbers are stored encrypted and never returned. details shows what you need to recognise a destination: address for crypto, phone_masked for mobile money, iban_masked or account_masked for a bank account.

Response
{
  "id": "pd_5c1e…", "object": "payout_destination", "livemode": true,
  "kind": "mobile_money", "label": "Demo payouts", "currency": "XOF",
  "status": "active", "usable": false, "usable_from": "2026-10-03T09:00:00+00:00",
  "details": { "method_code": "wave_sn", "country": "SN", "phone_masked": "+221•••••000" },
  "created_via": "api", "confirmed_at": "2026-10-02T09:00:00+00:00", …
}

Códigos de error

These errors carry a stable code in the body, next to detail.

CodeHTTPMeaning
destination_not_confirmed409The destination was not confirmed in the dashboard yet.
destination_cooling_down409Confirmed, but the waiting period is not over: the body carries usable_from.
destination_disabled409The destination is disabled.
destination_mode_mismatch409A test destination with a live key, or the reverse.
destination_duplicate409The same details are already saved: the body carries destination_id.
destination_limit40950 open destinations at most per mode.
destination_currency_mismatch422asset differs from the currency of the destination: payouts are not converted.
destination_required422Your account only pays out to saved destinations: send destination_id.
destination_invalid422Invalid details: the body carries field, the field to fix.
destination_not_found404Unknown destination.
api_key_not_allowed403Destinations can only be added from the dashboard.
data_key_missing503Mobile money and bank destinations cannot be saved right now.
Response409
{
  "detail": "…",
  "code": "destination_cooling_down",
  "usable_from": "2026-10-03T09:00:00+00:00"
}

Aprobación múltiple

You can ask that several people of your team approve each payout before it leaves. It is not a blockchain multisig: approvals happen in Sonco Pay and apply to every payout method. It is off by default and is turned on per business in the dashboard (Settings, Signatures).

When it is on, POST /v1/payouts (API key or dashboard) answers 201 with status awaiting_approval and an approval_id. The amount and the fee are set aside at once. The payout leaves only once the quorum has signed (M out of N signers, or all of them); a signer can refuse with a reason, which blocks it. A request not signed in time becomes expired and the amount comes back to your balance.

Signers sign in the dashboard only, with a recent two-factor code: an API key can never sign, and Sonco Pay staff never sign for you. New payout destinations, the settlement mode and the signers also need the signatures. Automatic settlement keeps running without signatures only to destinations approved by the signers and within the limits they set; above, the automatic payout waits for signatures too.

Policies, as at BitGo, each with its action, ask for approval or refuse: a whitelist of destinations (a destination joins it only once approved) and velocity limits (maximum amount per payout, hour, day or week, in USD or in one asset). A payout refused by a policy answers 403 policy_denied with policies. The person who asks for a payout never counts as an approval. Once the policies are locked, changing them answers 403 policies_locked.

Response
{
  "id": "po_9ff64299628ce397f64b",
  "status": "awaiting_approval",
  "amount": "50", "asset": "USDT",
  "approval_id": "apr_0c4428b95a8d644a20f5",
  "approval": {
    "status": "pending", "required": 2, "approvals": 1,
    "expires_at": "2026-10-07T17:44:18Z",
    "signatures": [{ "email": "[email protected]", "decision": "approve" }],
    "missing": [{ "email": "[email protected]" }]
  }
}

Reembolsos y cancelaciones

Refund all or part of a paid payment, or cancel it and refund everything that is left. The money leaves your balance and goes back to the payer, on the method you give or on the one the payer chooses.

Refunds are off by default: Sonco Pay turns them on for your account. Until then, every refund route answers 403 with the code refunds_disabled.

The API key needs the payouts scope, like payouts (a live key with this scope needs a list of allowed IP addresses). In the dashboard, the permission refunds.create creates, cancels and previews refunds, payments.view reads them, and creating a refund asks for a recent two-factor code, like a payout.

A payment can be refunded for 30 days after it was paid (period set by Sonco Pay, window_ends_at in the refund options). Several partial refunds are allowed, up to the refundable amount.

Importe que puede reembolsar

At most the net_amount of the payment (what you received, the Sonco Pay fee already deducted), minus what is already refunded or in progress. The fee of the original payment is never refunded, nor an overpayment or top-up fees kept by Sonco Pay.

  • The payer paid the fee (fee_paid_by payer): 100 USDT requested, the payer paid 100.5, you received 100. You can refund 100.
  • You paid the fee (fee_paid_by merchant): 100 USDT paid, fee 0.5, you received 99.5. You can refund 99.5.

Your balance is debited by the gross amount, in the asset of the payment (currency).

Cargo por cambio de método

When the payer is refunded on another method than the one used to pay, a fee is deducted from the refund. Sonco Pay sets the grid; the current values are in fee_grid of the refund options.

ConversionCargo (%)Meaning
same0Same asset on the same network, or the same mobile money method.
network10Same crypto asset on another network (for example USDT BSC to USDT TRON), or a payment from an exchange account refunded on a network.
asset10Another crypto asset.
crypto_to_momo15Paid in crypto, refunded by mobile money.
momo_to_crypto15Paid by mobile money, refunded in crypto.
momo_other10Another mobile money method.
other15Any other case, for example a bank card.

You receive 2 points of this fee (set by Sonco Pay, partner_share), credited to your balance. 100 refunded at 10%: fee 10, 2 for you, 8 for Sonco Pay. At 15%: fee 15, 2 for you, 13 for Sonco Pay. At 0%: nothing.

net_amount is amount minus fee, converted to the asset of the payer at the rate of the moment (rate, null for the same asset). The usual network fee of a payout (network_fee) is then deducted: payer_amount is what the payer receives. Example: 100 USDT, from USDT TRON to USDT BSC (network fee 0.3): fee 10, partner_share 2, net_amount 90, payer_amount 89.7.

Opciones de reembolso
curl https://soncopay.example/v1/payments/pay_3f9a5c0d21e4b7a6c8d1/refund-options \
  -H "X-Api-Key: sp_test_…"
Response200
{
  "object": "refund_options", "payment_id": "pay_3f9a5c0d21e4b7a6c8d1",
  "enabled": true, "disabled_reason": null, "currency": "USDT",
  "refundable_amount": "60", "refunded_amount": "40", "pending_amount": "0",
  "window_ends_at": "2026-11-06T14:31:07+00:00", "link_expiry_hours": 72,
  "delay_minutes": 30, "partner_share_points": "2",
  "fee_grid": { "same": "0", "network": "10", "asset": "10", "crypto_to_momo": "15",
                "momo_to_crypto": "15", "momo_other": "10", "other": "15" },
  "options": [
    { "kind": "crypto", "asset": "USDT", "network": "TRON", "label": "USDT · Tron (TRC20)",
      "conversion": "same", "fee_percent": "0", "payer_currency": "USDT", "network_fee": "1" },
    { "kind": "mobile_money", "method": "mtn_bj", "label": "MTN Mobile Money",
      "payer_currency": "XOF", "conversion": "crypto_to_momo", "fee_percent": "15", "network_fee": "0" }
  ]
}

Dos formas de reembolsar

Direct (mode direct, by default): you give the destination, a crypto address (kind crypto, asset, network, address, memo) or a mobile money number (kind mobile_money, method, phone). The methods offered are in options of the refund options; mobile money appears only when mobile money payouts are available.

Back to the number that paid (kind original, nothing else to give): for a payment paid by mobile money, the refund goes back to the number that paid, through the operator, with no fee for changing method and without asking anything to the payer. When it is possible, it comes first in options. One refund of this kind is sent at a time for a payment; the next one waits for it.

Link (mode link): the payer receives a link (link_url, status awaiting_payer), chooses a method, types an address or a number and sees the fees before confirming. You send the link to the payer. It expires (link_expires_at, after link_expiry_hours): an unused link becomes expired and the amount comes back to your balance.

Cancel and refund: with cancel true, the refund covers everything that is left (amount is ignored) and kind is cancel.

Before it leaves, a refund is scheduled for a delay set by Sonco Pay (delay_minutes, send_after): you can cancel it until then. Above a threshold, the Sonco Pay team reviews it first (pending_review). If your business turned on multi-approval, it also waits for the signatures of your team (awaiting_approval). It is then sent as a payout (payout_id).

Crear un reembolso

POST/v1/refunds

FieldDescription
payment_idrequiredstringThe paid payment to refund.
amountcadena o númeroAmount to refund, in the currency of the payment. By default, everything that is left to refund.
cancelbooleantrue cancels the payment and refunds everything that is left; amount is then ignored.
modestringdirect (by default) or link.
destinationobjectRequired in direct mode: {"kind": "original"} (number that paid, mobile money payments), {"kind": "crypto", "asset", "network", "address", "memo"} or {"kind": "mobile_money", "method", "phone"}.
reasonstringThe reason, kept with the refund.
referencestringYour reference. Sending the same reference again returns the same refund.
metadataobjectYour own data, returned as it is.
Reembolso directo
curl -X POST https://soncopay.example/v1/refunds \
  -H "X-Api-Key: sp_test_…" -H "Content-Type: application/json" \
  -d '{"payment_id":"pay_3f9a5c0d21e4b7a6c8d1","amount":"40","reference":"refund-1042",
       "destination":{"kind":"crypto","asset":"USDT","network":"BSC",
                      "address":"0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE"}}'
Reembolso por enlace
curl -X POST https://soncopay.example/v1/refunds \
  -H "X-Api-Key: sp_test_…" -H "Content-Type: application/json" \
  -d '{"payment_id":"pay_3f9a5c0d21e4b7a6c8d1","cancel":true,"mode":"link","reason":"Order cancelled"}'
# send link_url to the payer (status awaiting_payer)
Response201
{
  "id": "rf_7c21d4a9e0b35f86a1c2", "object": "refund", "livemode": false,
  "payment_id": "pay_3f9a5c0d21e4b7a6c8d1", "kind": "refund", "mode": "direct",
  "status": "scheduled", "currency": "USDT", "amount": "40",
  "conversion": "network", "fee_percent": "10", "fee": "4", "partner_share": "0.8",
  "net_amount": "36",
  "destination": { "kind": "crypto", "asset": "USDT", "network": "BSC",
                   "address": "0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE", "memo": null,
                   "method": null, "label": "USDT · BNB Smart Chain (BEP20)" },
  "payer_currency": "USDT", "rate": null, "network_fee": "0.3", "payer_amount": "35.7",
  "link_url": null, "link_expires_at": null,
  "send_after": "2026-10-07T15:00:00+00:00", "payout_id": null,
  "reason": null, "reference": "refund-1042", "metadata": {}, "error": null,
  "history": [{ "status": "scheduled", "at": "2026-10-07T14:30:00+00:00" }],
  "created_at": "2026-10-07T14:30:00+00:00", "updated_at": "2026-10-07T14:30:00+00:00",
  "completed_at": null
}

Endpoints de reembolsos

EndpointDescription
POST/v1/refundsCrear un reembolso
GET/v1/refundsListar reembolsos
GET/v1/refunds/{id}Consultar un reembolso
POST/v1/refunds/{id}/cancelCancelar un reembolso
POST/v1/refunds/previewVista previa de un reembolso
GET/v1/payments/{id}/refund-optionsOpciones de reembolso de un pago

GET /v1/refunds accepts payment_id, status, limit (50 by default) and offset, and answers items and has_more.

POST /v1/refunds/preview takes payment_id, amount, cancel and a destination without address (kind, asset and network, or kind mobile_money and method). It creates nothing and answers the amounts: refundable_amount, conversion, fee_percent, fee, partner_share, net_amount, payer_currency, rate, network_fee, payer_amount, minimum and estimated.

GET /v1/payments/{id}/refund-options says whether the payment can be refunded (enabled, otherwise disabled_reason: refunds_disabled, payment_not_refundable, refund_window_closed or nothing_left), with refundable_amount, refunded_amount, pending_amount, window_ends_at, link_expiry_hours, delay_minutes, partner_share_points, fee_grid and the options offered.

POST /v1/refunds/{id}/cancel (with an optional reason) works only before the refund leaves (awaiting_payer, scheduled, pending_review, awaiting_approval); otherwise 409 refund_not_cancellable. The amount comes back to your balance.

Vista previa de un reembolso
curl -X POST https://soncopay.example/v1/refunds/preview \
  -H "X-Api-Key: sp_test_…" -H "Content-Type: application/json" \
  -d '{"payment_id":"pay_3f9a5c0d21e4b7a6c8d1","amount":"100",
       "destination":{"kind":"crypto","asset":"USDT","network":"BSC"}}'
Response200
{
  "object": "refund_preview", "payment_id": "pay_3f9a5c0d21e4b7a6c8d1",
  "currency": "USDT", "amount": "100", "refundable_amount": "100",
  "conversion": "network", "fee_percent": "10", "fee": "10", "partner_share": "2",
  "net_amount": "90", "payer_currency": "USDT", "rate": null,
  "network_fee": "0.3", "payer_amount": "89.7", "minimum": "1", "estimated": false
}
Cancelar un reembolso
curl -X POST https://soncopay.example/v1/refunds/rf_7c21d4a9e0b35f86a1c2/cancel \
  -H "X-Api-Key: sp_test_…" -H "Content-Type: application/json" \
  -d '{"reason":"Customer kept the order"}'

El objeto reembolso

FieldDescription
idIdentifier of the refund, starting with rf_.
payment_idThe refunded payment.
kindrefund, or cancel for a cancellation.
modedirect or link.
statusSee the refund statuses below.
currency, amountAmount debited from your balance, in the asset of the payment.
conversion, fee_percent, feeThe change of method and the fee deducted from the refund.
partner_shareYour share of the fee, credited to your balance.
net_amountamount minus fee.
destinationWhere the refund goes, with a label; null while the link has not been used.
payer_currency, rate, network_fee, payer_amountWhat the payer receives, in payer_currency, after conversion and network fee.
link_url, link_expires_atLink mode: the link for the payer, while the status is awaiting_payer.
send_afterWhen the refund leaves, at the earliest.
payout_idThe payout that carries the refund, once it is sent.
reason, reference, metadataYour data, as you sent it.
errorWhy the refund failed, otherwise null.
historyEach change of status, with its date.
created_at, updated_at, completed_atDates of creation, of the last change and of completion.

Estados del reembolso

StatusMeaning
awaiting_payerThe link was sent; the payer chooses a method.
scheduledLeaves after the delay set by Sonco Pay. You can still cancel it.
pending_reviewAbove a threshold, the Sonco Pay team reviews the refund before it is sent.
awaiting_approvalWaits for the signatures of your team (multi-approval).
sentSent to the payer.
completedReceived by the payer.
failedThe refund failed; the amount is back in your balance.
cancelledCancelled before it left; the amount is back in your balance.
expiredThe link was not used in time; the amount is back in your balance.

The payment: after a completed refund, its status becomes partially_refunded or refunded, and refunded_amount gives the total refunded.

Eventos de reembolso

Signed like every other event, with the same headers. The data of the refund.* events is the refund object.

EventWhen
refund.createdA refund was created.
refund.scheduled, refund.pending_review, refund.awaiting_approvalThe refund waits before it leaves: delay, review by our team or signatures of your team.
refund.sentThe refund was sent to the payer.
refund.completedThe payer received the refund.
refund.failed, refund.cancelled, refund.expiredThe refund failed, was cancelled, or its link expired; the amount is back in your balance.
payment.refundedA refund of the payment is completed: data is the payment, with refunded_amount and refund (the completed refund).

Errores de reembolso

CodeMeaning
403 refunds_disabledRefunds are not turned on for your account.
409 payment_not_refundableThe payment is not paid, or it cannot be refunded.
409 refund_window_closedThe refund period of this payment is over.
422 refund_amount_too_highMore than what is left to refund (the response gives refundable_amount).
422 refund_amount_invalidThe amount is not valid.
422 refund_insufficient_balanceYour balance does not cover the refund.
409 payment_already_withdrawnThe money of this payment was already withdrawn, in whole or in part: it can no longer be refunded.
429 refund_velocity_exceededToo many refunds in a short time.
422 destination_requiredDirect mode without a destination.
422 destination_invalidThe address or the number is not valid.
422 refund_method_unavailableThis method cannot be used for a refund at the moment.
422 refund_below_minimumWhat the payer would receive is below the minimum.
422 refund_above_maximumAbove the maximum of the operator for a refund to the original number (the response gives maximum): refund in several parts.
503 / 403 refunds_pausedRefunds are paused for the moment, for every account (503) or for yours (403). Refunds already created wait and leave when they open again.
409 refund_not_cancellableThe refund has already left, or it is over.
404 refund_not_foundNo refund with this identifier in this mode.
payment.refunded
{
  "event": "payment.refunded",
  "created_at": "2026-10-07T15:12:40+00:00",
  "data": {
    "id": "pay_3f9a5c0d21e4b7a6c8d1", "status": "partially_refunded",
    "currency": "USDT", "net_amount": "100", "refunded_amount": "40",
    "refund": { "id": "rf_7c21d4a9e0b35f86a1c2", "object": "refund", "status": "completed",
                "amount": "40", "payer_amount": "35.7", … },
    …
  }
}
Response403
{
  "detail": "…",
  "code": "refunds_disabled"
}

Modos de liquidación

Your account is in one of two settlement modes. You choose it in the dashboard (Settings, password required), unless Sonco Pay has locked the mode of your account:

  • Custody (default): each paid payment is credited to your balance, minus the fee. You withdraw when you want.
  • Automatic: each paid payment is credited, then its net amount is sent automatically to your settlement destination for that currency, as a normal payout (payout fee, review above a threshold, same statuses and webhooks). One payment gives at most one automatic payout; small amounts add up until they reach the minimum payout.

Choose a settlement destination for each currency (USDT, XOF…) or for a currency on one network (USDT:TRON, which wins over USDT) among your confirmed payout destinations, in the dashboard or with PUT /v1/settlement/routes. Without a usable destination, or when a limit or a block applies, the amount stays in your balance and the settlement waits; the reason is given in GET /v1/settlement and in the payment timeline.

GET /v1/payments/{id} carries settlement: mode, status (pending, held, settled, failed, cancelled), reason and payout_id. The payment.paid webhook carries settlement.mode; when the payout is created you receive payment.settled, then the usual payout.* webhooks. Payouts carry origin: request or settlement.

When settlement goes on hold, the payment.settlement_held webhook gives the reason and what to do, once per hold. See Webhooks.

GET /v1/settlement also tells whether you can change the mode yourself: locked, can_change and blocked_by (locked or platform). Turning on automatic settlement needs a usable settlement destination; the change applies to payments paid after it, and the account owners receive a security email.

Request
curl -X PUT https://soncopay.example/v1/settlement/routes \
  -H "X-Api-Key: sp_test_…" \
  -H "Content-Type: application/json" \
  -d '{"scope":"USDT","destination_id":"pd_3c1e…"}'
payment.settled
{
  "event": "payment.settled",
  "data": {
    "id": "pay_3f9a…", "status": "paid", "net_amount": "24.8886",
    "settlement": {
      "mode": "auto", "status": "settled",
      "payout_id": "po_7b2d…", "payout_amount": "23.8886",
      "payout_fee": "1", "asset": "USDT"
    }, …
  }
}

Timelines

GET/v1/payments/{id}/timeline

GET/v1/payouts/{id}/timeline

The steps of a payment or a payout, in order, with their time and the status after each step. A timeline shows no internal detail: give its trace_id to our support when you ask about an operation.

step is a stable code: translate it in your interface. label is an English text, status the status after the step and data the useful public references (amounts, method, transaction hash).

Etapas de un pago

StepMeaning
createdCreated
method_selectedMétodo de pago elegido
awaiting_customerEsperando al cliente
attempt_failedIntento rechazado
confirmingTransferencia detectada, confirmando
deposit_attributedTransferencia conciliada por nuestro equipo
paidPagado y acreditado
expiredExpired
failedFailed
webhook_sentNotificación entregada
webhook_failedNotificación no entregada

Etapas de un retiro

StepMeaning
requestedRetiro solicitado
under_reviewEn revisión
approvedApproved
rejectedRejected
submittedEnviado para procesar
sentAceptado para el envío
unknownEn verificación por nuestro equipo
completedCompleted
failedFailed
webhook_sentNotificación entregada
webhook_failedNotificación no entregada
Request
curl https://soncopay.example/v1/payouts/po_8b2d…/timeline -H "X-Api-Key: sp_test_…"
# or /v1/payments/{id}/timeline
Response
{
  "object": "timeline",
  "subject": { "type": "payout", "id": "po_8b2d…", "status": "completed" },
  "livemode": true, "trace_id": "4f0c…",
  "events": [
    { "step": "requested", "label": "Payout requested", "status": "queued",
      "occurred_at": "2026-10-02T09:00:00+00:00", "data": { "amount": "50", "fee": "1", "asset": "USDT" } },
    { "step": "submitted", "label": "Sent for processing", "status": "submitting", … },
    { "step": "completed", "label": "Completed", "status": "completed", "data": { "tx_hash": "…" } }
  ]
}

Statements

GET/v1/statements

GET/v1/statements.csv

Your account statement per currency, read from our double entry books: the opening balance, every line with the balance after it, and the closing balance. The opening balance plus the lines always equals the closing balance.

ParameterDescription
currencyOne currency, for example USDT. By default, every currency of your account.
fromStart of the period: YYYY-MM-DD or ISO 8601.
toEnd of the period, included: YYYY-MM-DD or ISO 8601.
limitFrom 1 to 1000. Default: 200.
cursorThe next_cursor of the previous page, while it is not null.

Líneas del extracto

FieldDescription
idID of the accounting line.
datePosting time, ISO 8601.
typepayment, fee, payout, payout_fee, payout_release or adjustment.
labelStable English label, for example Payment received: translate it in your interface.
descriptionReason of an adjustment, when there is one.
amountSigned amount: positive when it credits your balance, negative when it debits it.
balance_afterBalance of the currency after this line.
operationThe related payment or payout (type and id), or null.

GET /v1/statements.csv takes the same currency, from and to and returns the whole period as CSV, with the columns date, currency, type, label, description, amount, balance_after, operation_type, operation_id and line_id.

Request
curl "https://soncopay.example/v1/statements?currency=USDT&from=2026-10-01&to=2026-10-31" \
  -H "X-Api-Key: sp_test_…"

curl "https://soncopay.example/v1/statements.csv?currency=USDT&from=2026-10-01" \
  -H "X-Api-Key: sp_test_…" -o statement.csv
Response
{
  "livemode": true, "currency": "USDT",
  "from": "2026-10-01T00:00:00+00:00", "to": "2026-11-01T00:00:00+00:00",
  "currencies": ["USDT"],
  "opening": { "USDT": "100" },
  "lines": [
    { "id": 5120, "date": "2026-10-02T09:12:40+00:00", "currency": "USDT",
      "type": "payment", "label": "Payment received", "description": null,
      "amount": "25.0137", "balance_after": "125.0137",
      "operation": { "type": "payment", "id": "pay_3f9a…" } },
    …
  ],
  "closing": { "USDT": "124.8886" },
  "next_cursor": null
}

Facturas y suscripciones

POST/v1/invoices

POST /v1/invoices creates a draft (issue: true gives it a number, send: true also sends it). Lines carry description, quantity, unit_amount and an optional tax_rate (percent). The customer pays on hosted_url (/i/… short link in SMS) with every active method; each payment follows the usual flow (credit, commission, settlement).

Statuses: draft, open, partially_paid (with allow_partial), overdue, paid, void. Actions: /issue, /send, /remind (429 reminder_too_soon), /void, /mark-paid (paid outside Sonco Pay), /timeline and /pdf.

Crear una suscripción

POST/v1/subscriptions

A subscription creates one invoice per due date (interval: week, month, quarter, year or custom with interval_days), a few days in advance, then reminds the customer before the due date (reminders.days_before, for example 7, 3 and 1), on the day and after it (after_due). An unpaid invoice makes the subscription unpaid; after dunning.grace_days it is canceled, paused or kept, as you choose.

Automatic card debit is not available yet: auto_debit: true fails with auto_debit_unavailable. Card, crypto, mobile money and Binance Pay are paid from the invoice link. Reminders go by email, and by SMS or WhatsApp only to customers who agreed (consent); a STOP reply opts them out.

Creations accept the Idempotency-Key header (24 hours; the same key with another body returns 409 idempotency_key_reused) or an external_ref. Lists return items, has_more and next_offset. In test mode, POST /v1/billing/test-clock moves time forward to try due dates and reminders.

Crear una factura
curl -X POST https://soncopay.example/v1/invoices \
  -H "X-Api-Key: sp_test_…" \
  -H "Idempotency-Key: demo-invoice-1042" \
  -H "Content-Type: application/json" \
  -d '{"customer":{"name":"Demo Customer","email":"[email protected]","phone":"+2250700000000",
        "consent":{"email":true,"sms":true}},"currency":"XOF","due_days":7,
       "lines":[{"description":"Demo service","quantity":1,"unit_amount":"15000"}],"send":true}'
Crear una suscripción
curl -X POST https://soncopay.example/v1/subscriptions \
  -H "X-Api-Key: sp_test_…" \
  -H "Content-Type: application/json" \
  -d '{"customer_id":"cus_…","description":"Demo monthly plan","amount":"10000","currency":"XOF",
       "interval":"month","preferred_method":"mobile_money","reminders":{"days_before":[7,3,1]},
       "dunning":{"grace_days":7,"action":"pause"}}'

Webhooks

Set your webhook URL in the dashboard. We send a POST with a JSON body for each event, and retry for about three days until your server answers with a 2xx status.

One webhook per API key: each API key can have its own webhook URL and its own signing secret (dashboard, API keys, open the key). Events of an object created with a key (payment, invoice, subscription, payout, refund, payout destination) go to the URL of that key; without a URL on the key, they go to the URL of your account.

Order used for each event: the callback_url of the payment, then the webhook of the key that created the object, then the webhook of your account. Account events (verification, settlement, destinations added in the dashboard…) go to the webhook of your account. A test key only receives test events. The option Also receive every other event of the business sends a key a copy of the other events of its mode; an address never receives the same event twice. When a key is revoked, its next events go to the webhook of your account.

EventWhen
payment.confirmingA deposit was detected and is being confirmed.
payment.paidThe payment is confirmed. Fulfil the order.
payment.settledAutomatic settlement: the payout of this payment was created (settlement.payout_id).
payment.settlement_heldAutomatic settlement of this payment is on hold: settlement.reason, settlement.detail, settlement.action (what to do) and settlement.destination when an address is concerned.
payment.underpaidCrypto on an address reserved for the payment: less than the amount due arrived. status is underpaid; the customer is asked to send amount_remaining (also in next_action.amount) to the same address before expires_at. Do not fulfil the order yet.
payment.wrong_assetCrypto on an address reserved for the payment: another asset, or the same asset on another network, arrived. The payment carries wrong_asset; expected and received (asset, network, amount, tx_hash) are added. Our team handles it: do not fulfil the order yet. If the payment is accepted, payment.paid follows as usual.
payment.attempt_failedA mobile money request or a card payment was declined: the payment is back to new with last_error; the customer can try again or choose another method.
payment.failedBinance Pay paid with a wrong amount: the payment is failed.
payment.expiredThe payment was not made in time. After a partial crypto payment, status is partially_paid: the amount received is kept and our team can validate the payment or return the funds.
payout.sentThe money has left our wallet (automatic settlement included): the transaction is broadcast and tx_hash is filled in for crypto. payout.completed follows once it is confirmed.
payout.completedThe payout is done: tx_hash (crypto) or bank_reference (bank transfer) is filled in.
payout.failedThe payout failed or was rejected; the amount is back in your balance.
payout.awaiting_approvalA payout is waiting for the signatures of your team (approval gives the request).
payout.approvedThe signers approved the payout: it is now sent as usual.
payout.rejectedA signer refused the payout, or it was cancelled; the amount is back in your balance (approval.reason).
pendingapprovalA single event for every request to approve (payouts, destinations, policies) at each change of state: type, state (pending, approved, rejected, expired, cancelled), triggered (policies), required, approvals.
payout.expiredThe payout was not signed in time; the amount is back in your balance.
refund.*A refund changed status: created, scheduled, pending_review, awaiting_approval, sent, completed, failed, cancelled or expired (data is the refund). See Refund events.
payment.refundedA refund of the payment is completed: data is the payment, with refunded_amount and refund (the completed refund).
invoice.created, invoice.sent, invoice.reminder_sent, invoice.partially_paid, invoice.paid, invoice.overdue, invoice.voidedAn invoice was created, sent, reminded, partly paid, paid, became overdue or was voided.
subscription.created, subscription.updated, subscription.paused, subscription.resumed, subscription.unpaid, subscription.canceled, subscription.endedA subscription was created, updated, paused, resumed, became unpaid, was canceled or ended.
payout_destination.createdA payout destination was added (dashboard, API key or app). data is the destination, details masked, with the status pending_confirmation.
payout_destination.confirmedA payout destination was confirmed in the dashboard. data is the destination, details masked; usable_at is the end of its waiting period.
payout_destination.usableA confirmed payout destination can now be used: right after the confirmation when there is no waiting period, otherwise when the waiting period ends.
payout_destination.removedA payout destination was removed or disabled. removed_by is partner (your team or an API key) or sonco_pay (our team), with removed_at and reason.
pingSent when you test your webhook from the dashboard.

Payout events (payout.sent, payout.completed, payout.failed) carry the payout, with from_address when it is known. In payment.settled, settlement.payout_from_address is usually null because the payout has just been created: payout.sent brings the address. Each payout_destination.* event is sent once per destination; a retry keeps the same X-SoncoPay-Delivery-Id.

payment.settlement_held is sent once each time a payment goes on hold: the same hold checked again sends nothing, a new reason sends a new event. Reasons: no_destination, destination_not_ready, below_minimum, daily_cap, network_blocked, payouts_blocked, kyb_required, merchant_suspended, payout_refused, multisig_unreachable, payout_method_disabled, disabled. When the payout is finally created you receive payment.settled.

Headers

HeaderDescription
X-SoncoPay-SignatureThe signature. Timestamped format t=…,v1=… for new accounts and for accounts that switched in the dashboard; otherwise the legacy format, HMAC SHA512 of the raw body in hexadecimal. See Verify a signature.
X-SoncoPay-Signature-V2Timestamped signature, sent while your account uses the legacy format.
X-SoncoPay-TimestampUnix time of this attempt, in seconds.
X-SoncoPay-Delivery-IdIdentifier of the delivery, the same on every retry: ignore a delivery you already processed.
X-SoncoPay-EventThe event name, also present in the body.
Content-Typeapplication/json
payment.paid
{
  "event": "payment.paid",
  "created_at": "2026-10-01T14:31:07+00:00",
  "data": {
    "id": "pay_3f9a…", "order_id": "1042", "status": "paid",
    "received_amount": "25.0137", "asset": "USDT",
    "fee": "0.1251", "net_amount": "24.8886",
    "fee_paid_by": "merchant", "amount_due": "25.0137",
    "payer": { "email": "[email protected]" },
    "settlement": { "mode": "custody", "status": null, "payout_id": null },
    "late": false, …
  }
}
payout.sent
{
  "event": "payout.sent",
  "created_at": "2026-10-11T09:12:44+00:00",
  "data": {
    "id": "po_8b2d…", "object": "payout", "status": "sent",
    "asset": "USDT", "network": "TRON", "amount": "250", "fee": "1",
    "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
    "tx_hash": "4f1c…", "from_address": "TXa1…", …
  }
}
payout_destination.usable
{
  "event": "payout_destination.usable",
  "created_at": "2026-10-12T09:00:31+00:00",
  "data": {
    "id": "pd_5c1e…", "object": "payout_destination", "livemode": true,
    "kind": "crypto", "label": "Main wallet", "currency": "USDT",
    "status": "active", "usable": true,
    "details": { "asset": "USDT", "network": "TRON", "network_name": "Tron (TRC20)",
                 "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE", "memo": null },
    "confirmed_at": "2026-10-11T09:00:31+00:00",
    "usable_at": "2026-10-12T09:00:31+00:00", "created_at": "2026-10-11T08:58:02+00:00"
  }
}
payout_destination.created
{
  "event": "payout_destination.created",
  "created_at": "2026-10-11T08:58:02+00:00",
  "data": {
    "id": "pd_5c1e…", "object": "payout_destination", "livemode": true,
    "kind": "mobile_money", "label": "Shop phone", "currency": "XOF",
    "status": "pending_confirmation", "usable": false,
    "details": { "method_code": "mtn_bj", "method_name": "MTN MoMo Benin",
                 "operator": "MTN", "country": "BJ", "phone_masked": "+229 •••• 0002" },
    "confirmed_at": null, "usable_at": null,
    "created_at": "2026-10-11T08:58:02+00:00"
  }
}
payout_destination.removed
{
  "event": "payout_destination.removed",
  "created_at": "2026-10-14T16:20:09+00:00",
  "data": {
    "id": "pd_5c1e…", "object": "payout_destination", "livemode": true,
    "kind": "crypto", "label": "Main wallet", "currency": "USDT",
    "status": "disabled", "usable": false,
    "details": { "asset": "USDT", "network": "TRON", "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE", … },
    "removed_by": "partner", "removed_at": "2026-10-14T16:20:09+00:00",
    "reason": null, …
  }
}
payment.settlement_held
{
  "event": "payment.settlement_held",
  "created_at": "2026-10-12T10:04:51+00:00",
  "data": {
    "id": "pay_3f9a…", "object": "payment", "status": "paid",
    "net_amount": "24.8886", "asset": "USDT", …,
    "settlement": {
      "mode": "auto", "status": "held",
      "reason": "destination_not_ready",
      "detail": "Your settlement address can be used from 2026-10-13 09:00 UTC (security waiting period).",
      "action": { "code": "confirm_destination",
                  "message": "Confirm the settlement address, or wait for the end of its security waiting period: settlement then resumes on its own." },
      "item_id": "st_91aa…", "amount": "24.8886", "asset": "USDT", "network": "TRON",
      "hold": { "state": "waiting_period", "usable_from": "2026-10-13T09:00:00+00:00", "accumulated": "24.8886" },
      "next_attempt_at": "2026-10-13T09:00:05+00:00",
      "destination": { "id": "pd_5c1e…", "object": "payout_destination", "status": "active", … }
    }
  }
}

Verificar una firma

Each webhook carries a timestamped signature t=<timestamp>,v1=<signature>: v1 is the HMAC SHA256, in hexadecimal, of the timestamp, a dot and the raw request body, keyed with your webhook signing secret. Compute it on the raw body, before parsing the JSON, compare in constant time, and refuse a timestamp more than 5 minutes away from your clock.

A webhook sent to the URL of an API key is signed with the signing secret of that key, not the secret of your account, and carries X-SoncoPay-Key: the public prefix of the key. A callback_url is signed with the secret of the key that created the payment when that key has its own webhook. With the SDKs, pass the matching secret to constructEvent (construct_event in Python).

Migration: accounts created before October 6, 2026 keep the legacy format in X-SoncoPay-Signature (HMAC SHA512 of the raw body) and receive the timestamped signature in X-SoncoPay-Signature-V2. Install SDK 2.5.0, which checks both, then choose Timestamped in the dashboard under Developers, Webhooks. After the switch, only the timestamped signature is sent: the legacy one has no timestamp and would let a captured webhook be replayed.

Antes de enviarAlways confirm the status by calling GET /v1/payments/{id} before shipping goods of high value.
const crypto = require("crypto");
// X-SoncoPay-Signature: t=1700000000,v1=…  (accounts on the legacy format: X-SoncoPay-Signature-V2)
const header = req.headers["x-soncopay-signature-v2"] || req.headers["x-soncopay-signature"] || "";
const sig = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const expected = crypto.createHmac("sha256", process.env.SP_WEBHOOK_SECRET).update(sig.t + ".").update(rawBody).digest("hex");
const ok = Math.abs(Date.now() / 1000 - Number(sig.t)) <= 300 && String(sig.v1).length === expected.length
  && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(String(sig.v1)));

Errors

Errors use standard HTTP codes and a JSON body {"detail": "…"}. Some errors also carry a stable code that you can test in your code: {"detail": "…", "code": "kyb_required"}.

CodeMeaning
401Missing or invalid API key.
403Account suspended, payments or payouts blocked for your account, missing permission (permission_denied), or live mode before your business verification is approved (kyb_required).
404Payment or payout not found in this mode.
409Conflict: payment expired, already paid, or order_id reused with another amount.
429Too many mobile money attempts for this payment.
422Invalid input, unsupported currency, amount below the minimum, insufficient balance.
422 provider_refusedThe provider refused to start the payment (card, mobile money or Binance Pay). The detail gives its reason. Nothing was charged: choose another method or retry later.
502A payment provider or the exchange rate is temporarily unavailable. Retry later.
503Payments or payouts are temporarily closed, or the service is under maintenance: the body then carries "maintenance": true and a Retry-After header. Retry later.

API keys: api_key_scope (the key does not have the scope of this route) and api_key_ip_not_allowed (address outside the allowlist of the key), both 403. Payouts: destination_required (422) and payout_velocity_exceeded (429). Payments: return_url_invalid (422, https only in live mode).

Payment methods: method_not_allowed (422, the method is not enabled for your account; contact support to enable it) and pair_disabled (422, this asset and network are not offered at the moment).

Payout methods: payout_method_not_allowed (422, payouts to this network or method are not enabled for your account; contact support to enable it) and payout_method_unavailable (422, the method is open to your account but payouts to it are not available yet; nothing is reserved). The body gives the key in method (USDT:TRON, mtn_bj, bank) and, when our team has written one, a message in notice.

Refund errors are listed in Refunds.

Error messages (detail, last_error, the error of a payout) never name our internal processors. Payout destination errors are listed in Payout destinations.

Response403
{
  "detail": "…",
  "code": "kyb_required"
}