Skip to content
Console
On this page

sylphx money checkout_sessions

Every sylphx money checkout_sessions command: its argument, its flags and a run line.

The checkout_sessions commands of Sylphx Money, as the CLI spells them: the same calls as the checkout_sessions API page, typed for the shell. Install, sign in and the grammar are on the CLI index.

create

Creates a hosted checkout for a subject.

ID — The id segment of the new Resource's name; the server assigns one when omitted.

CLI

Shell
sylphx money checkout-sessions create --parent orgs/acme/projects/shop/envs/production --success-url …

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/checkout_sessions · scope billing:write · effect write · Request, response and examples

Flags

FlagTypeWhat it does
--parentstringThe parent to create in; defaults to the linked project or the key's scope.
--meta.labelskey=valueCaller-writable, indexed labels (AIP-122 label rules). Repeat the flag for each value.
--meta.annotationskey=valueCaller-writable, unindexed annotations. Repeat the flag for each value.
--meta.display-namestringCaller-writable human-readable name.
--subject.end-userstringAn end user's id (Sylphx Auth, or the app's own OIDC issuer).
--subject.customer-organizationstringA customer organization's id.
--line-itemsjsonWhat is bought: catalog prices by lookup key. One recurring price makes a subscription; one-time prices make an order. Required. Repeat the flag for each value.
--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.
--metadatakey=valueCopied to the subscription or order, for example attribution (utm_source, ref). At most 20 keys. Repeat the flag for each value.
--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-codesstringCountries whose shipping address the hosted page collects, upper-case ISO 3166-1 alpha-2. Empty means no shipping address is collected. Repeat the flag for each value.
--consent-collection.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.
--consent-collection.terms-textstringThe wording shown next to the tick; at most 1200 characters. Required with terms_required.
--consent-collection.terms-versionstringWhich version of the wording this is, recorded with the consent as evidence; at most 64 characters. Required with terms_required.
--consent-collection.promotionsboolOffer the buyer an opt-in to promotional email where the processor allows it.
--payment-methodstringstripe (default) or bank_transfer. Bank transfers never contact Stripe.

get

Gets a checkout session.

NAME — the resource's name; a bare id is enough below the linked project.

CLI

Shell
sylphx money checkout-sessions get orgs/acme/projects/shop/envs/production/checkout_sessions/checkout-session

GET https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/checkout_sessions/checkout-session · scope billing:read · effect read · Request, response and examples

expire

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

NAME — the resource's name; a bare id is enough below the linked project.

CLI

Shell
sylphx money checkout-sessions expire orgs/acme/projects/shop/envs/production/checkout_sessions/checkout-session

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/checkout_sessions/checkout-session:expire · scope billing:write · effect write · Request, response and examples

refund

Refund all or part of a paid one-time checkout.

NAME — the resource's name; a bare id is enough below the linked project.

CLI

Shell
sylphx money checkout-sessions refund orgs/acme/projects/shop/envs/production/checkout_sessions/checkout-session

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/checkout_sessions/checkout-session:refund · scope billing:write · effect write · Request, response and examples

Flags

FlagTypeWhat it does
--amount-minorintOptional partial amount in minor units; empty refunds the remaining amount.
--reasonstringOptional processor refund reason.
--metadatakey=valueCaller metadata, such as the app's return and order ids. At most 20 keys. Repeat the flag for each value.