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 status201. Send the buyer to url.
The session expires 30 minutes after it’s created.
Error Responses
Invalid request
Invalid request
Returned with status
400 when a field is missing or has a wrong value. The message names the field.Variant not found
Variant not found
Returned with status
400 when the size and color don’t match a variant, or you sent them for a product that has none.Product not found
Product not found
Returned with status
404 when there’s no product with this slug in the store, or it’s archived.Sold out
Sold out
Returned with status
409 when the product, or the size and color picked, is sold out.Insufficient stock
Insufficient stock
Returned with status
409 when the buyer asked for more than what’s left. The message says how many are left.Internal error
Internal error
Returned with status
500 when something went wrong on Baag’s side. Retry.401, 403, 429) are on API keys.