Skip to main content
You can use this endpoint to get everything about one product: its description, all its photos, its sizes and colors, the price of each option and how many are left. It’s what you need for a product page.
GET

Authorization

All you need is your API key in the Authorization header.
string
required
Bearer, a space, then your API key. You can find it in Baag App → Settings → Developers.

Path Parameters

string
required
The product’s slug. You can find it in All products. For example, https://api.baag.cc/v1/products/mw6.

Response

When everything goes well, you get back status 200 with the product:
Here is what each part means:
  • images are all the product’s photos. colorName tells you which color a photo shows, so you can switch photos when the buyer picks a color.
  • variants are the options a buyer can pick. Each one is a size and color pair with its own price and stock. For example, Red in size M.
  • When a product has only sizes or only colors, the missing one is null in its variants. When it has neither, variants is empty and the product sells as one item.
  • When the buyer is ready to pay, send the variant’s size and colorName to Initiate checkout.
availableQuantity is null when your store isn’t tracking stock for this product. That doesn’t mean it’s out of stock. To know for sure if a product, or one of its variants, can be bought, always check isSoldOut.

Error Responses

Returned with status 404 when there’s no product with this slug in your store, or it’s archived. Check the slug in All products.
Returned with status 401 when the request has no Authorization header. Add your key as Authorization: Bearer pk_live_xxxxxxxxx.
Returned with status 401 when the key is wrong, or it was regenerated in Baag App. Copy your key again from Settings → Developers.
Returned with status 403 when your store’s plan doesn’t include the API. Your key works again as soon as your store is on the Basic or Pro plan.
Returned with status 429 when your key sent too many requests in a short time. Wait a moment, then try again.
Returned with status 500 when something went wrong on Baag’s side. It’s not your fault. Wait a moment, then try again.