Pay-in
Payment Intents
Un payment intent représente une intention d'encaissement.
Créer un paiement
POST /v1/payment_intents. Les montants sont des entiers en unité mineure.
Requête
curl https://api.validif.com/v1/payment_intents \
-H "Authorization: Bearer vl_sec_xxxxx" \
-H "Idempotency-Key: order_98231" \
-H "Content-Type: application/json" \
-d '{
"amount": 250000,
"currency": "XOF",
"description": "Order 98231",
"capture_method": "automatic"
}'Réponse 201
{
"id": "pi_3f81b2c9",
"reference": "pay_98231_af12",
"amount": 250000,
"currency": "XOF",
"state": "created",
"checkout_url": "https://checkout.validif.com/pay_98231_af12",
"request_id": "req_8f21c0d4"
}| Champ | Type | Description |
|---|---|---|
| amount | integer | Montant en unité mineure, strictement positif. |
| currency | string | Code ISO 4217. Défaut : devise du marchand (XOF). |
| description | string | Libellé libre affiché au checkout. |
| capture_method | automatic | manual | Capture immédiate après autorisation, ou capture différée. |
| Idempotency-Key | header | Obligatoire. Rejouable pendant 24 h. |
Machine à états
Les transitions sont strictes ; toute transition non autorisée renvoie invalid_request.
created ──authorize──▶ authorized ──capture──▶ captured │ │ ├──fail──▶ failed └──cancel──▶ canceled └──cancel──▶ canceled
| Champ | Type | Description |
|---|---|---|
| created | state | Intention créée, en attente du moyen de paiement. |
| authorized | state | Fonds autorisés, capture possible. |
| captured | state | Encaissement confirmé. État terminal. |
| canceled | state | Annulé avant capture. État terminal. |
| failed | state | Refus ou échec technique. État terminal. |
Capturer
POST /v1/payment_intents/{id}/capture
curl -X POST \ https://api.validif.com/v1/payment_intents/pi_3f81b2c9/capture \ -H "Authorization: Bearer vl_sec_xxxxx" \ -H "Idempotency-Key: capture_98231"
Annuler
POST /v1/payment_intents/{id}/cancel
curl -X POST \ https://api.validif.com/v1/payment_intents/pi_3f81b2c9/cancel \ -H "Authorization: Bearer vl_sec_xxxxx" \ -H "Idempotency-Key: cancel_98231"
Récupérer / lister
GET
curl https://api.validif.com/v1/payment_intents/pi_3f81b2c9 \ -H "Authorization: Bearer vl_sec_xxxxx" curl "https://api.validif.com/v1/payment_intents?limit=25" \ -H "Authorization: Bearer vl_sec_xxxxx"
Sécurité des données de carte
Aucun PAN ni CVV ne transite par votre serveur ni par vos journaux : la saisie a lieu sur la page de checkout hébergée par VALIDIF.
