Skip to content
Console
On this page

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

FieldTypeWhat it is
parentstringThe environment whose sessions are eligible to expire. Required.
scopeCheckoutSessionScopeThe exact subject and immutable metadata selector; never customer-wide. Required.

CheckoutSessionScope

FieldTypeWhat it is
subjectSubjectThe payer subject recorded by Money, not a mutable processor customer field. Required.
metadata_keystringExact key in the checkout's immutable Money metadata, e.g. workspace_id. Required.
metadata_valuestringExact non-empty metadata value. Required.

Subject

FieldTypeWhat it is
end_userstringAn end user's id (Sylphx Auth, or the app's own OIDC issuer). One of the kind group.
customer_organizationstringA customer organization's id. One of the kind group.

Response

FieldTypeWhat it is
expired_checkout_sessionsstring[]Money resource names independently confirmed expired. Output only.
expired_recovered_session_idsstring[]Materialized Stripe recovery sessions independently confirmed expired. Output only.
recovery_not_revoked_checkout_sessionsstring[]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_sessionsstring[]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":{}}}'