Developer Portal Payin API

Payin API

Collectez des paiements depuis les wallets Mobile Money de vos clients via un seul endpoint.

Endpoint

POST /api/v1/merchant/payin Scope requis : payin

Paramètres

ChampTypeRequisDescription
amount integer Requis Montant en XOF (min : 100, max : 10 000 000)
currency string Requis Code ISO 4217 — actuellement XOF
method string Requis Opérateur : orange · mtn · moov · wave · djamo
country string Requis Code ISO alpha-2 : CI · SN · BF · TG · ML
phone string Requis Numéro du payeur au format E.164 : +2250701234567
reference string Requis Référence unique côté marchand (max 100 chars)
description string Optionnel Description affichée au client (max 255 chars)
customer_name string Optionnel Nom du client
customer_email string Optionnel Email du client
metadata object Optionnel Données libres retournées dans les webhooks

Header Idempotency-Key obligatoire

Chaque requête payin doit inclure un header Idempotency-Key unique. Utilisez votre reference comme valeur. Voir Idempotency.

Réponse

ChampTypeDescription
successbooleanToujours true si HTTP 200
statusstringinitiated · pending · success · failed
transaction_idstringID interne EnvoiFacile (à conserver)
providerstringProvider utilisé : jeko · julaya · intouch
provider_refstringRéférence côté provider (pour réconciliation)
requires_actionbooleantrue si une redirection est nécessaire
action_urlstring|nullURL de redirection Mobile Money (Wave, Orange…)
messagestringMessage lisible

Exemples

Orange Money CI

bash curl
curl -X POST https://envoifacile.com/api/v1/merchant/payin \
  -H "X-API-KEY: ef_live_xxxxxxxxxxxxxxxxxx" \
  -H "Idempotency-Key: order_2024_001" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 5000,
    "currency": "XOF",
    "method": "orange",
    "country": "CI",
    "phone": "+2250701234567",
    "reference": "order_2024_001",
    "description": "Paiement commande #001"
  }'

Wave CI

bash curl
curl -X POST https://envoifacile.com/api/v1/merchant/payin \
  -H "X-API-KEY: ef_live_xxxxxxxxxxxxxxxxxx" \
  -H "Idempotency-Key: order_2024_002" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 15000,
    "currency": "XOF",
    "method": "wave",
    "country": "CI",
    "phone": "+2250502345678",
    "reference": "order_2024_002"
  }'
json Réponse Wave (redirect)
{
  "success": true,
  "status": "initiated",
  "transaction_id": "PAY_ABCDEF123456_1719100000",
  "provider": "jeko",
  "provider_ref": "d22c81f3-ee04-4ec5-8bd2-cd8af5dabcfc",
  "requires_action": true,
  "action_url": "https://pay.jeko.africa/payment/d22c81f3-ee04-4ec5-8bd2-cd8af5dabcfc",
  "message": "Redirect to payment page required."
}

Exemple PHP (Laravel)

php Laravel HTTP Client
$response = Http::withHeaders([
    'X-API-KEY'        => env('ENVOIFACILE_API_KEY'),
    'Idempotency-Key'  => 'order_' . $order->id,
    'Content-Type'     => 'application/json',
])->post('https://envoifacile.com/api/v1/merchant/payin', [
    'amount'    => 5000,
    'currency'  => 'XOF',
    'method'    => 'orange',
    'country'   => 'CI',
    'phone'     => $customer->phone,
    'reference' => 'order_' . $order->id,
]);

$data = $response->json();

if ($data['requires_action']) {
    return redirect($data['action_url']);
}

Statuts de transaction

StatutSignificationAction
initiatedTransaction créée, en attente du clientRediriger vers action_url
pendingEn cours de traitement chez l'opérateurAttendre le webhook
successPaiement confirmé et fonds reçusValider la commande
failedPaiement refusé ou timeoutProposer une nouvelle tentative