Expire a checkout session
Marks a checkout session as expired so it can no longer accept payment.
Use this when you mint a fresh checkout session for a logical purchase that already had one outstanding (for example, a customer requested a new payment link after the original expired). Without explicitly expiring the old session, its URL remains payable until the session’s natural 30-minute TTL elapses, which can let a customer who reloads the old tab pay twice.
Idempotent. Calling expire on a session that is already in a terminal state (success, failed, cancelled, expired) returns 200 with the current status - no error. Only pending and initiated sessions are flipped.
Authorizations
Your PayBridgeNP API key. Obtain one from the dashboard under Settings → API Keys. Prefix: sk_test_ for testing, sk_live_ for production.
Path Parameters
The checkout session id (e.g. cs_01j9x2k3m4n5p6q7r8s9t0u1v2).
Response
Session expired (or was already terminal).
"cs_01j9x2k3m4n5p6q7r8s9t0u1v2"
The session's current status after the expire call.
pending, initiated, success, failed, cancelled, expired hosted, redirect esewa, khalti, fonepay