# Products

A store's products. They live in the store's Google Sheet, the Product Sheet:
product writes go to the Sheet through Storelink's own Google account, then to
the storefront, and a sync rebuilds the storefront from the Sheet with the store
owner's Google account. So a key whose role can write products changes the
owner's Sheet, as that role can in the dashboard. Edit many products at once,
and delete products, in the Sheet.

All paths are relative to the base URL https://api.store.link/v1. Every request
needs your API key; see Overview
[https://store.link/help/developer/article/1165].


ENDPOINTS

EndpointWhat it doesGET /stores/{storeId}/productsList productsPOST
/stores/{storeId}/productsCreate a productGET
/stores/{storeId}/products/{slug}Get a productPUT
/stores/{storeId}/products/{slug}Replace a productPOST
/stores/{storeId}/products/syncSync products from the Product SheetPOST
/stores/{storeId}/uploadsUpload an image


LIST PRODUCTS

GET /stores/{storeId}/products

Products, found by words from their name and by category, or all of them. Hidden
products are left out unless include_hidden is true.

Your role in the store needs to read products.


PATH PARAMETERS

NameTypeDescriptionstoreIdstring
requiredA store id from GET /stores.


QUERY PARAMETERS

NameTypeDescriptionsearchstringWords from the product name.categorystringA
category slug from GET /stores/{storeId}.include_hiddenstringInclude products
hidden from the storefront. One of: true, false. Default:
"false".pageintegerDefault: 1. At least 1.limitintegerDefault: 25. 1 to 100.


EXAMPLE REQUEST

curl 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/products' \
  -H 'Authorization: Bearer YOUR_API_KEY'


RESPONSE

FieldTypeDescriptiondataarray of objectdata[].slugstringIdentifies the product,
and is its storefront URL's last part.data[].namestringdata[].urlstring (URL)The
product on the storefront.data[].categoriesarray of stringCategory
names.data[].hiddenbooleanHidden from the
storefront.data[].variant_countintegerVisible variants.data[].price_rangeobject,
nullableWhat a shopper pays for the product's cheapest and dearest visible
variant.data[].price_range.minnumberdata[].price_range.maxnumberdata[].currencystringISO
4217 code.data[].thumbnailstring, nullableThe first image of any of the
product's variants.pageintegerGreater than 0.limitintegerGreater than
0.totalintegerhas_moreboolean


EXAMPLE RESPONSE

{
  "data": [
    {
      "slug": "classic-tee",
      "name": "Classic Tee",
      "url": "https://beanandbrew.store.link/product/classic-tee",
      "categories": [
        "T-shirts"
      ],
      "hidden": false,
      "variant_count": 2,
      "price_range": {
        "min": 20,
        "max": 25
      },
      "currency": "USD",
      "thumbnail": "https://cdn.store.link/images/classic-tee.jpg"
    }
  ],
  "page": 1,
  "limit": 25,
  "total": 50,
  "has_more": true
}


ERRORS

The common errors: 400 invalid_request, 401 unauthorized, 403
insufficient_permission, 404 store_not_found, 429 rate_limited, 500
internal_error. See Errors in the Overview
[https://store.link/help/developer/article/1165].


CREATE A PRODUCT

POST /stores/{storeId}/products

Adds a product to the Product Sheet, then the storefront. Its slug comes from
its name, and a name another product's slug already has is a conflict.

Your role in the store needs to write products.


PATH PARAMETERS

NameTypeDescriptionstoreIdstring
requiredA store id from GET /stores.


REQUEST BODY

FieldTypeDescriptionnamestring
requiredcategoriesarray of string
requiredCategory names. A name the store lacks creates that category. At least 1
item.descriptionstringThe description of every variant without its
own.variantsarray of object
requiredOne variant per combination of option values. A store without variant
options takes exactly one. 1 to 100 items.variants[].optionsobject (map of
string)Option values keyed by the store's variant_options from GET
/stores/{storeId}, e.g. { "Size": "M" }. Leave out when the store has
none.variants[].pricenumber
requiredGreater than 0.variants[].discounted_pricenumberThe price a shopper
pays, when lower. Leave out for no discount. Greater than
0.variants[].stockintegerLeave out to not track stock.variants[].imagesarray of
string (URL)Image URLs; the first is the
thumbnail.variants[].availabilitystringDefault Show. One of: Show, Out of Stock,
Hide.variants[].descriptionstringReplaces the product's description for this
variant.variants[].propertiesobject (map of string)Tags, filters and specs,
keyed as GET /products/{slug} returns them.


EXAMPLE REQUEST

curl -X POST 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/products' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Classic Tee",
  "categories": [
    "T-shirts"
  ],
  "description": "Soft cotton tee with a relaxed fit.",
  "variants": [
    {
      "options": {
        "Size": "M",
        "Color": "Black"
      },
      "price": 25,
      "discounted_price": 20,
      "stock": 40,
      "images": [
        "https://cdn.store.link/images/classic-tee.jpg"
      ],
      "availability": "Show",
      "properties": {
        "Material": "Cotton"
      }
    }
  ]
}'


RESPONSE

FieldTypeDescriptionslugstringurlstring (URL)The product on the
storefront.statusstringlive: saved to the Product Sheet and the storefront.
pending_sync: saved to the Product Sheet, and on the storefront within a few
minutes. One of: live, pending_sync.


EXAMPLE RESPONSE

{
  "slug": "classic-tee",
  "url": "https://beanandbrew.store.link/product/classic-tee",
  "status": "live"
}


ERRORS

 * 409 conflict: The write collides with what the store has, such as a code or
   slug in use.
 * 422 product_sheet_error: Storelink couldn't read or write the store's Product
   Sheet in Google Sheets. The message says what to fix.

Plus the common errors: 400 invalid_request, 401 unauthorized, 403
insufficient_permission, 404 store_not_found, 429 rate_limited, 500
internal_error. See Errors in the Overview
[https://store.link/help/developer/article/1165].


GET A PRODUCT

GET /stores/{storeId}/products/{slug}

One product with every variant, hidden ones included and marked hidden: options,
price, discounted price, stock, availability, images and properties.

Your role in the store needs to read products.


PATH PARAMETERS

NameTypeDescriptionstoreIdstring
requiredA store id from GET /stores.slugstring
requiredA product slug from GET /stores/{storeId}/products.


EXAMPLE REQUEST

curl 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/products/classic-tee' \
  -H 'Authorization: Bearer YOUR_API_KEY'


RESPONSE

FieldTypeDescriptionslugstringIdentifies the product, and is its storefront
URL's last part.namestringurlstring (URL)The product on the
storefront.categoriesarray of stringCategory names.hiddenbooleanHidden from the
storefront.variant_countintegerVisible variants.price_rangeobject, nullableWhat
a shopper pays for the product's cheapest and dearest visible
variant.price_range.minnumberprice_range.maxnumbercurrencystringISO 4217
code.thumbnailstring, nullableThe first image of any of the product's
variants.variantsarray of objectEvery variant in Product Sheet order, hidden
ones included.variants[].keystringWhat POST /orders takes as
variant_key.variants[].optionsobject (map of string)Option values keyed by the
slug of the store's variant option, e.g. size.variants[].pricenumber,
nullablevariants[].discounted_pricenumber, nullableThe price a shopper pays when
set.variants[].stocknumber, nullablenull when stock is not
tracked.variants[].availabilitystringShow, Hide, or a Product Sheet value such
as Sold out.variants[].hiddenbooleanHidden from the
storefront.variants[].imagesarray of stringvariants[].descriptionstring,
nullablevariants[].propertiesobject (map of string)The variant's other Product
Sheet columns, such as tags, filters and specs.


EXAMPLE RESPONSE

{
  "slug": "classic-tee",
  "name": "Classic Tee",
  "url": "https://beanandbrew.store.link/product/classic-tee",
  "categories": [
    "T-shirts"
  ],
  "hidden": false,
  "variant_count": 2,
  "price_range": {
    "min": 20,
    "max": 25
  },
  "currency": "USD",
  "thumbnail": "https://cdn.store.link/images/classic-tee.jpg",
  "variants": [
    {
      "key": "M-Black",
      "options": {
        "size": "M",
        "color": "Black"
      },
      "price": 25,
      "discounted_price": 20,
      "stock": 40,
      "availability": "Show",
      "hidden": false,
      "images": [
        "https://cdn.store.link/images/classic-tee.jpg"
      ],
      "description": "Soft cotton tee with a relaxed fit.",
      "properties": {
        "Material": "Cotton"
      }
    }
  ]
}


ERRORS

 * 404 not_found: Nothing with this id in this store, or something the body
   names, such as a product or coupon, is not there.

Plus the common errors: 400 invalid_request, 401 unauthorized, 403
insufficient_permission, 404 store_not_found, 429 rate_limited, 500
internal_error. See Errors in the Overview
[https://store.link/help/developer/article/1165].


REPLACE A PRODUCT

PUT /stores/{storeId}/products/{slug}

Replaces the product's categories, description and variants in the Product
Sheet, then the storefront. Variants you leave out are deleted from the Product
Sheet, so send every variant you keep, properties included. The product keeps
its name; rename it in the Product Sheet.

Your role in the store needs to write products.


PATH PARAMETERS

NameTypeDescriptionstoreIdstring
requiredA store id from GET /stores.slugstring
requiredA product slug from GET /stores/{storeId}/products.


REQUEST BODY

FieldTypeDescriptioncategoriesarray of string
requiredCategory names. A name the store lacks creates that category. At least 1
item.descriptionstringThe description of every variant without its
own.variantsarray of object
requiredOne variant per combination of option values. A store without variant
options takes exactly one. 1 to 100 items.variants[].optionsobject (map of
string)Option values keyed by the store's variant_options from GET
/stores/{storeId}, e.g. { "Size": "M" }. Leave out when the store has
none.variants[].pricenumber
requiredGreater than 0.variants[].discounted_pricenumberThe price a shopper
pays, when lower. Leave out for no discount. Greater than
0.variants[].stockintegerLeave out to not track stock.variants[].imagesarray of
string (URL)Image URLs; the first is the
thumbnail.variants[].availabilitystringDefault Show. One of: Show, Out of Stock,
Hide.variants[].descriptionstringReplaces the product's description for this
variant.variants[].propertiesobject (map of string)Tags, filters and specs,
keyed as GET /products/{slug} returns them.


EXAMPLE REQUEST

curl -X PUT 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/products/classic-tee' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "categories": [
    "T-shirts"
  ],
  "description": "Soft cotton tee with a relaxed fit.",
  "variants": [
    {
      "options": {
        "Size": "M",
        "Color": "Black"
      },
      "price": 25,
      "discounted_price": 20,
      "stock": 40,
      "images": [
        "https://cdn.store.link/images/classic-tee.jpg"
      ],
      "availability": "Show",
      "properties": {
        "Material": "Cotton"
      }
    },
    {
      "options": {
        "Size": "L",
        "Color": "Black"
      },
      "price": 25,
      "stock": 12,
      "images": [
        "https://cdn.store.link/images/classic-tee.jpg"
      ],
      "properties": {
        "Material": "Cotton"
      }
    }
  ]
}'


RESPONSE

The same result, with the fields listed under Create a product above.


ERRORS

 * 404 not_found: Nothing with this id in this store, or something the body
   names, such as a product or coupon, is not there.
 * 422 product_sheet_error: Storelink couldn't read or write the store's Product
   Sheet in Google Sheets. The message says what to fix.

Plus the common errors: 400 invalid_request, 401 unauthorized, 403
insufficient_permission, 404 store_not_found, 429 rate_limited, 500
internal_error. See Errors in the Overview
[https://store.link/help/developer/article/1165].


SYNC PRODUCTS FROM THE PRODUCT SHEET

POST /stores/{storeId}/products/sync

Rebuilds the store's products and categories from the Product Sheet now, as the
dashboard's Sync from Google Sheet does, and returns the Product Sheet settings.
It answers when the rebuild ends, which takes longer for a large Sheet.

Your role in the store needs to write products.


PATH PARAMETERS

NameTypeDescriptionstoreIdstring
requiredA store id from GET /stores.


EXAMPLE REQUEST

curl -X POST 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/products/sync' \
  -H 'Authorization: Bearer YOUR_API_KEY'


RESPONSE

FieldTypeDescriptionfiltersarray of stringColumns used as category page
filters.variant_optionsarray of stringColumns a product’s variants differ
by.product_informationarray of stringColumns shown as product
details.sheet_formulasbooleanWhether the Product Sheet may use
formulas.available_columnsobject, nullableThe Product Sheet's columns each list
can use; null when the Sheet can't be read.available_columns.filtersarray of
stringColumns used as category page
filters.available_columns.variant_optionsarray of stringColumns a product’s
variants differ by.available_columns.product_informationarray of stringColumns
shown as product details.categoriesarray of objectIn storefront
order.categories[].slugstringcategories[].namestringcategories[].image_urlstring,
nullablecategories[].seo_titlestring,
nullablecategories[].seo_descriptionstring,
nullablecategories[].seo_image_urlstring, nullableproducts_rebuiltbooleanfalse
when the Product Sheet couldn't be read; the storefront keeps its products.


EXAMPLE RESPONSE

{
  "filters": [
    "Color"
  ],
  "variant_options": [
    "Size",
    "Color"
  ],
  "product_information": [
    "Material"
  ],
  "sheet_formulas": false,
  "available_columns": {
    "filters": [
      "Color",
      "Material"
    ],
    "variant_options": [
      "Size",
      "Color"
    ],
    "product_information": [
      "Material"
    ]
  },
  "categories": [
    {
      "slug": "t-shirts",
      "name": "T-shirts",
      "image_url": "https://cdn.store.link/images/t-shirts.jpg",
      "seo_title": "T-shirts | Bean & Brew",
      "seo_description": "Soft cotton tees in every size.",
      "seo_image_url": null
    }
  ],
  "products_rebuilt": true
}


ERRORS

The common errors: 400 invalid_request, 401 unauthorized, 403
insufficient_permission, 404 store_not_found, 429 rate_limited, 500
internal_error. See Errors in the Overview
[https://store.link/help/developer/article/1165].


UPLOAD AN IMAGE

POST /stores/{storeId}/uploads

Returns a URL to upload one image to the store's CDN, for a product's images.
PUT the raw file to upload_url before expires_at, with the same Content-Type,
e.g. curl -X PUT -H 'Content-Type: image/png' --upload-file shirt.png
'<upload_url>'. Then use image_url in a product write. An image already online
needs no upload.

Your role in the store needs to write products.


PATH PARAMETERS

NameTypeDescriptionstoreIdstring
requiredA store id from GET /stores.


REQUEST BODY

FieldTypeDescriptioncontent_typestring
requiredOne of: image/png, image/jpeg, image/webp.


EXAMPLE REQUEST

curl -X POST 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/uploads' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "content_type": "image/png"
}'


RESPONSE

FieldTypeDescriptionupload_urlstring (URL)PUT the image file here, with the same
Content-Type.content_typestringimage_urlstring (URL)Where the image is served
after the upload.expires_atstring (date-time)When upload_url stops taking the
upload.


EXAMPLE RESPONSE

{
  "upload_url": "https://uploads.store.link/665f1c2a/abc123?X-Amz-Signature=…",
  "content_type": "image/png",
  "image_url": "https://cdn.store.link/images/classic-tee.jpg",
  "expires_at": "2026-11-20T10:30:00.000Z"
}


ERRORS

The common errors: 400 invalid_request, 401 unauthorized, 403
insufficient_permission, 404 store_not_found, 429 rate_limited, 500
internal_error. See Errors in the Overview
[https://store.link/help/developer/article/1165].