Initier un Dépôt
Dépôt Classique (DIRECT & REDIRECT)
Pour les passerelles avec type: DIRECT ou REDIRECT, utilisez cet endpoint en une seule étape.
Endpoint
POST /api/v2/classic/deposit/initiate
Corps de Requête
{
"amount": 10000.0,
"currency": "XOF",
"customerEmail": "customer@example.com",
"customerPhone": "+221701234567",
"country": "SN",
"gatewayName": "wave-senegal",
"callbackUrl": "https://merchant.example/webhooks/deposit",
"customerName": "Awa Diop",
"returnUrl": "https://merchant.example/thank-you",
"metadata": {
"order_id": "ORDER_123",
"description": "Abonnement premium"
}
}
Exemple Sandbox
curl -X POST "https://sandbox.awdpay.com/test/api/v2/classic/deposit/initiate" \
-H "Authorization: Bearer $AWDPAY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 10000.0,
"currency": "XOF",
"customerEmail": "test@example.com",
"customerPhone": "+221701234567",
"country": "SN",
"gatewayName": "wave-senegal",
"callbackUrl": "https://merchant.example/webhooks/deposit",
"customerName": "Test User",
"returnUrl": "https://merchant.example/thank-you",
"metadata": {
"order_id": "ORDER_123"
}
}'
Réponse
{
"reference": "DEP_TEST_1763646304918_1D05265E",
"status": "pending",
"fees": 104.0,
"paymentType": "REDIRECT",
"createdAt": "2025-11-20T14:45:04.921662462",
"expiresAt": "2025-11-21T14:45:04.921748366",
"message": "Dépôt de test créé avec succès. Ceci est un environnement sandbox.",
"url": "https://sandbox.awdpay.com/payment/DEP_TEST_1763646304918_1D05265E"
}
Notes d'Intégration
- Passerelles REDIRECT : redirigez le client vers le champ
url - Passerelles DIRECT : le client reçoit une notification push STK sur son téléphone
Dépôt en Deux Étapes (Passerelles OTP)
Pour les passerelles avec type: OTP (ex. orange-money-ci, awdpay), utilisez ce processus en deux étapes.
Étape 1 : Générer une Facture
Endpoint
POST /api/v2/validation/deposit/generate-invoice
Requête
{
"amount": 50000.0,
"currency": "XOF",
"customerEmail": "client@example.com",
"customerPhone": "+221701234567",
"country": "CI",
"gatewayName": "orange-money-ci",
"callbackUrl": "https://merchant.example/webhooks/deposit",
"customerName": "Koffi Mensah",
"metadata": {
"order_id": "ORDER_67890"
}
}
Exemple Sandbox
curl -X POST "https://sandbox.awdpay.com/test/api/v2/validation/deposit/generate-invoice" \
-H "Authorization: Bearer $AWDPAY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 50000.0,
"currency": "XOF",
"customerEmail": "test@example.com",
"customerPhone": "+225070000000",
"country": "CI",
"gatewayName": "orange-money-ci",
"callbackUrl": "https://merchant.example/webhooks/deposit",
"customerName": "Test User"
}'
Réponse
{
"reference": "DEP_INV_TEST_1732108900000_E5F6G7H8",
"status": "pending",
"fees": 1050.0,
"createdAt": "2025-11-20T15:01:40",
"expiresAt": "2025-11-20T21:01:40",
"message": "Invoice généré en sandbox"
}
Étape 2 : Confirmer avec OTP
Le client reçoit l'OTP sur son téléphone ; soumettez-le pour finaliser le paiement.
Endpoint
POST /api/v2/validation/deposit/confirm
Requête
{
"trxReference": "DEP_INV_TEST_1732108900000_E5F6G7H8",
"otp": "123456"
}
Exemple Sandbox
curl -X POST "https://sandbox.awdpay.com/test/api/v2/validation/deposit/confirm" \
-H "Authorization: Bearer $AWDPAY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"trxReference": "DEP_INV_TEST_1732108900000_E5F6G7H8",
"otp": "123456"
}'
Réponse
{
"reference": "DEP_VALID_TEST_1732109000000_I9J0K1L2",
"status": "completed",
"fees": 120.0,
"createdAt": "2025-11-20T15:03:20",
"message": "Dépôt validé en sandbox"
}
Structure des Frais
- Les frais sont automatiquement calculés et inclus dans la réponse
- Montant final débité du client =
amount + fees