/api/v1/paymentsCréer un paiementDroit : payments:writeDébite le client par mobile money. NabilaPay choisit la meilleure voie de traitement, sans jamais débiter deux fois, et crédite votre solde du net.
En-tête obligatoire : Idempotency-Key: commande-1001
| Paramètre | Type | Requis | Description |
|---|---|---|---|
amount | entier | oui | Montant en FCFA, 100 à 1 000 000. Pas de décimales. |
currency | texte | non | XOF (seule devise disponible). |
country | texte | oui | BJ, TG, CI ou SN. |
phone | texte | oui | Numéro du client, ex. +22961000000. |
operator | texte | non | Ex. MTN_BJ, MOOV_BJ, WAVE_CI… |
description | texte | non | 120 caractères maximum. |
external_ref | texte | non | Votre référence de commande (64 car.). Filtrable dans la liste. |
metadata | objet | non | 10 paires texte maximum. |
sandbox_scenario | texte | non | SUCCESS (défaut), FAILED, PENDING, TIMEOUT, PRIMARY_DOWN, REJECTED_ALL. |
Exemple
curl -X POST "http://nabila.bconsultingsarl.com//api/v1/payments" \
-H "Authorization: Bearer $NABILA_KEY" \
-H "Idempotency-Key: commande-1001" \
-H "Content-Type: application/json" \
-d '{"amount":15000,"currency":"XOF","country":"BJ","phone":"+22961000000","description":"Commande 1001","external_ref":"CMD-1001","metadata":{"panier":"A-77"}}'<?php
$ch = curl_init('http://nabila.bconsultingsarl.com//api/v1/payments');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('NABILA_KEY'),
'Idempotency-Key: commande-1001',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'amount' => 15000,
'currency' => 'XOF',
'country' => 'BJ',
'phone' => '+22961000000',
'description' => 'Commande 1001',
'external_ref' => 'CMD-1001',
'metadata' => [
'panier' => 'A-77',
],
]),
]);
$reponse = json_decode(curl_exec($ch), true);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
var_dump($code, $reponse);const res = await fetch('http://nabila.bconsultingsarl.com//api/v1/payments', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.NABILA_KEY}`,
'Idempotency-Key': 'commande-1001',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"amount": 15000,
"currency": "XOF",
"country": "BJ",
"phone": "+22961000000",
"description": "Commande 1001",
"external_ref": "CMD-1001",
"metadata": {
"panier": "A-77"
}
}),
});
console.log(res.status, await res.json());import os, requests
r = requests.request(
'POST', 'http://nabila.bconsultingsarl.com//api/v1/payments',
headers={
'Authorization': 'Bearer ' + os.environ['NABILA_KEY'],
'Idempotency-Key': 'commande-1001',
},
json={"amount":15000,"currency":"XOF","country":"BJ","phone":"+22961000000","description":"Commande 1001","external_ref":"CMD-1001","metadata":{"panier":"A-77"}},
timeout=10,
)
print(r.status_code, r.json())Réponse
{
"id": "3f6d2b1e-8c1a-4e57-9d3b-6a1f0c2e7b11",
"object": "payment",
"reference": "PAY-9A41C7D2E05B",
"external_ref": "CMD-1001",
"status": "succeeded",
"amount": 15000,
"currency": "XOF",
"fee": 425,
"net": 14575,
"refunded": 0,
"country": "BJ",
"customer": {
"phone": "+22961000000",
"email": null
},
"description": "Commande 1001",
"provider": "nabilapay",
"failure_reason": null,
"metadata": {
"panier": "A-77"
},
"livemode": false,
"created_at": "2026-10-10T09:41:12Z"
}