---
title: "Commerce API: send your store data to Kanal"
description: "Push your orders, abandoned checkouts, customers and shipments to Kanal from any store, without Shopify."
url: https://help.getkanal.com/en/articles/110-commerce-api-send-your-store-data-to-kanal
collection: "API"
updated: 2026-11-24
language: en
alternates: [fr-fr]
---

# Commerce API: send your store data to Kanal

Push your orders, abandoned checkouts, customers and shipments to Kanal from any store, without Shopify.

The Commerce API lets any store send its events to Kanal: orders, abandoned checkouts, customers and shipments. This data then feeds your WhatsApp automations, without going through Shopify.

Unlike the Messaging API, it does **not require an active subscription**. The full reference is on [developers.getkanal.com](https://developers.getkanal.com/docs/reference).

> **Info:** **Before you start.** For a non-Shopify store, create a custom store in **Settings > Stores** (click your team name, then **Settings**). It gives you your `store_id`, the number that follows `/stores/` in the cURL example of the **Guide** tab, and an ingestion key limited to that store, shown in full only once. See [Connect a non-Shopify store (custom store)](https://help.getkanal.com/en/articles/126-connect-a-non-shopify-store-custom-store.md).

Every URL starts with `https://api.getkanal.com/api/v1/stores/{store_id}/`.

## The principle: upsert

You do not need to know whether a record already exists in Kanal. You send the complete object, and Kanal creates or updates it. Each resource is identified by the `(store_id, external_id)` pair.

`external_id` is **your** identifier: order number, checkout token, customer ID. Send the same `external_id` again and Kanal updates the existing record instead of creating a duplicate.

-   `201 Created`: Kanal saw this `external_id` for the first time.
    
-   `200 OK`: an existing record was updated.
    

Both return the same JSON body: you can handle them the same way.

> **Info:** **Replays are safe.** Since writes are keyed on the natural key, replaying a failed or timed-out request never creates a duplicate. Be careful, though: a replayed `POST` on an order or a checkout can trigger the automations attached to that resource again.

## Orders

```text
POST /api/v1/stores/{store_id}/orders
```

Triggers your post-purchase automations. **Required** fields: `external_id` and `total_price`.

Optional fields:

-   `placed_at` (ISO 8601 format): without this field, Kanal uses the time the order was received.
    
-   `customer`: the customer object, with `phone`, `external_id`, `first_name`, `last_name`, `email`, `locale`, `tags`, `lifetime_value` and `orders_count`.
    
-   `currency`, `financial_status`, `fulfillment_status`, `line_items`, `tags`, `metadata`.
    

> **Warning:** **Without a phone number, nothing is triggered.** An order sent without `customer.phone` is saved, but it does not trigger any automation. Always send the customer's phone number if the order should lead to a message.

```bash
curl -X POST https://api.getkanal.com/api/v1/stores/123/orders \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "ORDER-1001",
    "placed_at": "2026-05-18T10:00:00Z",
    "total_price": 49.90,
    "currency": "EUR",
    "customer": { "phone": "+33612345678", "first_name": "Marie" }
  }'
```

An order does not create a customer record. To sync your customers' profiles (tags, lifetime value, order count), also send them through `POST /customers`.

To change only the status of an existing order, use `PATCH /orders/{external_id}`. Only `financial_status`, `fulfillment_status`, `tags` and `metadata` can be changed. An order that does not exist returns a 404 error.

```bash
curl -X PATCH https://api.getkanal.com/api/v1/stores/123/orders/ORDER-1001 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "financial_status": "paid" }'
```

## Abandoned checkouts

```text
POST /api/v1/stores/{store_id}/checkouts
```

Saves your abandoned checkouts in Kanal. **Required** fields: `external_id`, `abandoned_at`, `total_price` and the `customer` object with its `phone`.

Optional fields: `recovery_url`, `currency`, `line_items`, `tags`, `metadata`, as well as the other fields of the `customer` object (`external_id`, `first_name`, `last_name`, `email`, `locale`, `tags`).

The `recovery_url` field is recommended: it is the link that lets the customer resume their order.

```bash
curl -X POST https://api.getkanal.com/api/v1/stores/123/checkouts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "CHECKOUT-7700",
    "abandoned_at": "2026-05-18T09:40:00Z",
    "recovery_url": "https://shop.example.com/checkout/recover/7700",
    "total_price": 49.90,
    "currency": "EUR",
    "customer": { "phone": "+33612345678", "first_name": "Marie" }
  }'
```

> **Warning:** **Checkout reminders not available yet.** For a custom store, the checkouts you send are saved, but no abandoned checkout trigger is offered in automations yet: they do not trigger any message for now.

`PATCH /checkouts/{external_id}` lets you update the checkout status, with the values `active`, `abandoned`, `recovered`, `completed` or `expired`. It also accepts `recovery_url`, `tags` and `metadata`. Remember to set a checkout to `recovered` as soon as it converts, to keep your data up to date.

## Customers

```text
POST /api/v1/stores/{store_id}/customers
```

Syncs customer profiles, their tags and their lifetime value. Only `phone` is required. The natural key is `external_id`, but if you omit it, `phone` is used as the key. The `lifetime_value` and `orders_count` fields must be integers.

```bash
curl -X POST https://api.getkanal.com/api/v1/stores/123/customers \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "CUST-42",
    "phone": "+33612345678",
    "first_name": "Marie",
    "tags": ["vip"],
    "lifetime_value": 1299,
    "orders_count": 7
  }'
```

To honor a GDPR erasure request coming from your store, use `DELETE /customers/{external_id}`. The response is a `204` with no body. The call is idempotent: deleting a customer that is already deleted or unknown also returns 204.

## Shipments

```text
POST /api/v1/stores/{store_id}/shipments
```

Triggers your delivery notifications. **Required** fields: `external_id` and `order_external_id`, which links the shipment to the matching order.

Optional fields: `tracking_number`, `tracking_url`, `carrier`, `metadata`, and `status` among `pending`, `in_transit`, `delivered`, `failed` or `returned`.

> **Warning:** **Sending conditions.** No notification is sent if the shipment does not contain both `tracking_number` and `tracking_url`, if it has no `status`, or if the linked order is unknown to Kanal or has no contact. In these cases, the shipment is still saved, without an error.

```bash
curl -X POST https://api.getkanal.com/api/v1/stores/123/shipments \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "SHIP-9001",
    "order_external_id": "ORDER-1001",
    "tracking_number": "1Z999AA10123456784",
    "tracking_url": "https://track.example.com/1Z999AA10123456784",
    "carrier": "Colissimo",
    "status": "in_transit"
  }'
```

There is no `PATCH` for shipments: send a `POST` again with the same `external_id` to update the tracking or the status.

## Rate limits

The Commerce API is limited to **500 requests per minute per store**. This budget is shared across all the endpoints of the same store. If you exceed it, the API returns a `429` without a `Retry-After` header: the wait time is given in the response body, `retry_after: 60` (in seconds). `X-RateLimit-*` headers are present on every response so you can track your usage.

Three principles to stay under the limit: send a complete upsert rather than several partial `PATCH` calls, push your data when it changes instead of polling the API, and apply exponential backoff on 429 errors. If you expect sustained volume above 500 requests per minute, for example a historical import or a flash sale, let your Kanal contact know in advance to have the limit raised.

## Handling errors

Errors come in two forms. Problems detected before validation (key, store, limit) return a simple `error` string. Invalid payloads return a `422` with a `message` and an `errors` map detailed by field, in dot notation for nested objects. Example for a checkout sent without a phone number:

```json
{
  "message": "The customer.phone field is required.",
  "errors": {
    "customer.phone": ["The customer.phone field is required."]
  }
}
```

<table style="min-width: 75px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p><strong>Code</strong></p></th><th colspan="1" rowspan="1"><p><strong>Meaning</strong></p></th><th colspan="1" rowspan="1"><p><strong>Retry?</strong></p></th></tr><tr><td colspan="1" rowspan="1"><p><code>200 / 201</code></p></td><td colspan="1" rowspan="1"><p>Successful update or creation</p></td><td colspan="1" rowspan="1"><p>Not applicable</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>204</code></p></td><td colspan="1" rowspan="1"><p>Deletion done, no body</p></td><td colspan="1" rowspan="1"><p>Not applicable</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>400</code></p></td><td colspan="1" rowspan="1"><p>store_id parameter missing from the URL</p></td><td colspan="1" rowspan="1"><p>No</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>401 / 403</code></p></td><td colspan="1" rowspan="1"><p>Missing, invalid or unauthorized key</p></td><td colspan="1" rowspan="1"><p>No</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>404</code></p></td><td colspan="1" rowspan="1"><p>Unknown or paused store, or record not found</p></td><td colspan="1" rowspan="1"><p>No</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>422</code></p></td><td colspan="1" rowspan="1"><p>Validation failed: fix the payload</p></td><td colspan="1" rowspan="1"><p>No</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>429</code></p></td><td colspan="1" rowspan="1"><p>Rate limit exceeded</p></td><td colspan="1" rowspan="1"><p>Yes, after 60 seconds (<code>retry_after</code>)</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>5xx</code></p></td><td colspan="1" rowspan="1"><p>Temporary server error</p></td><td colspan="1" rowspan="1"><p>Yes, with exponential backoff</p></td></tr></tbody></table>
