---
title: "Using the CartGenie Public API"
description: "The Public API lets you read and write your store's data from your own systems — products, variants, inventory, orders, webhooks, and more!"
url: https://help.cartgenie.com/en/articles/236-using-the-cartgenie-public-api
collection: "Developers"
updated: 2026-11-06
language: en
---

# Using the CartGenie Public API

The Public API lets you read and write your store's data from your own systems — products, variants, inventory, orders, webhooks, and more!

**The Public API lets you read and write your store's data from your own systems — products, variants, inventory, orders, discounts, customers, and webhooks.** Use it to connect CartGenie to an ERP, a warehouse or 3PL, a point-of-sale system, a product feed, or an internal dashboard — anywhere you need to sync or automate store data.

**Because it's a standard REST API, you can also wire it up to an AI assistant and manage your store conversationally: "create this product," "update that price," "refund order #1028**," and the assistant makes the calls for you. For the full, always-current list of what you can do, see the live API reference.

**Full API reference:** [https://api.cartgenie.com/public-api-docs](https://api.cartgenie.com/public-api-docs)

[View CartGenie API Docs](https://api.cartgenie.com/public-api-docs)

A [Postman collection](https://api.cartgenie.com/public-api-docs.postman) and an [OpenAPI spec](https://api.cartgenie.com/public-api-docs.openapi) are also available from that page if you'd rather import the endpoints directly into your tooling.

* * *

## Creating an API token

1.  Go to [**Settings → API Tokens**](https://dash.cartgenie.com/settings/api-tokens) in your CartGenie dashboard.
    
2.  Enter a **name** for the token. Use something that identifies what it's for — `NetSuite inventory sync`, `ShipBob fulfillment`, `Internal reporting`. If you ever need to revoke access for one integration, the name is how you'll find it.
    
3.  Select the **scopes** the integration needs (see below). Grant only what it actually uses.
    
4.  Click **Create token**.
    
5.  **Copy the token and store it somewhere safe.** It's shown once and cannot be viewed again. If you lose it, you'll need to delete the token and create a new one.
    

> **Info:** **Store the token** in a password manager, a secrets manager, or your application's environment variables.

> **Error:** Do **NOT** paste it into a shared document, a support ticket, or client-side JavaScript — anyone holding the token has whatever access its scopes allow.

![](https://files.gleap.io/pf/gattachments/67487d32cd42deccd7727393-j98UBzPHK98lQvjrplpSKq8ngciE3h64dIthjCMY9VV1uuIEWrQwOnSQzgh5p2Fp6kkpoCQqv4r.png?v=1&k=a&s=api&e=1796212800&sig=sn3xJS8YJL92FmRsSqvJv9-mCi-sLaIV5zOWEfRW0pE)

### Revoking access

Deleting the token immediately ends access. Removing the team member who created it does the same thing, because a token inherits that member's store permissions as well as its own scopes. A request succeeds only when **both** the token's scope and the creating member's role allow it.

* * *

## AI Prompt Template

We’ve created a prompt you can use a template in any AI coder such as Claude Code, Cursor, Codex, etc.

[Get API Prompt for AI](https://help.cartgenie.com/en/articles/237-ai-prompt-for-cartgenie-api.md)

* * *

## What a token can access

Access is granted by area, the same way member permissions work. For each area you pick **View Only** or **Full Access** — View Only can read, Full Access can read and change. A token can never be given more than the member who created it already has.

<table data-id="1e768273-461c-4c01-8192-56e02256bb4a" 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 data-id="87859bad-c679-483c-a44f-b1e168b70e49">Area</p></th><th colspan="1" rowspan="1"><p data-id="db2c3123-30c1-4f81-b7da-d5033becd227">View Only</p></th><th colspan="1" rowspan="1"><p data-id="0e5bae6f-acd4-4c25-8671-d44ef0434bfb">Full Access also allows</p></th></tr><tr><td colspan="1" rowspan="1"><p data-id="8cec62b1-42f0-479b-920a-cbcac54614b6"><strong>Products</strong></p></td><td colspan="1" rowspan="1"><p data-id="0f0e0939-622c-491e-b514-2c56d021bb40">Read products, variants and categories</p></td><td colspan="1" rowspan="1"><p data-id="d30cb10d-d643-4386-a2c2-855aa654803c">Creating and updating products and variants, setting prices, inventory, images, options, bundles, subscriptions and digital downloads, and managing categories</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="5e4fa41f-eacb-4108-aac9-9c16fd12c545"><strong>Orders</strong></p></td><td colspan="1" rowspan="1"><p data-id="85d2d571-6725-4596-818c-f94f93c6a437">Read orders and their refunds</p></td><td colspan="1" rowspan="1"><p data-id="d518f2a7-e9ed-4db2-bd46-caf80a9faf4d">Fulfilling, adding tracking, cancelling, marking paid or unpaid, and issuing refunds</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="ca2bb52e-1c68-470f-a8d5-9c0049f02d8e"><strong>Customers</strong></p></td><td colspan="1" rowspan="1"><p data-id="285bc8c4-b0e1-44e5-b615-bd47a05d0129">Read customers and their order history</p></td><td colspan="1" rowspan="1"><p data-id="ec3afbbe-22fc-4766-87a9-c12af3be9c7d">Creating, updating and erasing customer records</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="aac7480c-80d8-4439-9f88-f93a589ef891"><strong>Discounts</strong></p></td><td colspan="1" rowspan="1"><p data-id="71ae4668-4ca2-4946-a371-0d4749fa5596">Read discounts and the codes issued against them</p></td><td colspan="1" rowspan="1"><p data-id="8716bf4e-978d-453f-8bb2-d761ab8adefb">Creating and updating discounts, and issuing or revoking individual codes</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="64348dec-8686-4619-8d64-3f2b2f55497f"><strong>Subscriptions</strong></p></td><td colspan="1" rowspan="1"><p data-id="2393092a-47b3-4e31-872a-1c1c35a8df25">Read subscriptions</p></td><td colspan="1" rowspan="1"><p data-id="5b8165d1-d6e5-4df6-9466-c78b18f93bb9">Read-only; subscriptions are managed in the dashboard</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="232ce65e-7801-4ba2-9128-fbe0be2b9b80"><strong>Settings</strong></p></td><td colspan="1" rowspan="1"><p data-id="3a4e4937-6172-4818-8027-d5f486694e7d">Read store details and webhook subscriptions</p></td><td colspan="1" rowspan="1"><p data-id="634f32f5-23be-40c8-801a-43d9dca77e77">Creating, updating and deleting webhook subscriptions</p></td></tr></tbody></table>

Most integrations span more than one area — a fulfillment tool needs Orders, a catalog sync needs Products, a loyalty tool issuing codes needs both Customers and Discounts. Grant the areas an integration uses and nothing more. A request that falls outside a token's access returns `403`, and the message names the scope it was missing.

Every endpoint in the [API reference](https://api.cartgenie.com/public-api-docs) states the exact scope it requires, so that's the place to check when you're deciding what a given integration needs.

* * *

## Authenticating

Every request needs an `Authorization` header:

```javascript
Authorization: Bearer YOUR_API_TOKEN
```

The base URL is `https://api.cartgenie.com`, and all endpoints live under `/public/v1/`.

### Check your connection

`GET /public/v1/store` is the quickest way to confirm everything is wired up. A `200` means the token is valid, the Public API is enabled for your store, and the token's owner still has access.

```bash
curl --request GET \
  "https://api.cartgenie.com/public/v1/store" \
  --header "Authorization: Bearer YOUR_API_TOKEN" \
  --header "Accept: application/json"
```

```json
{
  "name": "Example Store",
  "domain": "https://example.webflow.io",
  "currency": "usd",
  "timezone": "UTC",
  "created_at": "2025-11-02T08:31:00.000000Z"
}
```

* * *

## Examples of What You Can Build

### Sync inventory from an ERP, POS, or warehouse system

Keep CartGenie stock levels in step with an outside system of record.

Look up the variant by your own SKU, then set its stock level:

```bash
# 1. Resolve your SKU to a CartGenie variant
curl --get "https://api.cartgenie.com/public/v1/variants" \
  --data-urlencode "sku=TEE-BLK-M" \
  --header "Authorization: Bearer YOUR_API_TOKEN"

# 2. Set the new level
curl --request PUT \
  "https://api.cartgenie.com/public/v1/variants/2301/inventory" \
  --header "Authorization: Bearer YOUR_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{"stock": 120, "expected_stock": 118}'
```

Three things to know:

-   `stock` **is absolute, not an increment.** Sending `10` sets the level to 10; it doesn't add 10.
    
-   `expected_stock` **is optional but recommended.** It makes the write conditional — if the stored level no longer matches what you last read, the request fails with `409` and changes nothing. The error response includes `actual_stock`, so you can retry without an extra read. Without it, you risk overwriting a sale that landed between your read and your write.
    
-   **SKUs aren't unique within a store**, so `GET /variants?sku=` always returns an array. Match on the fields you need rather than assuming a single result.
    

The variant must be published and have inventory tracking enabled, or the write is rejected.

_Scopes: Read products + Write inventory_

### Connect a 3PL or warehouse for fulfillment

Pull orders that need shipping, then push tracking back when they go out.

```bash
# Fulfill an order and record the shipment in one call
curl --request POST \
  "https://api.cartgenie.com/public/v1/orders/1002/fulfill" \
  --header "Authorization: Bearer YOUR_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "shipping_carrier": "DHL",
    "tracking_number": "JD014600006281230542",
    "tracking_url": "https://www.dhl.com/track?id=JD014600006281230542",
    "send_notification": true
  }'
```

`send_notification: true` emails the customer that their order shipped. It defaults to `false`.

You can also add or replace tracking separately with `PATCH /orders/{orderName}/tracking`, return an order to unfulfilled with `POST .../unfulfill`, or cancel with `POST .../cancel`.

Note that **cancelling is a status change only.** It does not refund the payment, return stock to inventory, remove fulfillments, or cancel subscriptions created by the order. Handle those separately if your process needs them.

_Scopes: Read orders + Write orders_

### Mirror your catalog into a product feed or search index

Push your catalog to Google Merchant Center, a Meta catalog, an Algolia index, or a marketplace listing.

Do a full pull once, then poll incrementally with `updated_since`:

```bash
curl --get "https://api.cartgenie.com/public/v1/products" \
  --data-urlencode "updated_since=2026-08-01T00:00:00Z" \
  --data-urlencode "limit=100" \
  --header "Authorization: Bearer YOUR_API_TOKEN"
```

The incremental feed reports removals as well as changes. **Read** `deleted_at` **before any other field** — a record carrying one should be dropped from your copy, whatever its status. Removed products may arrive in either of two shapes: an archived product keeps its full structure, while a permanently deleted one collapses to just `id`, `name`, `slug`, `status`, `deleted_at`, and `updated_at`. Code that reaches straight for `price` or `variants` will break on the second shape.

Because a permanent removal isn't guaranteed to reach the feed, reconcile against a full listing on a schedule — weekly is usually enough.

_Scopes: Read products_

### Build an internal dashboard or reporting feed

Pull orders into a spreadsheet, a BI tool, or an accounting system.

```bash
curl --get "https://api.cartgenie.com/public/v1/orders" \
  --data-urlencode "updated_since=2026-08-01T00:00:00Z" \
  --header "Authorization: Bearer YOUR_API_TOKEN"
```

Orders are never deleted, so a cancelled order shows up as a status change rather than a disappearance. Money values are returned in the smallest currency unit — `4900` is $49.00 — alongside pre-formatted `formatted_*` strings if you'd rather display those directly.

Some fields are only as complete as the order is. `shipment` is an object on orders with shippable items and an empty array on digital-only orders. A `refunds` array appears only when the payment status is `refunded` or `partially_refunded` — treat its absence as "nothing refunded" rather than an error. `payment.method` and `transaction_id` are `null` until the gateway records them.

_Scopes: Read orders_

### React to store events in real time with webhooks

Instead of polling, have CartGenie call your endpoint when something happens.

```bash
curl --request POST \
  "https://api.cartgenie.com/public/v1/webhooks" \
  --header "Authorization: Bearer YOUR_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "Order sync",
    "url": "https://example.com/hooks/cartgenie",
    "events": ["new_order", "order_updated"]
  }'
```

Available events include `new_order`, `order_updated`, `order_fulfillment_updated`, `new_customer`, `customer_updated`, `new_subscription`, `subscription_updated`, `new_subscription_charge`, `new_discount`, `discount_updated`, `new_category`, `category_updated`, `new_product`, `product_updated`, `new_abandoned_cart`, `refund_issued`, and `inventory_updated`.

Your endpoint must be publicly reachable over HTTPS — private and loopback addresses are rejected.

**Verify every delivery.** The request body arrives as `{"type": "<event>", "payload": { ... }}` with a `Signature` header containing an HMAC-SHA256 of the raw JSON body, keyed with your store's webhook secret from **Settings → Webhooks**. Compute the same digest over the body you received and compare before trusting it. Always hash the raw body exactly as received — re-serializing the JSON first will produce a different digest and your check will fail.

Deliveries are attempted up to 3 times with exponential backoff and a 10-second timeout, so your endpoint should respond quickly and be safe to receive the same event twice.

Once your subscription exists, `POST /webhooks/{id}/test` queues a single delivery carrying sample data. Use it to verify your endpoint and signature check before real traffic arrives.

_Scopes: Write webhooks (plus Read webhooks to list or inspect them)_

* * *

## Working with the API

### Pagination

List endpoints are cursor-paginated. Pass `limit` (1–250, default 50) and read `meta.next_cursor` from the response, then send that value back as `cursor` for the next page. When `meta.has_more` is `false`, you've reached the end.

Cursors are opaque — don't build or modify them.

### Keeping data in sync

`products`, `variants`, and `orders` all accept `updated_since` as an ISO-8601 timestamp. Combined with pagination, this gives you an incremental feed of everything that changed since your last poll. Store the timestamp of each successful run and use it as the starting point for the next one.

### Rate limits

120 requests per minute and 4 per second, per token. Every response carries `X-RateLimit-Limit` and `X-RateLimit-Remaining`. Exceeding either limit returns `429` — back off and retry rather than hammering.

If you're syncing a large catalog, raising `limit` toward 250 will move more records per request and keep you well inside the limit.

### Errors

Failures return a JSON body with a `message` field.

Code

Meaning

<table data-id="e30b2124-dfe0-4961-b49d-07e9b095bebb" style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1"><p data-id="75344df8-7101-4ce7-a81a-1a65f3728dde"><code>401</code></p></td><td colspan="1" rowspan="1"><p data-id="b9601d5b-1b4c-4a44-9637-50e6d02d5627">Token is missing or invalid</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="26553f94-0594-4377-b01c-1253366143ff"><code>403</code></p></td><td colspan="1" rowspan="1"><p data-id="ccbe0bb3-64e4-44ba-9c64-16d9915e0d95">The token, or the member who created it, lacks the required scope or permission</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="b0d6dfcc-815e-43c5-97fc-b19997d772cd"><code>404</code></p></td><td colspan="1" rowspan="1"><p data-id="ee5f8e31-438c-464a-bc5d-92a4f6fc63b9">The record doesn't exist, or the Public API isn't enabled for your store</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="03a0bf2c-fe66-4d31-8955-bf5384fe77c5"><code>409</code></p></td><td colspan="1" rowspan="1"><p data-id="a58c04c4-e77a-4a47-ae56-2a2746c905f4">Conflicts with current state — a stale <code>expected_stock</code>, or an order status that doesn't allow the action</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="5bea1e69-9744-469a-a8ae-5b9bb134f1d4"><code>422</code></p></td><td colspan="1" rowspan="1"><p data-id="f4860660-2e7e-46d7-8ed1-9952ccbb26dd">Validation failed; details are in an <code>errors</code> object</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="a28ec99d-fcc2-43b1-8316-99854eb0be68"><code>429</code></p></td><td colspan="1" rowspan="1"><p data-id="b2a3e54c-c250-4600-a66c-40c1e325874d">Rate limit exceeded</p></td></tr></tbody></table>

**Requests are validated strictly.** Any parameter an endpoint doesn't define is rejected with a `422` rather than ignored, so send only the documented fields. Reading a record, changing one value, and posting the whole object back will fail — build your request body from scratch with just the fields you're changing.

* * *

## Getting help

The [full API reference](https://api.cartgenie.com/public-api-docs) has complete request and response examples for every endpoint in `bash`, `JavaScript`, and `PHP`. If something isn't behaving the way this guide describes, reach out to support with the endpoint, the request you sent, and the response you got back.
