Skip to content

Create a session

Creates a checkout session for your account. Pass the returned ID to the Payment SDK. Sessions expire 5 minutes after creation.

Authorization: Bearer <API token>, required.

Name Type Required Description
domain string Yes Host name where the checkout will be displayed, e.g. shop.example.com. Must match the SDK domain option.
Terminal window
curl -X POST "https://api.creditcore.io/api/session?domain=shop.example.com" \
-H "Authorization: Bearer $CREDITCORE_API_TOKEN"

200 OK, text/plain: the session ID.

3f6c2b8e-1d2a-4c55-9a3e-7b1f0c9d2e41
Status Body Cause
401 {"error":"UNAUTHORIZED","status":401} Missing or invalid token.
500 Error with domain in session <domain> domain is empty or invalid.