Batch expire on a checkout session
Expires open checkouts and materialized recoveries of one subject and scope.
Expires open checkouts and materialized recoveries of one subject and scope.
- Path
POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/checkout_sessions:batchExpire - Scope
billing:write - Effect
write— a successful call changes state. - Collection checkout_sessions
Request
| Field | Type | What it is |
|---|---|---|
parent | string | The environment whose sessions are eligible to expire. Required. |
scope | CheckoutSessionScope | The exact subject and immutable metadata selector; never customer-wide. Required. |
CheckoutSessionScope
| Field | Type | What it is |
|---|---|---|
subject | Subject | The payer subject recorded by Money, not a mutable processor customer field. Required. |
metadata_key | string | Exact key in the checkout's immutable Money metadata, e.g. workspace_id. Required. |
metadata_value | string | Exact non-empty metadata value. Required. |
Subject
| Field | Type | What it is |
|---|---|---|
end_user | string | An end user's id (Sylphx Auth, or the app's own OIDC issuer). One of the kind group. |
customer_organization | string | A customer organization's id. One of the kind group. |
Response
| Field | Type | What it is |
|---|---|---|
expired_checkout_sessions | string[] | Money resource names independently confirmed expired. Output only. |
expired_recovered_session_ids | string[] | Materialized Stripe recovery sessions independently confirmed expired. Output only. |
recovery_not_revoked_checkout_sessions | string[] | Original Money resources whose Stripe recovery was enabled or could not be proven disabled. Stripe-issued recovery URLs are NOT revoked by this call. Output only. |
completed_checkout_sessions | string[] | Checkouts that completed before expiry; their payments must still settle. Output only. |
Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.INVALID_FIELD— A field failed validation.INVALID_STATE— The Resource is in a state that forbids the call.UNAVAILABLE— The Resource store, the owning service's backend, or the key verifier's snapshot is unavailable; retry after Retry-After.
Every error arrives in the body Errors describes.
Examples
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/checkout_sessions:batchExpire" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scope":{"metadata_key":"…","metadata_value":"…","subject":{}}}'