Skip to main content

Create Collection

Method#

/catalogs/collection#

POST https://api.z-api.io/instances/{{instanceId}}/token/{{instanceToken}}/catalogs/collection

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

Using this method, you will be able to create a collection of products in your catalog.


Attributes#

Required#

AttributesTypeDescription
namestringName of the collection
productIdsarray stringIDs of the products that will be part of the collection

Request Body#

{
"name": "Collection Name",
"productIds": ["121212121212", "232323232323"]
}

Response#

200#

AttributesTypeDescription
collectionIdstringCollection ID

Example

{
"collectionId": "123456789123"
}

405#

In this case, ensure that you are sending the method specification correctly, i.e., check if you sent the POST or GET as specified at the beginning of this topic.

415#

If you receive a 415 error, make sure to add the "Content-Type" of the object you are sending in the request headers, in most cases, it should be "application/json".


Code#