Storeware Docs
REST

Collections

Groups of products, set by hand or by rules.

List collections

GET /api/v1/stores/{storeId}/collections

Every collection, or a page of them when any of search, kind, sort, limit or offset is given. A page carries meta.total and, in meta.counts, how many products each collection on it holds.

Needs products:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
searchquerystringWords in the title or handle.
kindquerystringOne of manual, automatic.
sortquerystringBy title unless updated_desc, most recently changed first. Any other value is ignored. One of title_asc, updated_desc.
limitqueryintegerHow many to return. Fifty when not given. From 1 to 200.
offsetqueryintegerHow many to skip, for the next page. At least 0.

Answers 200

FieldTypeDescription
dataarray of Collection
metaobjectOnly on a page.
meta.totalinteger
meta.countsmap of integerProducts in each collection on this page, by id.
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections" \
  -H "Authorization: Bearer $TOKEN"

Create a collection

POST /api/v1/stores/{storeId}/collections

Needs products:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.

Body

FieldTypeRequiredDescription
titlestringYes1 to 300 characters.
handlestringNoUp to 128 characters. Matches ^[a-z0-9][a-z0-9-]*$.
descriptionstringNoUp to 50,000 characters.
parentIdstring (uuid)No
seoTitlestringNoUp to 300 characters.
seoDescriptionstringNoUp to 1,000 characters.
kindstringNoOne of manual, automatic. Default manual.
rulesarray of objectNoUp to 10 items. Default [].
rules[].fieldstringYesOne of title, product_type, vendor, tag, price.
rules[].operatorstringYesOne of equals, not_equals, contains, starts_with, ends_with, greater_than, less_than.
rules[].valuestringYes1 to 200 characters.
rules[].currencystringNoMatches ^[A-Z]{3}$.
sortOrderstringNoOne of manual, title_asc, title_desc, created_desc, price_asc, price_desc. Default manual.
filterablebooleanNo

Answers 201

FieldTypeDescription
dataCollection
curl -X POST "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

Get a collection

GET /api/v1/stores/{storeId}/collections/{collectionId}

Needs products:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
collectionIdpathstringThe collection.

Answers 200

FieldTypeDescription
dataCollection
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections/$COLLECTION_ID" \
  -H "Authorization: Bearer $TOKEN"

Update a collection

PATCH /api/v1/stores/{storeId}/collections/{collectionId}

Changes only the fields sent.

Needs products:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
collectionIdpathstringThe collection.

Body

FieldTypeRequiredDescription
titlestringNo1 to 300 characters.
handlestringNoUp to 128 characters. Matches ^[a-z0-9][a-z0-9-]*$.
descriptionstringNoUp to 50,000 characters.
seoTitlestringNoUp to 300 characters.
seoDescriptionstringNoUp to 1,000 characters.
rulesarray of objectNoUp to 10 items.
rules[].fieldstringYesOne of title, product_type, vendor, tag, price.
rules[].operatorstringYesOne of equals, not_equals, contains, starts_with, ends_with, greater_than, less_than.
rules[].valuestringYes1 to 200 characters.
rules[].currencystringNoMatches ^[A-Z]{3}$.
sortOrderstringNoOne of manual, title_asc, title_desc, created_desc, price_asc, price_desc.
filterablebooleanNo

Answers 200

FieldTypeDescription
dataCollection
curl -X PATCH "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections/$COLLECTION_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

Delete a collection

DELETE /api/v1/stores/{storeId}/collections/{collectionId}

Deletes the collection and says what it touched. Its products are kept, and its children move to the top level.

Needs products:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
collectionIdpathstringThe collection.

Answers 200

FieldTypeDescription
dataobject
data.idstring (uuid)
data.titlestring
data.handlestring
data.productsUnlinkedintegerProducts that were in it. The products are untouched.
data.childrenPromotedintegerChild collections moved to the top level.
data.menuItemsRemovedintegerMenu entries that pointed at it.
data.discountTargetsRemovedintegerDiscounts that named it, which now apply to less.
curl -X DELETE "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections/$COLLECTION_ID" \
  -H "Authorization: Bearer $TOKEN"

List a collection’s products

GET /api/v1/stores/{storeId}/collections/{collectionId}/products

A page of the products in the collection, in its own order. Pass meta.next back as after for the next page.

Needs products:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
collectionIdpathstringThe collection.
searchquerystringWords in a product’s title.
idsquerystringComma separated product ids: which of these are in it.
limitqueryintegerHow many to return. Fifty when not given. From 1 to 200.
afterquerystringThe meta.next of the page before.

