Real-time Catalogue Ingestion

Real-time catalogue ingestion allows you to send product updates and new products directly to Youzu.ai using our API. This method is ideal for keeping your catalogue synchronized in real-time.

This guide assumes you already have a catalogue ID. If you need to create a catalogue first, see Creating a Catalogue.

Overview

The ingestion API accepts product data in JSON format and processes it asynchronously. You can:

  • Add new products to your catalogue
  • Update existing product information
  • Send products individually or in batches
  • Track ingestion status

Authentication

All ingestion endpoints require authentication using your API key:

x-client-secret: YOUR_CLIENT_SECRET

JSON Ingestion

Send product data directly as a JSON array:

Endpoint

POST https://platform.youzu.ai/api/v1/admin/catalogue/{catalogueId}/ingest

All field names use camelCase. Required fields must be present even when nullable (e.g. dimensions, weightKg, brand). See Data Requirements for the full schema.

{
  "products": [
    {
      "sku": "CHAIR-001",
      "name": {
        "en": "Ergonomic Office Chair"
      },
      "description": {
        "en": "Premium office chair with lumbar support"
      },
      "url": "https://example.com/products/chair",
      "price": {
        "USD": 299.99
      },
      "inStock": true,
      "isPublished": true,
      "images": [
        "https://example.com/images/chair_front.jpg",
        "https://example.com/images/chair_side.jpg"
      ],
      "dimensions": {
        "widthCm": 60,
        "heightCm": 120,
        "lengthCm": 70
      },
      "weightKg": 15.5,
      "brand": "ErgoDesigns"
    }
  ]
}
{
  "success": true,
  "data": {
    "message": "Job created",
    "jobId": "ef5685de-af3d-4077-9d81-e7d25fa51904",
    "status": "pending"
  }
}
const ingestProducts = async (catalogueId, products) => {
  const response = await fetch(`https://platform.youzu.ai/api/v1/admin/catalogue/${catalogueId}/ingest`, {
    method: 'POST',
    headers: {
      'x-client-secret': 'YOUR_CLIENT_SECRET',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      products: products
    })
  });

  if (response.ok) {
    const result = await response.json();
    console.log('Ingestion started:', result.data.jobId);
    return result;
  } else {
    console.error('Ingestion failed:', await response.text());
  }
};

// Example usage
const products = [
  {
    sku: 'CHAIR-001',
    name: { en: 'Ergonomic Office Chair' },
    description: { en: 'Premium office chair with lumbar support' },
    url: 'https://example.com/products/chair',
    price: { USD: 299.99 },
    inStock: true,
    isPublished: true,
    images: [
      'https://example.com/images/chair_front.jpg',
      'https://example.com/images/chair_side.jpg'
    ],
    dimensions: { widthCm: 60, heightCm: 120, lengthCm: 70 },
    weightKg: 15.5,
    brand: 'ErgoDesigns'
  }
];

ingestProducts('cat_abc123', products);
import requests

def ingest_products(catalogue_id, products):
    url = f'https://platform.youzu.ai/api/v1/admin/catalogue/{catalogue_id}/ingest'
    headers = {
        'x-client-secret': 'YOUR_CLIENT_SECRET',
        'Content-Type': 'application/json'
    }
    data = {
        'products': products
    }
    
    response = requests.post(url, headers=headers, json=data)
    
    if response.status_code == 200:
        result = response.json()
        print(f"Ingestion started: {result['data']['jobId']}")
        return result
    else:
        print(f"Ingestion failed: {response.status_code} - {response.text}")

# Example usage
products = [
    {
        'sku': 'CHAIR-001',
        'name': {'en': 'Ergonomic Office Chair'},
        'description': {'en': 'Premium office chair with lumbar support'},
        'url': 'https://example.com/products/chair',
        'price': {'USD': 299.99},
        'inStock': True,
        'isPublished': True,
        'images': [
            'https://example.com/images/chair_front.jpg',
            'https://example.com/images/chair_side.jpg'
        ],
        'dimensions': {'widthCm': 60, 'heightCm': 120, 'lengthCm': 70},
        'weightKg': 15.5,
        'brand': 'ErgoDesigns'
    }
]

ingest_products('cat_abc123', products)
curl -X POST https://platform.youzu.ai/api/v1/admin/catalogue/cat_abc123/ingest \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "products": [
      {
        "sku": "CHAIR-001",
        "name": {"en": "Ergonomic Office Chair"},
        "description": {"en": "Premium office chair with lumbar support"},
        "url": "https://example.com/products/chair",
        "price": {"USD": 299.99},
        "inStock": true,
        "isPublished": true,
        "images": [
          "https://example.com/images/chair_front.jpg",
          "https://example.com/images/chair_side.jpg"
        ],
        "dimensions": {"widthCm": 60, "heightCm": 120, "lengthCm": 70},
        "weightKg": 15.5,
        "brand": "ErgoDesigns"
      }
    ]
  }'