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://app.softsolz.uk/api/v1/services/payments/checkout-sessionsRecent Requests
Kept only in this browserHeaders
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_urlstringrequiredhttp(s) URL Stripe redirects to after a successful payment.
cancel_urlstringrequiredhttp(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
curl --request POST \ --url https://app.softsolz.uk/api/v1/services/payments/checkout-sessions \ --header 'Authorization: Bearer sk_live_your_key' \ --header 'Content-Type: application/json' \ --data '{ "payment_link_token": "kQ8r3mZ7xv1nT0pL2bC9dE4f", "amount_cents": 2500, "currency": "gbp", "description": "Premium plan setup fee", "reference": "ORDER-10482", "customer_email": "buyer@example.com", "success_url": "https://shop.example.com/thank-you", "cancel_url": "https://shop.example.com/cart"}'Credentials
Sent as a Bearer token and used in the samples above and in Try it. Kept only in this browser tab until you close it. Use an sk_test_ key to stay in your sandbox.
Response · 201
{ "data": { "url": "https://checkout.stripe.com/c/pay/cs_test_a1B2c3", "stripe_session_id": "cs_test_a1B2c3D4e5F6g7H8", "amount_cents": 2500, "currency": "GBP", "payment_link_id": 42, "expires_at": "2026-06-05T13:45:00.000Z" }}