Answers 200

FieldTypeDescription
dataarray of Product
metaobject
meta.totalintegerMembers the search and ids match.
meta.heldintegerEvery product in the collection.
meta.nextstring or nullPass back as after. Null on the last page.
meta.truncatedbooleanTrue when a price sort was cut short at its cap.
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections/$COLLECTION_ID/products" \
  -H "Authorization: Bearer $TOKEN"

Add products to a collection

POST /api/v1/stores/{storeId}/collections/{collectionId}/products

Adds products to a manual collection. Products already in it are left where they are.

Needs products:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
collectionIdpathstringThe collection.

Body

FieldTypeRequiredDescription
productIdsarray of string (uuid)YesThe products to add.

Answers 201

FieldTypeDescription
dataobject
data.addedinteger
curl -X POST "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections/$COLLECTION_ID/products" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

Remove a product from a collection

DELETE /api/v1/stores/{storeId}/collections/{collectionId}/products/{productId}

Needs products:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
collectionIdpathstringThe collection.
productIdpathstringThe product.

Answers 200

FieldTypeDescription
dataobject
data.removedtrue
curl -X DELETE "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections/$COLLECTION_ID/products/$PRODUCT_ID" \
  -H "Authorization: Bearer $TOKEN"

List a collection’s metafields

GET /api/v1/stores/{storeId}/collections/{collectionId}/metafields

Every metafield value set on a collection, each with its definition.

Needs products:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
collectionIdpathstringThe collection.

Answers 200

FieldTypeDescription
dataarray of object
data[].definitionIdstring (uuid)
data[].namespacestring
data[].keystring
data[].labelstringThe merchant’s name for the field.
data[].typestringsingle_line_text, multi_line_text, integer, decimal, boolean, date, url and the other definition types.
data[].isListboolean
data[].storefrontVisibleboolean
data[].searchFacetboolean
data[].positioninteger
data[].valueanyThe value, or a list of values when isList.
data[].displayValuestringThe value as one line of text, lists joined.
data[].sourcestringWho set it: the merchant, an import, or an app’s slug.
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections/$COLLECTION_ID/metafields" \
  -H "Authorization: Bearer $TOKEN"

Set a collection’s metafields

PUT /api/v1/stores/{storeId}/collections/{collectionId}/metafields

Sets up to 25 values in one call. A null value clears its field; keys not named are left alone. An app may set only the fields its manifest declares.

Needs products:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
collectionIdpathstringThe collection.

Body

FieldTypeRequiredDescription
metafieldsarray of objectYesUp to 25 items. At least 1 item.
metafields[].namespacestringNoDefault custom.
metafields[].keystringYes
metafields[].valueanyNo

Answers 200

FieldTypeDescription
dataarray of object
data[].definitionIdstring (uuid)
data[].namespacestring
data[].keystring
data[].labelstringThe merchant’s name for the field.
data[].typestringsingle_line_text, multi_line_text, integer, decimal, boolean, date, url and the other definition types.
data[].isListboolean
data[].storefrontVisibleboolean
data[].searchFacetboolean
data[].positioninteger
data[].valueanyThe value, or a list of values when isList.
data[].displayValuestringThe value as one line of text, lists joined.
data[].sourcestringWho set it: the merchant, an import, or an app’s slug.
curl -X PUT "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections/$COLLECTION_ID/metafields" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

List a collection’s translations

GET /api/v1/stores/{storeId}/collections/{collectionId}/translations

Every translated field, by locale.

Needs products:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
collectionIdpathstringThe collection.

Answers 200

FieldTypeDescription
datamap of map of stringLocale, then field, then the translated text.
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections/$COLLECTION_ID/translations" \
  -H "Authorization: Bearer $TOKEN"

Set a collection’s translations

PUT /api/v1/stores/{storeId}/collections/{collectionId}/translations

Sets translated fields for one locale. Fields not named are left alone, and a null clears one.

Needs products:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
collectionIdpathstringThe collection.

Body

FieldTypeRequiredDescription
localestringYesMatches ^[a-z]{2,3}(-[A-Z]{2})?$.
fieldsmap of string or nullYes

Answers 200

FieldTypeDescription
datamap of stringThe locale’s fields after the change.
curl -X PUT "https://api.storeware.ai/api/v1/stores/$STORE_ID/collections/$COLLECTION_ID/translations" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

On this page