Add Products to Collection
#
Method#
/catalogs/collection/add-product#
HeaderKey | Value |
---|---|
Client-Token | ACCOUNT SECURITY TOKEN |
#
ConceptUsing this method, you will be able to add products to a collection in your catalog.
Attention
When adding or removing products from a collection, the ID of the collection is changed by WhatsApp. This means that when you register a product in the collection and try to perform any other operation using the "old" ID, it will result in a non-functional route. Remember to use the ID returned by this route, which is already updated for subsequent operations.
#
Attributes#
RequiredAttributes | Type | Description |
---|---|---|
collectionId | string | Collection ID |
productIds | array string | IDs of the products to be part of the collection |
#
Request Body#
Response#
200Attributes | Type | Description |
---|---|---|
success | boolean | true if it was successful, false in case of failure |
collectionId | string | Updated ID of the collection |
Example
#
405In 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.
#
415If 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".