operation post api v1 payment sessions parameter cancel.md

Cancel a payment session

POST /api/v1/payment/sessions/{session}/cancel

Cancels the payment session with the given ID. A session can only be cancelled while it is still pending.

Servers

Parameters

Path parameters

Responses

200

Session cancelled. The webhook with event_type: payment.session.cancelled will follow asynchronously.

Body: application/json (object)

400

session_not_pending — the session is already in a terminal state. session_expired — the session is past its expires_at and the expiry job hasn't flipped it yet.

403

Missing or invalid API key.

404

Session not found.