Skip to content
gist.link ↗

checkoutStart

Mutation Shop API — POST https://shop.api.gist.link/graphql

Begin checkout for a cart: compute totals (tax/discount) in integer minor units, create a pending Order snapshotting the cart lines, open a pay checkout session (requiresShipping + parcels + sourceRef shop:order:<uuid>) and return the hosted checkout URL. Shipping is NOT computed here: pay’s checkout collects the address and the shipping rate before payment. shippingAddress is optional and only used to pick the tax rate. PUBLIC.

shop:mutation:checkoutStart

The calling IAM key must hold this permission (or a wildcard that covers it: shop:mutation:* or shop:*) and the access token must have been minted with audience=shop. See Permissions.

type Mutation {
checkoutStart(cartToken: String!, email: String!, shippingAddress: JSON): CheckoutStartResult!
}
Argument Type Required Description
cartToken String! Yes —
email String! Yes —
shippingAddress JSON No —

CheckoutStartResult! — see the Shop types reference.

Terminal window
curl https://shop.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "mutation CheckoutStart($cartToken: String!, $email: String!, $shippingAddress: JSON) { checkoutStart(cartToken: $cartToken, email: $email, shippingAddress: $shippingAddress) { checkout_url checkout_session_token } }",
"variables": {
"cartToken": "example",
"email": "ada@example.com",
"shippingAddress": {}
}
}
JSON