Skip to main content
POST
curl
Local session expiry does not prove that a provider attempt can no longer settle. Before cancelling a Shopify order, stop issuing new sessions and use ?for_order_cancellation=true. Only safe_to_cancel: true confirms closure of related sessions and verified-dead provider attempts. A false or missing value means defer cancellation until provider reconciliation or manual review.

Authorizations

Authorization
string
header
required

Your PayBridgeNP API key. Obtain one from the dashboard under Settings → API Keys. Prefix: sk_test_ for testing, sk_live_ for production.

Path Parameters

id
string
required

The checkout session id (e.g. cs_01j9x2k3m4n5p6q7r8s9t0u1v2).

Query Parameters

for_order_cancellation
boolean
default:false

Require closure of every related Shopify session and verified-dead provider attempts. Returns id and safe_to_cancel only; false means defer.

only_if_untouched
boolean
default:false

Expire only a session that is still pending with no payment method chosen; otherwise leave it unchanged and return its status.

Response

Session expired (or already terminal), or order-closure verdict when requested.

id
string
Example:

"cs_01j9x2k3m4n5p6q7r8s9t0u1v2"

status
enum<string>

The session's current status after the expire call.

Available options:
pending,
initiated,
success,
failed,
cancelled,
expired
flow
enum<string>
Available options:
hosted,
redirect
provider
enum<string> | null
Available options:
esewa,
khalti,
fonepay
expires_at
string<date-time>
safe_to_cancel
boolean

Present only for for_order_cancellation=true. Only true authorizes Shopify order cancellation.

only_if_untouched
boolean

Present (true) only when only_if_untouched=true was honoured.