Create a Stripe Checkout session for a payment link or an ad-hoc amount.
Create a Stripe Checkout session for a payment link or an ad-hoc amount.
https://staging.softsolz.uk/api/v1/services/payments/checkout-sessionsRecent Requests
Log in to see full request historyHeaders
AuthorizationstringrequiredBearer token: `Bearer sk_live_...` (or `sk_test_...` for sandbox). A login token will not work here.
Idempotency-KeystringOptional idempotency key for safe retries.
Body Params
payment_link_tokenstring | nullToken of an existing payment link to bill against. When supplied, currency (and a fixed amount, if the link has one) come from the link. Omit to charge an ad-hoc amount (then amount_cents and currency are required).
amount_centsintegerAmount to charge in MINOR units (cents/pence). Required for ad-hoc charges and custom-amount links; ignored when the link has a fixed amount.
currencystringISO 4217 3-letter currency code. Required for ad-hoc charges; taken from the link when payment_link_token is supplied.
descriptionstring | nullLine-item name on the Stripe Checkout page (max 250 chars).
referencestring | nullFree-text reference stored in Stripe metadata (max 500 chars).
customer_emailstring | nullPre-fills the customer email on the Checkout page.
success_urlstringhttp(s) URL Stripe redirects to after a successful payment.
cancel_urlstringhttp(s) URL Stripe redirects to if the customer cancels.
Response
Response Body
urlstring | nullHosted Stripe Checkout URL to redirect the customer to.stripe_session_idstringStripe Checkout Session id.amount_centsintegerCharged amount in minor units (resolved from the link or the request).currencystringISO 4217 currency code, upper-cased.payment_link_idinteger | nullId of the payment link used, or null for an ad-hoc charge.expires_atstring | nullWhen the Stripe Checkout session expires.Request
import { SoftSolz } from '@softsolz/sdk';
const client = new SoftSolz({ apiKey: process.env.SOFTSOLZ_API_KEY });
const result = await client.payments.createCheckoutSession({});console.log(result);Credentials
Sent as a Bearer token. Stored only in your browser.
Response · 201
{ "data": { "url": "string", "stripe_session_id": "string", "amount_cents": 0, "currency": "string", "payment_link_id": 0, "expires_at": "string" }}