Guides
Send your catalogue from any platform
Batch your products and content to the ingestion API, remove what is gone, and confirm each batch.
On this page
On Magento the module keeps Ottla in sync for you. On any other platform, your server sends the catalogue through Ottla’s product catalogue sync API: products with their prices and stock, categories, the pages and documents that answer shoppers’ questions, and order history. The assistant can only be as good as what you send, so this is the part worth getting right.
Use a Server import key (scope ingest:write) and keep it on your server. Every write is accepted straight away with 202 and the header X-Ottla-Ingest: queued, then processed shortly after; the response’s ack_id lets you confirm the result. Each request takes up to 500 items (500 orders, or up to 1,000 ids when deleting), and each key can make 120 ingestion requests a minute.
A sync in five steps
-
Send categories
Send categories first, so products can point at them. Use your platform’s own ids as
external_idand link children to parents withparent_external_id.curl https://ottla.ai/api/v1/ingest/categories \ -H "Authorization: Bearer YOUR_SERVER_KEY" \ -H "Content-Type: application/json" \ -d '{ "website_id": 12, "items": [ {"external_id": "30", "name": "Tents", "url": "https://shop.example/tents"}, {"external_id": "31", "name": "Two-person tents", "url": "https://shop.example/tents/two-person", "parent_external_id": "30"} ] }' -
Send products with prices and stock
Send products in batches of up to 500, each with its price and stock in
market_signals. Products with prices and stock shows a full example. -
Send content
Send CMS pages, FAQs, reviews, blog posts and documents. Mark your delivery and returns pages with the right
source_type: see Content and documents. -
Send orders
Send your order history once, then keep sending new orders as they happen. They help improve bought-together rows, best sellers and kits. Learn more about Orders.
-
Confirm each batch
Poll
/ingest/ackswith theack_idfrom each response until it settles. See Confirm each batch.
Products with prices and stock
There is no top-level price field on a product. Prices and stock travel in market_signals, one entry per market, each with a market code and a currency. This product is on sale at £149.00, down from £179.00, with 12 in stock:
curl https://ottla.ai/api/v1/ingest/products \
-H "Authorization: Bearer YOUR_SERVER_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: products-2026-11-03-batch-001" \
-d '{
"website_id": 12,
"items": [{
"external_id": "1042",
"sku": "TENT-2P",
"name": "Trailhead 2 tent",
"url": "https://shop.example/trailhead-2-tent",
"image_url": "https://shop.example/media/trailhead-2.jpg",
"status": "enabled",
"short_description": "A two-person backpacking tent with a porch on each side.",
"attributes": {"colour": "green", "weight_kg": 2.1},
"category_external_ids": ["31"],
"market_signals": [{
"market_code": "uk",
"currency": "GBP",
"regular_price": 179.00,
"special_price": 149.00,
"in_stock": true,
"salable_qty": 12,
"availability": "in_stock"
}]
}]
}'
// Node 18 or later
const res = await fetch('https://ottla.ai/api/v1/ingest/products', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_SERVER_KEY',
'Content-Type': 'application/json',
'Idempotency-Key': 'products-2026-11-03-batch-001',
},
body: JSON.stringify({
website_id: 12,
items: [{
external_id: '1042',
sku: 'TENT-2P',
name: 'Trailhead 2 tent',
url: 'https://shop.example/trailhead-2-tent',
image_url: 'https://shop.example/media/trailhead-2.jpg',
status: 'enabled',
short_description: 'A two-person backpacking tent with a porch on each side.',
attributes: { colour: 'green', weight_kg: 2.1 },
category_external_ids: ['31'],
market_signals: [{
market_code: 'uk',
currency: 'GBP',
regular_price: 179.00,
special_price: 149.00,
in_stock: true,
salable_qty: 12,
availability: 'in_stock',
}],
}],
}),
});
const { ack_id } = await res.json(); // 202: keep ack_id to confirm the batch
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://ottla.ai/api/v1/']);
$response = $client->post('ingest/products', [
'headers' => [
'Authorization' => 'Bearer YOUR_SERVER_KEY',
'Idempotency-Key' => 'products-2026-11-03-batch-001',
],
'json' => [
'website_id' => 12,
'items' => [[
'external_id' => '1042',
'sku' => 'TENT-2P',
'name' => 'Trailhead 2 tent',
'url' => 'https://shop.example/trailhead-2-tent',
'image_url' => 'https://shop.example/media/trailhead-2.jpg',
'status' => 'enabled',
'short_description' => 'A two-person backpacking tent with a porch on each side.',
'attributes' => ['colour' => 'green', 'weight_kg' => 2.1],
'category_external_ids' => ['31'],
'market_signals' => [[
'market_code' => 'uk',
'currency' => 'GBP',
'regular_price' => 179.00,
'special_price' => 149.00,
'in_stock' => true,
'salable_qty' => 12,
'availability' => 'in_stock',
]],
]],
],
]);
$ackId = json_decode((string) $response->getBody(), true)['ack_id'];
| Field | Type | Notes |
|---|---|---|
market_code |
String | A short code you choose, such as uk. The first time you use one, it creates the market. |
currency |
String | A three-letter code, such as GBP |
regular_price |
Number | The normal price |
special_price |
Number or null | A sale price. Send null to end a sale. |
final_price |
Number | Optional: the price the shopper pays, if you work it out yourself |
in_stock |
Boolean | Whether the product can be bought now |
salable_qty |
Number or null | How many you can sell. Send null to clear it. |
availability |
String | in_stock, backorder or out_of_stock |
Map your platform’s fields
| On your platform | Ottla field |
|---|---|
| Product id | external_id (keep it stable: it is how updates and deletes find the product) |
| SKU | sku |
| Title and descriptions | name, short_description, description |
| Product page and main image | url, image_url |
| Enabled or disabled | status: enabled or disabled |
| Colour, size, material and other specifications | attributes, as an object of names and values |
| Categories | category_external_ids |
| Variants of one product | One item per variant, pointing at its parent with parent_external_id or parent_sku |
Attributes deserve the most care. Shoppers ask about dimensions, weight, materials, compatibility and care, so send the specifications you show on the product page, with names a person would recognise (“weight_kg”, not “attr_117”). If a fact is only in a PDF or a size guide, send that as a document and tie it to the product with sku.
Content and documents
/ingest/cms-pages, /ingest/faqs, /ingest/reviews and /ingest/blog-posts each take items[] with a title, body, url and external_id. Reviews are tied to their product by sku.
/ingest/documents takes one document per request: a title, a source_type (required), the text or a source_url, and optionally a sku. The source_type values are cms_page, faq, shipping_policy, returns_policy, warranty_policy, installation_guide, technical_specification, size_guide, promotion, pdf, manual, review, custom_document, blog_post and store_locator, or your own x:name (lower case, 2 to 48 characters after the prefix).
Tell Ottla which page is your delivery policy and which is your returns policy, with shipping_policy and returns_policy. Answers to “how much is delivery?” and “can I send it back?” depend on finding them.
# A CMS page, marked as your returns policy
curl https://ottla.ai/api/v1/ingest/cms-pages \
-H "Authorization: Bearer YOUR_SERVER_KEY" \
-H "Content-Type: application/json" \
-d '{
"website_id": 12,
"items": [{
"external_id": "page-returns",
"title": "Returns and refunds",
"url": "https://shop.example/returns",
"source_type": "returns_policy",
"body": "You can return unused items within 30 days of delivery for a full refund. Tents must be dry and packed in their bag."
}]
}'
# One document, tied to a product
curl https://ottla.ai/api/v1/ingest/documents \
-H "Authorization: Bearer YOUR_SERVER_KEY" \
-H "Content-Type: application/json" \
-d '{
"website_id": 12,
"title": "Trailhead 2 pitching guide",
"source_type": "manual",
"sku": "TENT-2P",
"text": "Peg out the four corners of the inner tent first, then clip the poles into place..."
}'
Remove what is gone
A product you delete or hide on your platform should leave Ottla too, or the assistant may still suggest it. Each delete call takes up to 1,000 ids.
curl https://ottla.ai/api/v1/ingest/products/deindex \
-H "Authorization: Bearer YOUR_SERVER_KEY" \
-H "Content-Type: application/json" \
-d '{"website_id": 12, "external_ids": ["1042"], "skus": ["JKT-001"]}'
curl https://ottla.ai/api/v1/ingest/categories/deindex \
-H "Authorization: Bearer YOUR_SERVER_KEY" \
-H "Content-Type: application/json" \
-d '{"website_id": 12, "external_ids": ["31"]}'
curl https://ottla.ai/api/v1/ingest/deindex \
-H "Authorization: Bearer YOUR_SERVER_KEY" \
-H "Content-Type: application/json" \
-d '{"website_id": 12, "source_type": "cms_page", "external_ids": ["page-old-sale"]}'
/ingest/products/deindex takes external_ids, skus or both. /ingest/deindex covers pages, FAQs, reviews, articles and documents, by source_type and external_ids.
Orders
Order history is what bought-together rows, best sellers and the “What you’ll need” kits learn from. Kits are rebuilt nightly from the orders you send. Send each order with its lines, totals in minor units (pence) and a customer_ref.
The customer_ref must be a pseudonymous reference, such as a salted hash of your customer id, never an email address or a name. Each order is stored once, so sending the same order again is safe.
curl https://ottla.ai/api/v1/ingest/orders \
-H "Authorization: Bearer YOUR_SERVER_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: orders-2026-11-03-001" \
-d '{
"website_id": 12,
"orders": [{
"order_id": "100004215",
"placed_at": "2026-10-20T18:42:10+00:00",
"total_minor": 15399,
"currency": "GBP",
"customer_ref": "db8d008151ad1fefc309309d8a758340b3e6f3f57f1193f650be004bdaead6b3",
"state": "complete",
"status": "complete",
"lines": [
{"sku": "TENT-2P", "qty": 1, "unit_price_minor": 14900},
{"sku": "PEG-SET", "qty": 1, "unit_price_minor": 499}
]
}]
}'
Confirm each batch
Send up to 100 ack_ids in one call. Acknowledgements are kept for 48 hours.
curl https://ottla.ai/api/v1/ingest/acks \
-H "Authorization: Bearer YOUR_SERVER_KEY" \
-H "Content-Type: application/json" \
-d '{"ack_ids": ["01JC3V7Q4M8T2X9K5R6N0B1D2E"]}'
// Node 18 or later: poll until every batch has settled
async function waitForAcks(ackIds) {
for (;;) {
const res = await fetch('https://ottla.ai/api/v1/ingest/acks', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_SERVER_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({ ack_ids: ackIds }),
});
const { acks } = await res.json();
if (acks.every((a) => a.status !== 'pending')) {
// A projected batch can still have failed items: resend these.
const failedIds = acks.flatMap((a) => a.failed_ids ?? []);
return { acks, failedIds };
}
await new Promise((resolve) => setTimeout(resolve, 15000));
}
}
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://ottla.ai/api/v1/']);
$response = $client->post('ingest/acks', [
'headers' => ['Authorization' => 'Bearer YOUR_SERVER_KEY'],
'json' => ['ack_ids' => ['01JC3V7Q4M8T2X9K5R6N0B1D2E']],
]);
$retry = [];
foreach (json_decode((string) $response->getBody(), true)['acks'] as $ack) {
// pending, projected, failed or unknown. A projected ack can still list failed items.
$retry = array_merge($retry, $ack['failed_ids'] ?? []);
}
// Fix and resend the items in $retry.
{
"acks": [
{
"ack_id": "01JC3V7Q4M8T2X9K5R6N0B1D2E",
"status": "projected",
"projected_at": "2026-10-21T10:16:42Z",
"processed": true,
"failed_items": 0,
"failed_ids": [],
"result": {
"stats": {"created": 498, "updated": 2, "skipped": 0, "skipped_over_limit": 0, "failed": 0}
}
}
]
}
| Status | Meaning |
|---|---|
pending |
Accepted and not finished yet. Ask again shortly. |
projected |
Processed and live, so the assistant can use it. Items in failed_ids, if any, weren’t written: resend them. |
failed |
Nothing could be written. failed_ids lists the items to fix and send again. |
unknown |
No such acknowledgement, or it is more than 48 hours old. |
When something goes wrong
| Response | What it means | What to do |
|---|---|---|
402 |
The account cannot accept syncs (for example, it is past due) | Stop syncing until billing is resolved, then carry on |
422 with errors |
Some fields are invalid. Errors are keyed by field, such as items.3.sku. |
Fix those items and send the batch again |
429 |
Over the key’s rate limit | Wait the number of seconds in retry_after, then retry |
| Over your knowledge item allowance | Not an error: new items are skipped and counted in the acknowledgement’s skipped_over_limit |
Existing items keep updating. Upgrade to add more. |
The errors page lists every code, and rate limits explains the 429 response.
Erase a shopper
When a customer deletes their account or makes a data subject request, ask Ottla to erase their data with POST /privacy/shopper-erasure. Give a reason (customer_deleted or data_subject_request) and at least one of customer_id, customer_refs (up to 20), email_sha256 (up to 20 SHA-256 hashes of the email address, 64 hex characters each) or visitor_ids (up to 100). Ottla answers 202 with a request_id. Erasure requests are never blocked by billing.
curl https://ottla.ai/api/v1/privacy/shopper-erasure \
-H "Authorization: Bearer YOUR_SERVER_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: erase-customer-5521" \
-d '{
"reason": "data_subject_request",
"customer_refs": ["db8d008151ad1fefc309309d8a758340b3e6f3f57f1193f650be004bdaead6b3"],
"email_sha256": ["cd25a6171969f2a3c6e35c7667e3908ef1bd2424241db04411a0eec454ca6c16"]
}'
How often to sync
For many stores, a sensible pattern is to schedule a full sync once your store is quiet each night, then feed changes through as they happen. You should be sending price changes and stock updates as often as every few minutes, because they’re the information shoppers ask about most frequently. Deletes are important too!
Give each batch its own Idempotency-Key, and reuse it when you retry that batch. If a retry reaches Ottla twice, it is applied once.
FAQ
Frequently asked questions
Where does the product price go?
In market_signals, with a market code and a currency. There is no top-level price field.
How do I end a sale price?
Send "special_price": null for that market. Leaving the field out keeps the old sale price.
How do I know a batch worked?
Poll /ingest/acks with the ack_id from the 202 response until its status is projected or failed. Then resend the items in failed_ids: a projected batch can list some too.
What happens when I reach my knowledge item allowance?
New items are skipped and counted in the acknowledgement result, and existing items keep updating. Upgrade your plan to add more. See pricing.
Can I send PDFs?
The API takes text or a source_url. To upload files, use Catalogue → Documents in the console, which takes PDF, Word (DOCX), CSV, text, Markdown, HTML and JSON.
Do I send customer names with orders?
No. Send a pseudonymous customer_ref, such as a salted hash of your customer id, and nothing that identifies the person.
Next
Ingestion API reference
Every ingestion endpoint and field.
Headless and custom storefronts
The order of work for the rest of your store.
Events API
Report orders and clicks for Analytics.
Preparing your catalogue for AI
What makes product data easy to answer from.