SpaceMediaSpaceMedia
Integrations

Checkouts

Checkout endpoints create a payment attempt and return a checkout_id. Verification endpoints accept that same checkout_id after the payment provider completes the checkout.

Checkout fields

FieldMeaning
checkout_idPublic checkout reference returned by the API.
redirect_urlHosted checkout URL when the gateway uses redirects.
embedded_checkout_tokenShort-lived embedded checkout token. Treat it as sensitive and only pass it to the payment collection component.
success_urlURL the user returns to after successful checkout. Optional, and accepted on subscription and plan checkouts only.
cancel_urlURL the user returns to after canceling checkout. Optional, and accepted on subscription and plan checkouts only.

Add-on checkouts and copyright wallet top-ups do not take return URLs. Add-on checkout takes an optional return_to path instead; copyright top-ups take neither. Both are resolved with the returned checkout reference and its status endpoint.

Verification pattern

curl --request POST 'https://enterprise.spacemedia.uk/api/v1/order/checkout/verify' \
  --header 'Authorization: Bearer 0000000000000000000000000000000000000000963fbb8e' \
  --header 'Content-Type: application/json' \
  --data '{"checkout_id":"39b189c1-8f8e-4df2-8632-176f87f791a1"}'

Checkout matrix

FlowCreate endpointVerify or status endpointStoreRecovery
Release checkout, StripePOST /api/v1/order/{release_id}/checkout/stripePOST /api/v1/order/checkout/verifycheckout_id, release_idVerify after provider return. If timeout happens, check checkout state before creating another checkout.
Release checkout, PayPalPOST /api/v1/order/{release_id}/checkout/paypalPOST /api/v1/order/checkout/verifycheckout_id, release_idVerify after provider return and keep the original release reference.
Release checkout, AirwallexPOST /api/v1/order/{release_id}/checkout/airwallexPOST /api/v1/order/checkout/verifycheckout_id, release_idIf embedded checkout data expires, create a new checkout only after the first attempt is known to be unusable.
Credits checkoutPOST /api/v1/order/credits/checkoutPOST /api/v1/order/credits/checkout/verifycheckout_idVerify before increasing local credit balances or unlocking credit-backed actions.
Subscription checkoutPOST /api/v1/subscriptions/subscribe/{package_id}/checkout/stripe, /paypal, or /airwallexPOST /api/v1/subscriptions/subscribe/{package_id}/payment-verifycheckout_id, package_idVerify before marking a package active in a customer system.
Add-on checkoutPOST /api/v1/addons/{addon_slug}/checkoutGET /api/v1/addons/checkout/{checkout_id}/statuscheckout_id, add-on slugRead add-on status after checkout before calling install or activate again.
Copyright wallet top-upPOST /api/v1/copyright/wallet/top-upGET /api/v1/copyright/wallet/top-up/{checkout_id}/statuscheckout_id, wallet reference when returnedVerify before updating customer-side wallet balance.
Payment method setupPayment method setup endpoints under /api/v1/billing/payment-methods/*Matching setup verify endpoint when providedpayment_method_id after successDo not show a payment method as usable until verification succeeds.

Status handling

Status familyMeaningClient action
PendingCheckout was created but final provider outcome is not known.Show pending state and verify again with backoff.
CompletedPayment or setup completed.Read related billing, subscription, wallet, or add-on state before unlocking access.
FailedProvider or gateway rejected the attempt.Show a recovery action and allow a new checkout when the previous attempt is terminal.
CancelledUser cancelled the checkout.Return the user to the cart or billing action.
ExpiredCheckout can no longer be completed.Create a new checkout only if the customer still wants to proceed.

Invoice downloads

Billing history items include an invoice_pdf_url when a PDF is available. The URL uses the same public checkout_id style as checkout creation and verification:

curl --request GET 'https://enterprise.spacemedia.uk/api/v1/billing/invoices/39b189c1-8f8e-4df2-8632-176f87f791a1/pdf' \
  --header 'Authorization: Bearer 0000000000000000000000000000000000000000963fbb8e' \
  --output night-shift-records-invoice.pdf

Safe client behavior

  • Store checkout_id with the local cart, release, subscription, or wallet top-up workflow.
  • Verify once the user returns from the provider or the embedded payment component reports completion.
  • Show a retry option for recoverable gateway errors.
  • Do not automatically create another checkout after a timeout. Read the current state first.
  • Do not expose API keys, webhook secrets, or live provider references in client-side logs.

Common questions

Can I trust the redirect the customer comes back on? No. Query parameters on a return URL are navigation data. Always verify server side before granting anything.

My checkout timed out. Should I create another? Check whether a checkout_id was returned and whether the related order state changed first. A second checkout can mean a second charge.

How long should I keep polling a pending checkout? Until it reaches a terminal state: complete, failed, cancelled, or expired. Poll after the customer returns, then back off.

What should I never log? Short-lived payment tokens such as embedded_checkout_token. Keep the checkout_id as your durable reference instead.

Was this page helpful?

On this page