Skip to content
Console
Menu

Getting Started

Authentication

KV Store

Expire a checkout session

Expires an open hosted checkout so it can no longer be paid.

Expires an open hosted checkout so it can no longer be paid.

  • Path POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/checkout_sessions/checkout-session:expire
  • Scope billing:write
  • Effect write — a successful call changes state.
  • Collection checkout_sessions

#Request

FieldTypeWhat it is
namestringThe Money checkout resource to expire. Required.

#Response

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/checkout_sessions/{checkout_session}.
uidstringchk_<cell><ulid>; never reused. Output only.
metaResourceMetaResource metadata.
subjectSubjectWho pays and is entitled. Required.
line_itemsLineItem[]What is bought: catalog prices by lookup key. One recurring price makes a subscription; one-time prices make an order. Required.
success_urlstringWhere the buyer lands after paying; {CHECKOUT_SESSION_ID} is replaced by the processor's session id. HTTPS only. Required.
cancel_urlstringWhere the buyer lands on cancel. HTTPS only.
currency_codestringThe currency to charge in, upper-case ISO 4217; default the processor's choice for the buyer among the prices' currencies.
localestringThe page language, for example en or zh-HK; default automatic.
metadatamap<string, string>Copied to the subscription or order, for example attribution (utm_source, ref). At most 20 keys.
allow_promotion_codesboolWhether the buyer may enter a promotion code.
buyer_country_codestringWhere the buyer is, upper-case ISO 3166-1 alpha-2, when the caller knows it (for example from the request's IP address). A country the environment's checkout policy denies is refused here, before any page is made, unless the policy lets a business buy. Not trusted for anything else: the billing address the buyer gives is checked again when the payment completes.
shipping_country_codesstring[]Countries whose shipping address the hosted page collects, upper-case ISO 3166-1 alpha-2. Empty means no shipping address is collected.
urlstringThe hosted page. Output only.
statestringopen, complete, or expired. Output only.
expire_timetimestampWhen the page stops accepting payment. Output only.
processor_session_idstringThe processor's session id. Output only.
denied_reasonstringWhy a completed checkout was refused and refunded instead of delivered: country_denied (the billing country is on the checkout policy's list) or country_unknown (no billing country to check). Empty otherwise. Output only.
billing_country_codestringThe billing country the completed checkout was checked against, upper-case ISO 3166-1 alpha-2; empty until completion. Output only.
billing_subdivision_codestringThe billing state or province, upper-case, kept only for the countries whose tax thresholds are per subdivision (US, CA); empty otherwise. Nothing else of the buyer's address is stored. Output only.
consent_collectionCheckoutConsentCollectionThe consent the hosted page collects before it takes payment, for example a required tick for a withdrawal waiver or the terms of sale.
consentCheckoutConsentThe consent the buyer gave, recorded once the processor reports it. Output only.
customer_emailstringThe buyer's email address, once the hosted checkout has collected it. Output only.
shipping_addressShippingAddressThe physical delivery address, when shipping_country_codes was set and the hosted checkout has collected it. Output only.
amount_totalint64The processor's current total in minor units, when it has reported one. Output only.
payment_statusstringunpaid, paid, or revoked; empty until a one-time checkout settles. Output only.
livemodeboolThe processor's live/test mode, once the session has reported it. Output only.
processor_payment_idstringThe processor payment this checkout produced; empty before settlement. Output only.

#ResourceMeta

FieldTypeWhat it is
generationint64Increases by one on every change to spec. Output only.
etagstringStrong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as If-Match or etag to make Update and Delete conditional; a mismatch fails with ABORTED / 409 ETAG_MISMATCH. Output only.
create_timetimestampWhen the Resource was created. Output only.
update_timetimestampWhen the Resource last changed. Output only.
delete_timetimestampSet while the Resource is being deleted. Output only.
labelsmap<string, string>Caller-writable, indexed labels (AIP-122 label rules).
annotationsmap<string, string>Caller-writable, unindexed annotations.
display_namestringCaller-writable human-readable name.
creatorstringThe principal that created the Resource. Output only.

#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.

#LineItem

FieldTypeWhat it is
pricestringThe price's lookup key. Required.
quantityint32How many; default 1. Seats for a per-seat or family price.

#CheckoutConsentCollection

FieldTypeWhat it is
terms_requiredboolRequire a tick accepting terms_text before the buyer can pay. The merchant's Stripe account needs a terms of service URL in its public business details; without one the create fails with processor_terms_url_missing.
terms_textstringThe wording shown next to the tick; at most 1200 characters. Required with terms_required.
terms_versionstringWhich version of the wording this is, recorded with the consent as evidence; at most 64 characters. Required with terms_required.
promotionsboolOffer the buyer an opt-in to promotional email where the processor allows it.

#CheckoutConsent

FieldTypeWhat it is
terms_acceptedboolWhether the buyer ticked the terms. Output only.
terms_textstringThe wording the buyer saw. Output only.
terms_versionstringThe version of that wording. Output only.
promotionsstringopt_in, opt_out, or empty when promotions were not asked. Output only.
record_timetimestampWhen Money first recorded the answer. Output only.

#ShippingAddress

FieldTypeWhat it is
recipientstringRecipient name. Output only.
line1stringFirst address line. Output only.
line2stringOptional second address line. Output only.
citystringCity or town. Output only.
regionstringState, county or province. Output only.
postal_codestringPostcode. Output only.
region_codestringUpper-case ISO 3166-1 alpha-2 region code. Output only.

#Errors

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/checkout-session:expire" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'