Ingest Items into the Catalog
curl --request POST \
--url https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"id": "item-sku-123",
"title": "Classic T-Shirt",
"link": "https://example.com/products/item-123",
"image_link": "https://example.com/images/item-123.jpg",
"brand_attribute": "Super Tech",
"in_stock": true,
"price": 19.99
}
]
}
'import requests
url = "https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items"
payload = { "items": [
{
"id": "item-sku-123",
"title": "Classic T-Shirt",
"link": "https://example.com/products/item-123",
"image_link": "https://example.com/images/item-123.jpg",
"brand_attribute": "Super Tech",
"in_stock": True,
"price": 19.99
}
] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
id: 'item-sku-123',
title: 'Classic T-Shirt',
link: 'https://example.com/products/item-123',
image_link: 'https://example.com/images/item-123.jpg',
brand_attribute: 'Super Tech',
in_stock: true,
price: 19.99
}
]
})
};
fetch('https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'id' => 'item-sku-123',
'title' => 'Classic T-Shirt',
'link' => 'https://example.com/products/item-123',
'image_link' => 'https://example.com/images/item-123.jpg',
'brand_attribute' => 'Super Tech',
'in_stock' => true,
'price' => 19.99
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items"
payload := strings.NewReader("{\n \"items\": [\n {\n \"id\": \"item-sku-123\",\n \"title\": \"Classic T-Shirt\",\n \"link\": \"https://example.com/products/item-123\",\n \"image_link\": \"https://example.com/images/item-123.jpg\",\n \"brand_attribute\": \"Super Tech\",\n \"in_stock\": true,\n \"price\": 19.99\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"id\": \"item-sku-123\",\n \"title\": \"Classic T-Shirt\",\n \"link\": \"https://example.com/products/item-123\",\n \"image_link\": \"https://example.com/images/item-123.jpg\",\n \"brand_attribute\": \"Super Tech\",\n \"in_stock\": true,\n \"price\": 19.99\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"id\": \"item-sku-123\",\n \"title\": \"Classic T-Shirt\",\n \"link\": \"https://example.com/products/item-123\",\n \"image_link\": \"https://example.com/images/item-123.jpg\",\n \"brand_attribute\": \"Super Tech\",\n \"in_stock\": true,\n \"price\": 19.99\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": {
"valid": {
"count": 1
},
"invalid": {
"count": 8,
"details": [
{
"error-id": "duplicate-item-ids",
"message": "Item ids within a catalog must be unique. Please ensure your request contains unique item ids for the given catalog and try again.",
"count": 1,
"document_ids": [
"567890"
]
},
{
"error-id": "missing-mandatory-attributes",
"message": "Your must include mandatory attributes: id, title, link, and image_link with string data type and try again.",
"count": 1,
"document_ids": [
"567890"
]
},
{
"error-id": "invalid-datatype-attribute",
"message": "The provided item attribute {attribute name} with value {attribute value} can't be converted to the data type {data type} as defined in the catalog schema.",
"count": 1,
"document_ids": [
"7523675"
]
},
{
"error-id": "invalid-item-attribute",
"message": "The provided item attribute is not part of the defined catalog schema. Please check your catalog schema and try again. Undefined attributes: shipping_price",
"count": 2,
"document_ids": [
"312",
"8291379"
]
}
]
}
}
}
Catalog
Ingest Items into the Catalog
You can use this API to ingest items into an existing catalog as long as the attributes provided during ingestion match the attributes provided during catalog creation.
POST
/
catalog
/
{catalog_id}
/
items
Ingest Items into the Catalog
curl --request POST \
--url https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"id": "item-sku-123",
"title": "Classic T-Shirt",
"link": "https://example.com/products/item-123",
"image_link": "https://example.com/images/item-123.jpg",
"brand_attribute": "Super Tech",
"in_stock": true,
"price": 19.99
}
]
}
'import requests
url = "https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items"
payload = { "items": [
{
"id": "item-sku-123",
"title": "Classic T-Shirt",
"link": "https://example.com/products/item-123",
"image_link": "https://example.com/images/item-123.jpg",
"brand_attribute": "Super Tech",
"in_stock": True,
"price": 19.99
}
] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
id: 'item-sku-123',
title: 'Classic T-Shirt',
link: 'https://example.com/products/item-123',
image_link: 'https://example.com/images/item-123.jpg',
brand_attribute: 'Super Tech',
in_stock: true,
price: 19.99
}
]
})
};
fetch('https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'id' => 'item-sku-123',
'title' => 'Classic T-Shirt',
'link' => 'https://example.com/products/item-123',
'image_link' => 'https://example.com/images/item-123.jpg',
'brand_attribute' => 'Super Tech',
'in_stock' => true,
'price' => 19.99
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items"
payload := strings.NewReader("{\n \"items\": [\n {\n \"id\": \"item-sku-123\",\n \"title\": \"Classic T-Shirt\",\n \"link\": \"https://example.com/products/item-123\",\n \"image_link\": \"https://example.com/images/item-123.jpg\",\n \"brand_attribute\": \"Super Tech\",\n \"in_stock\": true,\n \"price\": 19.99\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"id\": \"item-sku-123\",\n \"title\": \"Classic T-Shirt\",\n \"link\": \"https://example.com/products/item-123\",\n \"image_link\": \"https://example.com/images/item-123.jpg\",\n \"brand_attribute\": \"Super Tech\",\n \"in_stock\": true,\n \"price\": 19.99\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-{dc}.moengage.com/v1/catalog/{catalog_id}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"id\": \"item-sku-123\",\n \"title\": \"Classic T-Shirt\",\n \"link\": \"https://example.com/products/item-123\",\n \"image_link\": \"https://example.com/images/item-123.jpg\",\n \"brand_attribute\": \"Super Tech\",\n \"in_stock\": true,\n \"price\": 19.99\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": {
"valid": {
"count": 1
},
"invalid": {
"count": 8,
"details": [
{
"error-id": "duplicate-item-ids",
"message": "Item ids within a catalog must be unique. Please ensure your request contains unique item ids for the given catalog and try again.",
"count": 1,
"document_ids": [
"567890"
]
},
{
"error-id": "missing-mandatory-attributes",
"message": "Your must include mandatory attributes: id, title, link, and image_link with string data type and try again.",
"count": 1,
"document_ids": [
"567890"
]
},
{
"error-id": "invalid-datatype-attribute",
"message": "The provided item attribute {attribute name} with value {attribute value} can't be converted to the data type {data type} as defined in the catalog schema.",
"count": 1,
"document_ids": [
"7523675"
]
},
{
"error-id": "invalid-item-attribute",
"message": "The provided item attribute is not part of the defined catalog schema. Please check your catalog schema and try again. Undefined attributes: shipping_price",
"count": 2,
"document_ids": [
"312",
"8291379"
]
}
]
}
}
}
Rate Limit Information
Request limit: 100/min OR 1000/hr. You can ingest up to 50 items per request. Payload size limit: 5MB (only when Content-Length header is provided).Authorizations
Basic Authentication sends a Base64-encoded string containing your username and password.
You can obtain the username and password from the MoEngage Dashboard:
- Navigate to Settings > Account > APIs.
- Username: Copy the Workspace ID.
- Password: Copy the Catalog API key.
Path Parameters
The unique identifier for the catalog, obtained during catalog creation.
Body
application/json
An array of item objects to add to the catalog. Each item must contain the mandatory attributes (id, title, link, image_link).
Maximum array length:
50Show child attributes
Show child attributes
Response
OK. The ingestion request was processed. The response body contains details on valid and invalid item counts.
Show child attributes
Show child attributes
Was this page helpful?
⌘I