POST
/api/v1/checkout/sessionsClé APICréer une session checkout
Crée une session checkout. Retourne sessionId et url (hébergé) ; le sessionId sert aussi à l'intégration API custom.
Corps de requête
| Nom | Type | Requis | Description |
|---|---|---|---|
| amount | string | Oui | Montant en unités mineures |
| currency | string | Oui | Code devise ISO 4217 |
| title | string | Oui | Titre affiché au payeur |
| description | string | — | Description optionnelle (détail complémentaire) |
| merchantId | string | — | Optionnel avec clé API (doit correspondre au marchand de la clé) |
| successUrl | string | — | Redirection après succès |
| cancelUrl | string | — | Redirection après annulation |
| allowedMethods | string[] | — | Restreindre les méthodes (WALLET, MOBILE_MONEY, CARD, etc.) |
| expiresInSeconds | number | — | TTL session (défaut 1800, max 86400) |
| metadata | object | — | Métadonnées libres |
Exemple requête
json
{
"amount": "2500",
"currency": "USD",
"title": "Commande #1234",
"description": "Achat boutique en ligne",
"successUrl": "https://merchant.example/success",
"cancelUrl": "https://merchant.example/cancel",
"allowedMethods": [
"MOBILE_MONEY",
"CARD"
]
}Réponse (data)
| Nom | Type | Requis | Description |
|---|---|---|---|
| object | string | Oui | Toujours checkout.session |
| id | string | Oui | sessionId (cs_...) |
| url | string | — | URL checkout hébergée (réponse create uniquement) |
| title | string | Oui | Titre affiché au payeur |
| description | string | null | — | Description optionnelle |
| status | string | Oui | OPEN, PROCESSING, SUCCEEDED, etc. |
| amount | string | Oui | Montant en unités mineures |
| currency | string | Oui | Devise ISO 4217 |
| expiresAt | string | null | — | Expiration ISO 8601 |
| createdAt | string | Oui | Date de création ISO 8601 |
Exemple réponse
json
{
"success": true,
"data": {
"object": "checkout.session",
"id": "cs_38b62a204d2da0bcdd312c59",
"tenantId": "tenant-1",
"merchantId": "mch-1",
"status": "OPEN",
"amount": "2500",
"currency": "USD",
"title": "Commande #1234",
"description": "Achat boutique en ligne",
"customerEmail": "customer@example.com",
"successUrl": "https://merchant.example/success",
"cancelUrl": "https://merchant.example/cancel",
"expiresAt": "2026-08-28T12:00:00.000Z",
"completedAt": null,
"createdAt": "2026-08-28T09:00:00.000Z",
"updatedAt": "2026-08-28T09:00:00.000Z",
"url": "https://checkout.example/session/cs_38b62a204d2da0bcdd312c59"
},
"error": null
}Exemples
bash
curl -X POST https://api.dev.izzi-finance.com/api/v1/api/v1/checkout/sessions \
-H "Authorization: Bearer izzi_mk_sandbox_…" \
-H "Content-Type: application/json" \
-d '{
"amount": "2500",
"currency": "USD",
"title": "Commande #1234",
"description": "Achat boutique en ligne",
"successUrl": "https://merchant.example/success",
"cancelUrl": "https://merchant.example/cancel",
"allowedMethods": [
"MOBILE_MONEY",
"CARD"
]
}'