SoftSolzSoftSolz
HomeAPI GuideAPI ReferenceWidget Tester
payments

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.

POSThttps://staging.softsolz.uk/api/v1/services/payments/checkout-sessions

Recent Requests

Log in to see full request history
TimeStatusUser Agent
Make a request to see history.

Headers

Authorizationstringrequired

Bearer token: `Bearer sk_live_...` (or `sk_test_...` for sandbox). A login token will not work here.

Idempotency-Keystring

Optional idempotency key for safe retries.

Body Params

payment_link_tokenstring | null

Token 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_centsinteger

Amount to charge in MINOR units (cents/pence). Required for ad-hoc charges and custom-amount links; ignored when the link has a fixed amount.

currencystring

ISO 4217 3-letter currency code. Required for ad-hoc charges; taken from the link when payment_link_token is supplied.

descriptionstring | null

Line-item name on the Stripe Checkout page (max 250 chars).

referencestring | null

Free-text reference stored in Stripe metadata (max 500 chars).

customer_emailstring | null

Pre-fills the customer email on the Checkout page.

success_urlstring

http(s) URL Stripe redirects to after a successful payment.

cancel_urlstring

http(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"
}
}