How to: sync products catalog, categories

Intro

This guide will walk you through syncing Merchant's store's product catalog via Products API, which enables powerful features such as:

  • Product Recommender: Leverage the Omnisend's product recommender to suggest relevant products to your merchant's customers based on their browsing and purchase history.
  • Automated Product Inclusion: Easily include product information in merchant's marketing campaigns, such as email templates and dynamic content, without manual data entry.

See the detailed API reference for products and categories

Create a product

In order to create product one by one use the POST /products endpoint. Here's an example using the curl command to create a new product:

curl --request POST \
     --url https://api.omnisend.com/v3/products \
     --header 'X-API-KEY: MERCHANT_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "categoryIDs": [
    "cat123"
  ],
  "productID": "abc123",
  "title": "Shirts",
  "status": "inStock",
  "currency": "USD",
  "productUrl": "http://www.example.com/products/prod-666"
}
'

Update product

Use the PUT /products/{productID} endpoint to update an existing product.

Here's an example using the curl command:

curl --request PUT \
     --url https://api.omnisend.com/v3/products/abc123 \
     --header 'X-API-KEY: MERCHANT_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "title": "Container for mojo",
  "status": "inStock",
  "currency": "USD",
  "updatedAt": "2000-01-01T00:00:01Z"
}
'

Create/update products in batch

Using the batch endpoint to create/update products saves time, minimises API calls, reduces rate limit risks, and improves scalability.

We recommend keeping the payload size limited to a maximum of 1MB to ensure optimal performance and efficient data transmission.

Use POST /batches endpoint to create/update multiple products. Here is an example for creating products:

curl --request POST \
     --url https://api.omnisend.com/v3/batches \
     --header 'X-API-KEY: MERCHANT_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
    "method": "POST",
    "endpoint": "products",
    "items": [
        {
            "categoryIDs": [
                "cat123"
            ],
            "productID": "abc123",
            "title": "Shirts",
            "status": "inStock",
            "currency": "USD",
            "productUrl": "http://www.example.com/products/prod-666"
        }
    ]
}
'

Change method to PUT if you need to update multiple products.

Create products category

In order to create products category use the POST /categories endpoint. Here's an example using the curl command:

curl --request POST \
     --url https://api.omnisend.com/v3/categories \
     --header 'X-API-KEY: MERCHANT_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "categoryID": "cat667",
  "title": "Containers"
}
'

Update products category

You can update/replace products category using the PUT /categories/{categoryID} endpoint. Here's an example using curl command:

curl --request PUT \
     --url https://api.omnisend.com/v3/categories/cat123 \
     --header 'X-API-KEY: MERCHANT_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "title": "New title2"
}
'