Wocart
Wocart API

Collections

Server

List collections

GET
https://api.wocart.store
/api/collections
X-API-Key (header)

Every collection of the store, oldest first, with how many products each holds.

List collections › Responses

200

The store's collections

success
​boolean · required
​CollectionSummary[] · required
count
​integer · required

Create a collection

POST
https://api.wocart.store
/api/collections
X-API-Key (header)

An empty collection; add products with PUT /{id}/products or from a product's page.

Create a collection › Request Body

handle
​string · pattern: ^[a-z0-9][a-z0-9-]{0… · required

Lowercase letters, digits and hyphens; how a theme names the collection

title
​string · minLength: 1 · maxLength: 100 · required
description
​string | null · maxLength: 1000

Create a collection › Responses

The new collection

success
​boolean · required
​CollectionDetail · required

Get a collection

GET
https://api.wocart.store
/api/collections/{id}
X-API-Key (header)

A collection with its products in order, each saying whether shoppers see it now.

Get a collection › path Parameters

id
​string · required

Collection id

Collection id

Get a collection › Responses

The collection

success
​boolean · required
​CollectionDetail · required

Rename a collection

PATCH
https://api.wocart.store
/api/collections/{id}
X-API-Key (header)

Changes its title, description or handle. A theme names a collection by handle, so a new handle moves it out of every theme setting that named the old one.

Rename a collection › path Parameters

id
​string · required

Collection id

Collection id

Rename a collection › Request Body

handle
​string · pattern: ^[a-z0-9][a-z0-9-]{0…

Lowercase letters, digits and hyphens; how a theme names the collection

title
​string · minLength: 1 · maxLength: 100
description
​string | null · maxLength: 1000

Rename a collection › Responses

The collection

success
​boolean · required
​CollectionDetail · required

Delete a collection

DELETE
https://api.wocart.store
/api/collections/{id}
X-API-Key (header)

Deletes the collection (its products stay in the catalog). A theme section naming it then shows nothing.

Delete a collection › path Parameters

id
​string · required

Collection id

Collection id

Delete a collection › Responses

Deleted

success
​boolean · required
​object · required

Save a collection's products

PUT
https://api.wocart.store
/api/collections/{id}/products
X-API-Key (header)

Replaces the collection's products with this ordered list, at once. Every id must name a product, once.

Save a collection's products › path Parameters

id
​string · required

Collection id

Collection id

Save a collection's products › Request Body

productIds
​string[] · maxItems: 500 · required

The collection's products, in order; replaces the list. At most 500.

Save a collection's products › Responses

The collection as saved

success
​boolean · required
​CollectionDetail · required

Get a collection's translations

GET
https://api.wocart.store
/api/collections/{id}/translations
X-API-Key (header)

The translatable fields in the store's primary language and every stored translation, each flagged outdated when its source text changed after it was written.

Get a collection's translations › path Parameters

id
​string · required

Get a collection's translations › Responses

200

Source and translations

success
​boolean · required
​object · required

Translate a collection into one language

PATCH
https://api.wocart.store
/api/collections/{id}/translations
X-API-Key (header)

A JSON Merge Patch (RFC 7396) of one language: a string sets a field, null removes its translation, other fields are untouched. The language must be one the store has added, and not its primary — the resource's own fields hold that.

Translate a collection into one language › path Parameters

id
​string · required

Translate a collection into one language › Request Body

locale
​string · enum · required
Enum values:
ar
fr
en
​object · required

Translate a collection into one language › Responses

200

Source and translations after the patch

success
​boolean · required
​object · required