Manage your products

Learn how to create and manage your products

After importing your product categories you can easily manage your product inventory through the following steps.

Requirements

To create and manage your eCommerce store products you need to have access to the Brevo eCommerce app. If you have not already activated the eCommerce platform on your account you can go to eCommerce > Add the eCommerce App.

Create a product

To integrate your store with Brevo you will need to create products. You can check out the API endpoint reference for creating products in eCommerce > Create/Update a product.

The cURL request to do so is the following:

curl --request POST \
     --url https://api.brevo.com/v3/products \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
     "categories": [
          "CAT123"
     ],
     "metaInfo": {
          "description": "A smartphone"
     },
     "id": "P11",
     "name": "Iphone 11",
     "url": "http://mydomain.com/product/electronics/product1",
     "imageUrl": "http://mydomain.com/product-absolute-url/img.jpeg",
     "sku": "P1",
     "price": 500,
     "parentId": "P3",
     "updateEnabled": true
}'

You can use this cURL request to create a product. You can find the parameters used in creating a product below.

AttributeDatatypeDescriptionValue
idStringProduct ID for which you requested the detailsP11
nameStringProduct nameiPhone 11
urlStringUrl to the producthttp://mydomain.com
imageUrlStringUrl to the cover image of the producthttp://mydomain.com
skuStringProduct identifier from the shopP22
priceFloatPrice of the product300.80
categoriesArray of stringsCategory ID of the product. Product can belong to multiple categoriesCAT123
parentIdStringParent product id of the productP200
metaInfoObjectMeta data of product like description, vendor, producer and stock etc.A small smartphone
updateEnabledBooleanFacilitates to update the existing category in the same request.false/true

Create products in a batch

Lets say you have multiple products to create, you can use the endpoint eCommerce > Creates the products in a batch. Instead calling the enpoint multiple times, you can instead create them all in one single batch. The cURL request for batch products creation is as follows:

curl --request POST \
     --url https://api.brevo.com/v3/products/batch \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data

📘

Batch limits

You can create up to 100 products in a single batch. Below you find sample JSON code to create products in batches.

{
     "products": [
          {
               "categories": [
                    "CAT123"
               ],
               "metaInfo": {
                    "Vendor": "Samsung"
               },
               "id": "P12",
               "name": "Samsung S22",
               "url": "http://mydomain.com/product/electronics/product1",
               "imageUrl": "http://mydomain.com/product-absoulte-url/img.jpeg",
               "sku": "P2",
               "price": 600,
               "parentId": "P01"
          },
          {
               "categories": [
                    "CAT123"
               ],
               "metaInfo": {
                    "vendor": "Samsung"
               },
               "id": "P3",
               "name": "Samsung S21",
               "url": "http://mydomain.com/product/electronics/product1",
               "imageUrl": "http://mydomain.com/product-absoulte-url/img.jpeg",
               "sku": "P33",
               "price": 300,
               "parentId": "P4"
          }
     ],
     "updateEnabled": true
}

The parameters are the same as the ones in Create a product, only the products are in batches. The parameters used in creating products in batches are mentioned below:

AttributesDatatypeDescriptionValue
productsArray of products objectsContains all the products in array of products objectsAll attributes of the product
idStringProduct id for which you requested the detailsP11
nameStringName of the productiPhone 11
urlStringUrl to the producthttp://mydomain.com/product/electronics/product1
imageUrlStringUrl to the cover image of the producthttp://mydomain.com/product-absoulte-url/img.jpeg
skuStringProduct identifier from the shopP22
priceFloatPrice of the product300.80
categoriesArray of StringsCategory ID of the product. Product can belong to multiple categoriesCAT123
parentIdStringParent product id of the productP200
metaInfoObjectMeta data of product like description, vendor, producer and stock etc.Apple
updateEnabledBooleanFacilitates to update the existing category in the same request.true/false

Update a product

To update an existing product, we need to change the parameter updateEnabled to true. It allows two boolean fields, true and false. We cannot update the product if the field is set to false.

"updateEnabled": true
AttributeDatatypeDescriptionValue
updateEnabledBooleanFacilitate to update the existing product in the same request.True

If you choose to update the product parameters later, you can set this field to true when you are creating the product.

Responses you should expect

Response codeMessageDescription
201Product createdThis shows a message with product id which means that product has been created.
204Product updatedThis shows no specific message which means that product has been created.
401Bad request- Your api-key may not be correct
- You have not activated the access to the API. See this article for info.
- The format for name and url may not be correct

You can find a list of errors here.

Retrieving all products

You can test the API to get all the products by going to eCommerce > Return all your products. You can find the cURL request below:

curl --request GET \
     --url 'https://api.brevo.com/v3/products?limit=50&offset=0&sort=desc' \
     --header 'accept: application/json'

The parameters for this endpoint are:

AttributeDatatypeDescriptionValue
limitInt64Number of documents per page.50
offsetInt64Index of first document in page.0
sortStringSort results in ascending/descending order of record creation.desc
idsArray of stringsFillter by product idsAdd any number of product ids

How to get a product's details?

You can get a specific product's details by sending a GET request with the product id of that item. You can test this API endpoint at eCommerce > Get a product's details.

curl --request GET \
     --url https://api.brevo.com/v3/products/P11 \
     --header 'accept: application/json' \

The cURL request above is responsible for sending the request to the endpoint. id is the only parameter for this endpoint, it is a unique identifier for the product.

AttributeDatatypeDescriptionValue
idStringProduct IDP11

What’s Next