Expire a checkout session
/api/v1/checkout/sessions/{id}/expireEnds an open session so the customer can no longer pay on it. Expiring a session that is already expired returns it unchanged. A session that was paid cannot be expired.
Authorization
bearerAuth An access token from POST /api/v1/oauth/token, sent as Authorization: Bearer <token>.
In: header
Path Parameters
The session's ID.
uuidHeader Parameters
The API version to use for this request, a date such as 2026-11-06. Without it the request uses your default version for the mode of your key. An unknown version answers 400 api_version_invalid.
Value in
- "2026-11-06"
A unique key you choose for this request: 1 to 255 visible ASCII characters, no spaces. A UUID works well. Never put personal data in it. If a request times out, send it again with the same key and the same body to get the first response back, with the header Idempotent-Replayed: true. A key is kept for 24 hours. Sending the same key with another body answers 400 idempotency_key_reused.
^[\x21-\x7E]+$1 <= length <= 255Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api-malipo.flex.co.tz/api/v1/checkout/sessions/497f6eca-6276-4993-bfeb-53cbbbba6f08/expire" \ -H "Authorization: Bearer <token>" \ -H "FlexMalipo-Version: 2026-11-06" \ -H "Idempotency-Key: 5f1c1e0a-3b7e-4c8e-9d1a-2f6b8a4c7e11"{ "id": "0b6f3a52-6c1e-4f0a-8d2e-5a1c9e7b4d10", "mode": "payment", "status": "open", "livemode": false, "currency": "TZS", "amountTotal": 24000, "customerDetails": { "name": "string", "email": "string", "phone": "string" }, "clientReferenceId": "order-1042", "metadata": { "property1": "string", "property2": "string" }, "successUrl": "string", "cancelUrl": "string", "expiresAt": "2019-08-24T14:15:22Z", "completedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "lineItems": [ { "name": "string", "unitAmount": 12000, "quantity": 0, "adjustableQuantity": { "minimum": 0, "maximum": 0 }, "amount": 24000 } ], "customer": "5b0c6a0e-1f0d-4f6b-8a5e-0d8f6c1f2a33", "subscriptionId": "9c1d7e44-2a3b-4c5d-8e6f-7a8b9c0d1e2f", "invoiceId": "3d2c1b0a-9f8e-4d7c-a6b5-c4d3e2f1a0b9", "maxPeriods": 3, "carriedAmount": 300, "creditApplied": 2000, "lines": [ { "kind": "string", "description": "string", "amount": 0, "usageQuantity": 0, "unitAmountDecimal": "string", "usagePeriodStart": "2019-08-24T14:15:22Z", "usagePeriodEnd": "2019-08-24T14:15:22Z" } ], "amountDue": 13000, "brandId": "3f2b8c1e-6a4d-4e0b-9d71-5c8a2b7e4f10", "url": "https://pay.example.com/s/0b6f3a52-6c1e-4f0a-8d2e-5a1c9e7b4d10#Zm9v"}