---
title: "Replace AI-referred store orders for a window"
method: PUT
path: "/ai_orders"
tags: ["Store Integrations"]
---

# Replace AI-referred store orders for a window

`PUT /ai_orders`

## Request

- Base URL: `https://api.llmpulse.ai/api/v1`
- URL: `https://api.llmpulse.ai/api/v1/ai_orders`
- Auth: API key in header `Authorization`

Replaces the daily AI-referred orders and revenue of the from..to window. Send the raw referring host or utm_source of each order's first visit as referrer: LLM Pulse classifies it and ignores anything that is not an AI assistant. Entries for the same day and assistant are summed. Every stored row of that project and platform inside the window is replaced, so pushing the same window again converges instead of counting twice. Rows are kept per project and platform, not per store, so one store reports per project. A pitch project takes no store data: pushing orders to one returns ERR_INVALID_PARAM. Requires a `read_write` scope API key and, for team members, update access to AI Traffic. Not available to accounts with a white-label portal or an embed (ERR_INTEGRATION_UNAVAILABLE).

## Request body

- AiOrdersUpdateRequest
  - `project_id` integer, required
  - `platform` 'shopify', required
  - `currency` string, required: ISO 4217 code, e.g. EUR
  - `from` string, date, required: First day of the window this push replaces
  - `to` string, date, required: Last day of the window; at most 400 days after from
  - `days` object[], required
    - `day` string, date, required: Must fall inside from..to
    - `referrer` string, required: Raw referring host or utm_source of the order's first visit, e.g. chatgpt.com. Entries that are not an AI assistant are ignored
    - `orders` integer, required
    - `revenue` string, required: Non-negative decimal amount in currency, e.g. 120.50. A JSON number is accepted too

## Response `200`

Rows stored and entries ignored

- AiOrdersUpdateResponse
  - `project_id` integer, required
  - `platform` string, required
  - `stored` integer, required: Rows stored, one per day and AI assistant
  - `ignored` integer, required: Entries whose referrer is not an AI assistant
  - `request_id` string, required

## Other responses

- `403`: The account has a white-label portal or an embed, so store integrations are not available (ERR_INTEGRATION_UNAVAILABLE). Writes with a read-only key answer ERR_INSUFFICIENT_SCOPE, and a team member without the permission ERR_INSUFFICIENT_PERMISSION, with the same status
- `404`: Resource not found
- `422`: Invalid parameters

## Changes

- **2026-10-04** `8698fcf9df22`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/llmpulse/apis/llm-pulse-api/changes/ai_orders/put.md)

---

[API](https://skmtc.dev/llmpulse/apis/llm-pulse-api.md) - [All operations](https://skmtc.dev/llmpulse/apis/llm-pulse-api/llms.txt) - [OpenAPI document](https://skmtc.dev/llmpulse/apis/llm-pulse-api/revisions/38a31f123641?raw)
