code in your code. message is for people and may change.
Any endpoint
Missing API key
Missing API key
Returned with status
401 when there’s no Authorization header.Invalid API key
Invalid API key
Returned with status
401 when the key is wrong, or it was regenerated in Baag App.Plan required
Plan required
Returned with status
403 when the store’s plan doesn’t include API access. The keys work again once the store is back on the Basic plan.Not found
Not found
Returned with status
404 when there’s no endpoint at this path.Rate limited
Rate limited
Returned with status
429 when the key sent too many requests in a short time. Wait a moment, then retry.Internal error
Internal error
Returned with status
500 when something went wrong on Baag’s side. Retry.Products and collections
Invalid limit
Invalid limit
Returned with status
400 when limit is below 1 or not a whole number.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.Collection not found
Collection not found
Returned with status
404 when there’s no collection with this id in the store.Checkout
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.Secret key required
Secret key required
Returned with status
403 when you used your public key. Call this endpoint from your server with your secret key.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.Session not found
Session not found
Returned with status
404 when there’s no checkout session with this id in the store.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.