Skip to main content
Start a checkout for one product, then send the buyer to the url you get back. Full flow: Checkout.
POST

Authorization

Use your public or secret key.
string
required
Bearer followed by your public or secret key.

Request Body

object[]
required
Exactly one product for now.
string
required
Where the buyer lands after paying, with ?session_id=cs_… added. Must start with http:// or https://.
string
required
Where the buyer goes if they leave without paying. Must start with http:// or https://.
object
Pre-fills the checkout form. The buyer can still change it.
object
Your own references, like a cart id. Up to 20 keys, string values up to 500 characters. Comes back untouched.

Response

Returned with status 201. Send the buyer to url.
The session expires 30 minutes after it’s created.

Error Responses

Returned with status 400 when a field is missing or has a wrong value. The message names the field.
Returned with status 400 when the size and color don’t match a variant, or you sent them for a product that has none.
Returned with status 404 when there’s no product with this slug in the store, or it’s archived.
Returned with status 409 when the product, or the size and color picked, is sold out.
Returned with status 409 when the buyer asked for more than what’s left. The message says how many are left.
Returned with status 500 when something went wrong on Baag’s side. Retry.
Key errors (401, 403, 429) are on API keys.