Products

Markdown

View as Markdown

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.

Endpoints

EndpointWhat it does
GET /stores/{storeId}/productsList products
POST /stores/{storeId}/productsCreate a product
GET /stores/{storeId}/products/{slug}Get a product
PUT /stores/{storeId}/products/{slug}Replace a product
POST /stores/{storeId}/products/syncSync products from the Product Sheet
POST /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

NameTypeDescription
storeIdstring
required
A store id from GET /stores.

Query parameters

NameTypeDescription
searchstringWords 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

FieldTypeDescription
dataarray of object
data[].slugstringIdentifies the product, and is its storefront URL's last part.
data[].namestring
data[].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.minnumber
data[].price_range.maxnumber
data[].currencystringISO 4217 code.
data[].thumbnailstring, nullableThe first image of any of the product's variants.
pageintegerGreater than 0.
limitintegerGreater than 0.
totalinteger
has_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.

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

NameTypeDescription
storeIdstring
required
A store id from GET /stores.

Request body

FieldTypeDescription
namestring
required
categoriesarray of string
required
Category names. A name the store lacks creates that category. At least 1 item.
descriptionstringThe description of every variant without its own.
variantsarray of object
required
One 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
required
Greater 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

FieldTypeDescription
slugstring
urlstring (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.

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

NameTypeDescription
storeIdstring
required
A store id from GET /stores.
slugstring
required
A 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

FieldTypeDescription
slugstringIdentifies the product, and is its storefront URL's last part.
namestring
urlstring (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.minnumber
price_range.maxnumber
currencystringISO 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, nullable
variants[].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 string
variants[].descriptionstring, nullable
variants[].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.

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

NameTypeDescription
storeIdstring
required
A store id from GET /stores.
slugstring
required
A product slug from GET /stores/{storeId}/products.

Request body

FieldTypeDescription
categoriesarray of string
required
Category names. A name the store lacks creates that category. At least 1 item.
descriptionstringThe description of every variant without its own.
variantsarray of object
required
One 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
required
Greater 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.

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

NameTypeDescription
storeIdstring
required
A 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

FieldTypeDescription
filtersarray 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[].slugstring
categories[].namestring
categories[].image_urlstring, nullable
categories[].seo_titlestring, nullable
categories[].seo_descriptionstring, nullable
categories[].seo_image_urlstring, nullable
products_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.

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

NameTypeDescription
storeIdstring
required
A store id from GET /stores.

Request body

FieldTypeDescription
content_typestring
required
One 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

FieldTypeDescription
upload_urlstring (URL)PUT the image file here, with the same Content-Type.
content_typestring
image_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.

Related Articles

Was this article helpful?