Expire a checkout session
Manually expires a checkout session. Only works on sessions with status 'open'.
POST
/checkout-sessions/{sessionId}/expire
Manually expires a checkout session. Only works on sessions with status 'open'.
Path Parameters
sessionId
string (uuid)
required
path
Checkout session UUID
Example:
"550e8400-e29b-41d4-a716-446655440000"Responses
200
Checkout session expired successfully
application/jsonsuccess
boolean
REQUIRED
message
string
REQUIRED
data
object
REQUIRED
id
string (uuid)
REQUIRED
status
string
REQUIRED
Enum:
expiredstatusCode
number
REQUIRED
400
Cannot expire session (not found or not open)
curl -X POST 'https://mainnet.anyspend.com/checkout-sessions/550e8400-e29b-41d4-a716-446655440000/expire'
const response = await fetch('https://mainnet.anyspend.com/checkout-sessions/550e8400-e29b-41d4-a716-446655440000/expire', { method: 'POST'});const data = await response.json();console.log(data);
import requestsresponse = requests.post('https://mainnet.anyspend.com/checkout-sessions/550e8400-e29b-41d4-a716-446655440000/expire')print(response.json())
200
Response
{ "success": true, "message": "Checkout session expired", "data": { "id": "<uuid>", "status": "expired" }, "statusCode": 200}
API Playground
Try this endpoint
POST
/checkout-sessions/{sessionId}/expire

