# Pawdo Integration API — orders: reference for AI assistants

This file is the part of the Pawdo Integration API, version `2026-11-24`, that a seller system uses to push
lastmile orders and follow them: the developer guide (sections 1–7), then every route's parameters, answers and
recorded examples (8), every data type as TypeScript (9), the webhook events (10), and what changed since the previous
Postman collection (11). It is self-contained: nothing outside it is needed to write a client for these routes.

Facts to keep in mind while reading it:

- **Base URL** — `{base_url}` is `https://stag-api.pawdo.com` on test and `https://next-api.pawdo.com` in production
  ([Base URL](#base-url)). Every route is under `/api/integration` and ends in `.json`.
- **Auth** — header `X-pawdo-access-token: <token>` on every request, no `Bearer`. A token acts on its own store only.
- **Routes** — the 9 routes of section 8 are all this file covers. Do not call or guess a route it does not describe.
- **Envelope** — `{status, message, data, total}`; `GET /store/info.json` answers `{status, store}` and
  `GET /order.json` answers `{status, message, orders, total}`.
- **Errors** — decide by the HTTP status and `error_code`, never by `message`. 409 and 422 must not be retried as is.
- **Ids** — UUID strings.
- **Rate limit** — 800 requests per minute per store; on 429 wait `Retry-After` seconds.
- **Dates** — timestamps are RFC 3339 in UTC; date filters take RFC 3339 with a time and a zone.
- **Compatibility** — ignore response fields you do not know; Pawdo ignores body fields it does not know.
- **Webhooks** — signed with HMAC-SHA256; branch on `X-NextFF-Event`; deliveries are not in order and can repeat; the
  order event carries no state: read the order.
- **Existing integrations** — code written from the previous Postman collection must apply section 11.

---

This guide is for developers connecting a system to Pawdo on behalf of a seller store. With it you can:

- push lastmile orders, follow them to delivery, change or cancel them;
- hold an order for customer service, release it, or cancel it at any stage before shipping;
- receive **webhooks** when one of your orders changes.

Sections 8–10 at the end of this file give every route's parameters, the exact type of every request and response
body with recorded examples, and the webhook events. If your integration was written from the previous Postman
collection, [section 11](#11-changes-from-the-previous-postman-collection) lists what changed.

All examples below are real requests and responses from a Pawdo test environment. Identifiers were anonymized,
long lists shortened, and fields outside this contract left out.

## Contents

1. [Getting started](#1-getting-started)
2. [Conventions](#2-conventions) — envelope, errors, pagination, dates, rate limit, retries
3. [Store](#3-store)
4. [Orders](#4-orders)
5. [Order holds and cancel-ship](#5-order-holds-and-cancel-ship)
6. [Webhooks](#6-webhooks)
7. [Error code index](#7-error-code-index)
8. [Endpoint reference](#8-endpoint-reference) — every route's parameters, body types, answers and examples
9. [Data types](#9-data-types) — every object, as TypeScript
10. [Webhook events](#10-webhook-events)
11. [Changes from the previous Postman collection](#11-changes-from-the-previous-postman-collection)

---

## 1. Getting started

### Base URL

Every path in this guide is relative to `{base_url}`, the Pawdo API host of the environment you call. All routes
live under `/api/integration` and end in `.json`.

| Environment | `{base_url}` | Seller app |
|---|---|---|
| Test | `https://stag-api.pawdo.com` | https://stag.pawdo.com |
| Production | `https://next-api.pawdo.com` | https://next.pawdo.com |

For example, on test: `https://stag-api.pawdo.com/api/integration/store/info.json`. Create the token and the
webhooks in the seller app of the environment you call, and try your integration on test before you switch it to
production.

### Get an access token

1. Ask Pawdo to enable **API access** for your store.
2. In the Pawdo seller app, open **Integrations → API** and click **Create token**. Give it a name (one token per
   integration, so you can revoke them one by one) and an expiration: never, 30 / 60 / 90 days, 1 year, or a date.
3. Copy the token (`pdat_…`). **It is shown once.** Store it as a secret, on your server only.

A store can have up to 20 active tokens. Deactivating or revoking a token in the seller app takes effect
immediately. A token gives access to its own store, and nothing else: every route below reads and writes that
store's data only.

### Send it

Put the token, as is, in the `X-pawdo-access-token` header of every request (no `Bearer`):

```bash
curl "{base_url}/api/integration/store/info.json" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN"
```

```json
{
  "status": true,
  "store": {
    "id": "20d02210-e9b2-4238-93b2-829fa0878199",
    "name": "Store 964",
    "status": "active",
    "user_id": "a63d7f14-7728-4b4b-8570-6f42a2a6ccb4",
    "phone": "+15556973964",
    "support_email": "store73964@example.test",
    "currency": "USD",
    "fulfillment_type": "pod",
    "allow_public_api": true,
    "allow_pick_stock": true,
    "allow_pack_return": true,
    "created_at": "2026-05-04T02:28:21.43319Z",
    "updated_at": "2026-05-27T02:30:30.324044Z",
    "admin": {
      "id": "a63d7f14-7728-4b4b-8570-6f42a2a6ccb4",
      "name": "Seller 609",
      "email": "seller68609@example.test",
      "phone": "+15552468609",
      "status": "active"
    }
  }
}
```

When the token is wrong, the answer is HTTP 401:

| Situation | `message` |
|---|---|
| No header | `missing access token` |
| Unknown token | `token contains an invalid number of segments` |
| Token deactivated in the seller app | `access token is not active` |
| Token past its expiration | `access token has expired` |

A 401 does not go away by retrying: create a new token. HTTP 403 means API access is not enabled for the store
(ask Pawdo); rely on the status code there, its body is not stable yet.

---

## 2. Conventions

### Requests

Bodies are JSON, with `Content-Type: application/json`. Orders, their line items and holds have UUID
ids. Unknown body fields are ignored.

### Response envelope

```json
{"status": true, "message": "ok", "data": { … }, "total": 42}
```

| Key | |
|---|---|
| `status` | `true` on success, `false` on a refusal. Always check it — together with the HTTP status. |
| `message` | Human-readable. Do not parse it; branch on the HTTP status and `error_code`. |
| `data` | The payload. |
| `total` | On lists: the number of rows across all pages. |
| `error_code` | On refusals of the routes that have one — see the [index](#7-error-code-index). |
| `error` | On some 400 answers: extra detail about what could not be read. |

Two older routes answer in their own shape: `GET /store/info.json` puts the store under `store`, and
`GET /order.json` puts the rows under `orders`.

Responses may contain fields this guide does not describe. **Ignore them**: they are not part of the contract and
may change. Fields that have no value yet are `null` (dates) or `""` (text).

### HTTP status codes

| HTTP | Meaning | What to do |
|---|---|---|
| 200 | Done. | |
| 400 | The request could not be read: not JSON, a field of the wrong type, a required field missing (on older routes). | Fix the request. |
| 401 | Token missing, unknown, deactivated or expired; or the store is deactivated. | Use a valid token. |
| 403 | API access not enabled for the store. | Ask Pawdo. |
| 404 | The id is not one of your store's (another store's id is "not found" too). | Check the id. |
| 409 | The request conflicts with the current state: duplicate order number, order not created through the API, order already in production / shipped. | Read the state (often in `data`) and decide. Do not retry as is. |
| 422 | The request is well-formed but breaks a rule; `message` says which. | Fix the data. Do not retry as is. |
| 429 | Rate limit. | Wait `Retry-After` seconds. |
| 500 | Failed on Pawdo's side. | Retry with backoff; contact Pawdo if it persists. |
| 503 | A service Pawdo depends on did not answer (address verification). Nothing was saved. | Retry later. |

### Pagination

Lists take `page` (from 1) and `limit`, and return `total` — the row count across all pages. A `limit` above the maximum is cut
to it:

| Route | Default `limit` | Max |
|---|---|---|
| `GET /order.json` | 10 | 1000 |

All lists are newest first. Read pages until `page × limit ≥ total`.

### Dates

- **Timestamps** are RFC 3339 in UTC: `2026-11-10T11:55:34.71384Z`. The number of fractional digits varies — use
  an RFC 3339 parser, not a fixed format.
- **Date filters** in query strings take RFC 3339 with a time and a zone (`2026-11-01T00:00:00Z`), and a range
  needs both ends. A date without time (`2026-11-01`) is not rejected: the list comes back empty.
- Request bodies that take a time (`until` on holds) take RFC 3339.

### Rate limit

800 requests per minute **per store**, shared by all of the store's tokens, over a sliding window. Every answer
carries:

| Header | |
|---|---|
| `X-RateLimit-Limit` | 800 |
| `X-RateLimit-Remaining` | Requests left in the window |
| `X-RateLimit-Reset` | Seconds until the window resets |

Over the limit: HTTP 429, a `Retry-After` header in seconds, and

```json
{
  "message": "request rate limited",
  "status": false
}
```

### Retries and duplicates

| Call | Safe to resend? |
|---|---|
| Any `GET` | Yes. |
| `POST /orders.json` | Yes: `order_number` is unique per store. A 409 `order existed` after a timeout means the first call landed — fetch it with `GET /orders/query.json?order_name=…`. |
| `POST /orders/hold.json`, `/release.json`, `/cancel-ship.json` | Yes: a repeat answers `already_held` / `already_released` / `already_cancelled` and never refunds twice. A 500 rolled everything back. |
| `PATCH /orders/{id}.json` | Yes, it sets values. |
| `PATCH /orders/cancel.json` | A repeat changes nothing more; it answers 422 (`order has already been cancelled`), or 500 when the lines it names are already cancelled. |

---

## 3. Store

### `GET /api/integration/store/info.json`

The token's store and its owner — the example is in [Send it](#send-it). Use it to check a token. The key is
`store`, not `data`.

---

## 4. Orders

An order goes through these `fulfillment_status` values:

| Status | Meaning |
|---|---|
| `unfulfilled` | New; Pawdo is validating SKUs, artwork and address. |
| `on_hold` | Held (see [section 5](#5-order-holds-and-cancel-ship)). |
| `ready` | Valid and priced; waiting for the store's next payment run. |
| `payment_awaiting` | Waiting for enough balance. |
| `paid` → `pending` → `awaiting` → `processing` | Charged, being sent to production, sent, in production. |
| `ship-out` → `delivered` | Handed to the carrier, delivered. Also `pickup` (waiting at a carrier office), `exception` (carrier problem). |
| `cancel`, `cancel-produce`, `cancel-ship`, `cancel-shipout` | Cancelled before production / during production / after production, not shipped / after shipping (by Pawdo). |
| `error` | Could not be sent to production. |

Alongside it: `design_status` (`incompleted` while artwork is checked, `completed`, `missing`, `invalid_dim`,
`error`), `validate_address` (`pending`, `valid`, `invalid`, `exception`) with `address_validate_message`, and per
line `status` (`pending` while being validated, `open`, `invalid_sku`, `design_error`, `cancel`).

### Create an order — `POST /api/integration/orders.json`

| Field | | |
|---|---|---|
| `order_number` | **required** | Your order number. Unique in the store, across all sources (API, CSV, Shopify…). |
| `address` | **required** | The buyer. Required inside: `name`, `option_ship`, `address1`, `province_code`, `country_code`, `postal_code`. Also `address2`, `city`, `state`, `country`, `email`, `phone`, `tax_number`, `label_ship` (URL of your own label). |
| `address.option_ship` | **required** | Shipping option code, e.g. `standard`, `express`. Ask Pawdo which are enabled for you. |
| `line_items` | **required**, 1–500 | See below. |
| `order_note` | | |
| `skip_verify_address` | | `true`: the address is not verified and counts as valid. |
| `external_transaction_id` | | Your payment reference. |

Each line item:

| Field | | |
|---|---|---|
| `system_sku` | **required** | The Pawdo SKU (a variant, an alias, or a combo). |
| `quantity` | **required** | 1–999. |
| `designs` | | `[{key, design, mockup}]`, `key` being the print area (`design1`, `design2`, …). The older flat form `design1`…`design15` / `mockup1`…`mockup15` is still accepted when `designs` is absent. |
| `sku` | | Your own SKU. |
| `title` | | Default: catalog name and variant title. |
| `note`, `tags` (unique strings), `external_line_item_id`, `brand_code`, `ring_code` | | |
| `option1`, `option2`, `option3` | | Override the variant's options. `option2` / `option3` are taken only when `option1` is sent too. |

```bash
curl -X POST "{base_url}/api/integration/orders.json" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order_number": "DOCS-185527-A", "order_note": "first API order", "address": {"name": "Jane Doe", "option_ship": "standard", "address1": "1600 Amphitheatre Pkwy", "address2": "", "city": "Mountain View", "state": "California", "province_code": "CA", "country": "United States", "country_code": "US", "postal_code": "94043", "email": "jane@example.com", "phone": "+1 650-253-0000"}, "line_items": [{"sku": "MY-SHOP-TEE-1", "system_sku": "QTN-S", "quantity": 1, "title": "Custom tee", "note": "gift wrap", "designs": [{"key": "design1", "design": "https://example.com/art/front.png", "mockup": "https://example.com/art/front-mockup.png"}]}]}'
```

```json
{
  "data": {
    "order_id": "f4a795d5-8c5b-4c33-a987-b5640f87857b"
  },
  "message": "ok",
  "status": true
}
```

Pawdo answers at once and validates the order in the background (a few seconds). Read the outcome with
[`GET /orders/query.json`](#get-one-order--get-apiintegrationordersqueryjson). A valid order becomes `ready` and is
charged on the store's payment schedule.

| HTTP | `message` | When |
|---|---|---|
| 400 | `bad request`, detail in `error` | A required field is missing, e.g. `validation failed: line_items must contain more than 0 items, country_code is a required field, postal_code is a required field` |
| 400 | `bad request`, detail in `error` | The body is not JSON |
| 400 | `unsupported shipping option` | `option_ship` is not a shipping option |
| 409 | `order existed` | The store already has this `order_number` |
| 422 | `invalid system sku: NOPE-SKU` | A `system_sku` is not a SKU you can order |

### Get one order — `GET /api/integration/orders/query.json`

Any order of the store, of any source. Pass `id` (Pawdo's) or `order_name` (your `order_number`, exactly as
stored — `#1001` and `1001` differ; if several orders share a number one of them is returned, so prefer `id`).

The answer has the order, its `line_items`, and per line the `item_fulfills` — one per unit in production, with
`tracking_code` and `shipping_carrier` once shipped (`handoff_tracking_code` when the warehouse hands the parcel to
a lastmile carrier). It also has `cs_hold`, explained in [section 5](#5-order-holds-and-cancel-ship).

```bash
curl -X GET "{base_url}/api/integration/orders/query.json?id=831272e2-b1fe-47f9-bfe6-c5a97fadc9a2" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN"
```

A validated order, waiting for the charge:

```json
{
  "data": {
    "id": "831272e2-b1fe-47f9-bfe6-c5a97fadc9a2",
    "created_at": "2026-11-10T12:06:45.059776Z",
    "updated_at": "2026-11-10T12:06:51.765792Z",
    "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
    "external_order_id": "",
    "shipping_address": {
      "city": "Mountain View",
      "name": "Jane Doe",
      "email": "jane@example.com",
      "phone": "+1 650-253-0000",
      "state": "California",
      "country": "United States",
      "address1": "1600 Amphitheatre Pkwy",
      "address2": "",
      "label_ship": "",
      "tax_number": "",
      "option_ship": "standard",
      "postal_code": "94043",
      "country_code": "US",
      "province_code": "CA"
    },
    "order_number": "DOCS-190644-V2",
    "is_have_ticket": false,
    "design_status": "completed",
    "validate_address": "valid",
    "fulfillment_status": "ready",
    "tracking_status": "incompleted",
    "skip_verify_address": true,
    "fulfillment_cost": 10,
    "note": "",
    "processed_at": "2026-11-10T12:06:45.059604Z",
    "address_validate_message": "",
    "design_validate_message": "",
    "order_code": "PD290-9324",
    "source_type": "api",
    "fulfillment_type": "pod",
    "fulfillment_shipping": 0,
    "base_cost": 10,
    "external_transaction_id": "",
    "line_items": [
      {
        "id": "2b5a6951-5ca2-4cd6-8f90-d57a0d191e2e",
        "created_at": "2026-11-10T12:06:45.06056Z",
        "updated_at": "2026-11-10T12:06:51.770398Z",
        "order_id": "831272e2-b1fe-47f9-bfe6-c5a97fadc9a2",
        "external_line_item_id": "",
        "designs": null,
        "title": "Insert pillow - ",
        "sku": "MY-GP-L1",
        "system_sku": "GP-L1",
        "quantity": 1,
        "tags": [],
        "option1": "GP-L1",
        "option2": "",
        "option3": "",
        "cancelled_at": null,
        "status": "open",
        "total_basecost": 10,
        "system_message": "",
        "note": "",
        "external_transaction_id": ""
      }
    ],
    "cs_hold": {
      "stage": "pre_production",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": null
    }
  },
  "message": "ok",
  "status": true
}
```

When validation fails the order stays `unfulfilled`: `design_status` / `validate_address` and their
`*_validate_message` say what is wrong, and the failing line has `status` `design_error` or `invalid_sku` with the
reason in `system_message` — here an artwork that was required but not sent:

```json
{
  "data": {
    "id": "edc52990-7864-4212-83a9-40a35624ef8c",
    "created_at": "2026-11-10T12:06:45.016587Z",
    "updated_at": "2026-11-10T12:06:49.685647Z",
    "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
    "external_order_id": "",
    "shipping_address": {
      "city": "Mountain View",
      "name": "Jane Doe",
      "email": "jane@example.com",
      "phone": "+1 650-253-0000",
      "state": "California",
      "country": "United States",
      "address1": "1600 Amphitheatre Pkwy",
      "address2": "",
      "label_ship": "",
      "tax_number": "",
      "option_ship": "standard",
      "postal_code": "94043",
      "country_code": "US",
      "province_code": "CA"
    },
    "order_number": "DOCS-190644-V0",
    "is_have_ticket": false,
    "design_status": "missing",
    "validate_address": "valid",
    "fulfillment_status": "unfulfilled",
    "tracking_status": "incompleted",
    "skip_verify_address": true,
    "fulfillment_cost": 0,
    "note": "",
    "processed_at": "2026-11-10T12:06:45.01587Z",
    "address_validate_message": "",
    "design_validate_message": "order is missing artwork",
    "order_code": "PD290-9322",
    "source_type": "api",
    "fulfillment_type": "pod",
    "fulfillment_shipping": 0,
    "base_cost": 0,
    "external_transaction_id": "",
    "line_items": [
      {
        "id": "69fc5025-46e5-4319-9dcb-f906fc6ea2b5",
        "created_at": "2026-11-10T12:06:45.020969Z",
        "updated_at": "2026-11-10T12:06:49.688686Z",
        "order_id": "edc52990-7864-4212-83a9-40a35624ef8c",
        "external_line_item_id": "",
        "designs": null,
        "title": "Quilted Tote Bag new - Thin Short",
        "sku": "MY-QTN-S",
        "system_sku": "QTN-S",
        "quantity": 1,
        "tags": [],
        "option1": "Thin Short",
        "option2": "",
        "option3": "",
        "cancelled_at": null,
        "status": "design_error",
        "system_message": "item artwork validation failed: (Preview #1) empty url on required field",
        "note": "",
        "external_transaction_id": ""
      }
    ],
    "cs_hold": {
      "stage": "pre_production",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": null
    }
  },
  "message": "ok",
  "status": true
}
```

Fix it with [`PATCH /orders/{id}.json`](#update-an-order--patch-apiintegrationordersidjson) (API orders) or in the
seller app; Pawdo validates again.

A shipped order — tracking on each item:

```json
{
  "data": {
    "id": "5e365b1d-16c0-4335-90a3-eb38024241a5",
    "created_at": "2026-06-15T03:28:51.77728Z",
    "updated_at": "2026-06-16T06:36:51.743075Z",
    "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
    "external_order_id": "",
    "shipping_address": {
      "tax": 0,
      "city": "Menifee",
      "name": "Customer 127",
      "email": "c88127@example.test",
      "phone": "+15552188127",
      "state": "California",
      "country": "US",
      "address1": "3568 Example St",
      "address2": "",
      "label_ship": "",
      "option_ship": "standard",
      "postal_code": "92584",
      "country_code": "US",
      "province_code": "CA"
    },
    "order_number": "#1001",
    "is_have_ticket": false,
    "design_status": "completed",
    "validate_address": "valid",
    "fulfillment_status": "ship-out",
    "tracking_status": "completed",
    "skip_verify_address": true,
    "fulfillment_cost": 10,
    "note": "",
    "processed_at": "2026-06-15T03:26:41.469324Z",
    "production_at": "2026-06-15T08:20:18.979967Z",
    "fulfillment_cost_paid": "2026-06-15T04:38:58.942204Z",
    "shipped_at": "2026-06-16T06:36:45.676743Z",
    "address_validate_message": "address not found",
    "design_validate_message": "",
    "order_code": "PD290-8958",
    "source_type": "csv",
    "fulfillment_type": "pod",
    "fulfillment_shipping": 0,
    "base_cost": 10,
    "external_transaction_id": "",
    "line_items": [
      {
        "id": "6297fc4f-5923-4df4-80d0-ec8b7ae65fbc",
        "created_at": "2026-06-15T03:28:51.78041Z",
        "updated_at": "2026-06-15T04:39:12.996291Z",
        "order_id": "5e365b1d-16c0-4335-90a3-eb38024241a5",
        "external_line_item_id": "13012345678901",
        "designs": [
          {
            "key": "design1",
            "design": "https://example.com/files/b69d89fc89.png",
            "mockup": "https://example.com/files/1399ecdb8d.jpg"
          }
        ],
        "title": "Tumbler 40oz - Black",
        "sku": "",
        "system_sku": "THF-B14",
        "quantity": 1,
        "tags": [],
        "option1": "",
        "option2": "",
        "option3": "",
        "cancelled_at": null,
        "status": "open",
        "total_basecost": 10,
        "system_message": "",
        "note": "",
        "external_transaction_id": "TXN-1001",
        "item_fulfills": [
          {
            "id": "6e694dfd-91da-4073-8974-7bf58fc65121",
            "created_at": "2026-06-15T04:38:59.137722Z",
            "updated_at": "2026-06-16T06:36:46.817621Z",
            "variant_code": "THF-B14",
            "shipping_carrier": "JCW",
            "quantity": 1,
            "status": "ship-out",
            "cancel_at": null,
            "production_at": "2026-06-15T08:20:18.979967Z",
            "shipped_at": "2026-06-16T06:36:45.676743Z",
            "cancel_status": "cannot-cancel",
            "tracking_code": "JCW10000095619",
            "note": "Tumbler with Handle 40 oz 3D Black - 14",
            "handoff_tracking_code": "",
            "handoff_shipping_carrier": ""
          }
        ]
      }
    ],
    "cs_hold": {
      "stage": "shipped",
      "production_started": true,
      "can_hold": false,
      "can_cancel": false,
      "cancel_kind": "",
      "hold": null
    }
  },
  "message": "ok",
  "status": true
}
```

| HTTP | `message` | When |
|---|---|---|
| 400 | `bad request` | Neither `id` nor `order_name`; `data` lists the problems |
| 404 | `data not found` | No such order in the store |

### List orders — `GET /api/integration/order.json`

Every order of the store, newest `processed_at` first, without line items. The rows are under `orders`.

| Query | |
|---|---|
| `page`, `limit` | Default 10, max 1000. |
| `search` | Part of `order_number`, or the start of `order_code`. |
| `fulfillment_status` | One status or several, comma separated: `ready,unfulfilled`. |
| `design_status`, `address_status`, `tracking_status` | One value. `address_status` matches `validate_address`. |
| `is_have_ticket` | `true` / `false`. |
| `start_time` + `end_time` | `processed_at` range, RFC 3339, both needed. |
| `start_time_ship` + `end_time_ship` | `shipped_at` range. |

```bash
curl -X GET "{base_url}/api/integration/order.json?limit=2&fulfillment_status=ready,unfulfilled&search=DOCS" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN"
```

```json
{
  "message": "Success",
  "orders": [
    {
      "id": "f4a795d5-8c5b-4c33-a987-b5640f87857b",
      "created_at": "2026-11-10T11:55:34.71384Z",
      "updated_at": "2026-11-10T11:55:34.71384Z",
      "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
      "external_order_id": "",
      "shipping_address": {
        "city": "Mountain View",
        "name": "Jane Doe",
        "email": "jane@example.com",
        "phone": "+1 650-253-0000",
        "state": "California",
        "country": "United States",
        "address1": "1600 Amphitheatre Pkwy",
        "address2": "",
        "label_ship": "",
        "tax_number": "",
        "option_ship": "standard",
        "postal_code": "94043",
        "country_code": "US",
        "province_code": "CA"
      },
      "order_number": "DOCS-185527-A",
      "is_have_ticket": false,
      "design_status": "incompleted",
      "validate_address": "pending",
      "fulfillment_status": "unfulfilled",
      "tracking_status": "incompleted",
      "skip_verify_address": false,
      "fulfillment_cost": 0,
      "note": "first API order",
      "processed_at": "2026-11-10T11:55:34.713659Z",
      "address_validate_message": "",
      "design_validate_message": "order's artwork is pending for validation",
      "order_code": "PD290-9318",
      "source_type": "api",
      "fulfillment_type": "pod",
      "fulfillment_shipping": 0,
      "base_cost": 0,
      "external_transaction_id": ""
    }
  ],
  "status": true,
  "total": 2
}
```

On a server error this route answers HTTP 200 with `status: false` — check `status`.

### Update an order — `PATCH /api/integration/orders/{id}.json`

Only orders **created through this API**, while `fulfillment_status` is `unfulfilled`, `on_hold`,
`payment_awaiting` or `ready`. Send only what changes:

| Field | |
|---|---|
| `shipping_address` | Replaces the whole address: send every field. `option_ship` must be valid. |
| `skip_verify_address` | `true` / `false`. Setting it back to `false` verifies the address again. |
| `line_items[]` | `id` (the line's), `system_sku` and `quantity` (1–999) required; `sku`, `title`, `note`, `designs` replace the stored values — a line sent without `note` loses its note. Lines of a combo must be sent together with the same quantity. |

```bash
curl -X PATCH "{base_url}/api/integration/orders/f4a795d5-8c5b-4c33-a987-b5640f87857b.json" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"shipping_address": {"name": "Jane Doe", "option_ship": "standard", "address1": "1600 Amphitheatre Pkwy", "address2": "Building 40", "city": "Mountain View", "state": "California", "province_code": "CA", "country": "United States", "country_code": "US", "postal_code": "94043", "email": "jane@example.com", "phone": "+1 650-253-0000"}, "line_items": [{"id": "ea7e9a40-7aa4-47ca-aed0-7891401565e6", "system_sku": "QTN-S", "quantity": 2, "note": "two please"}]}'
```

```json
{
  "message": "order updated",
  "status": true
}
```

Changed lines are `pending` until Pawdo has validated them again (a few seconds); an order that was `ready` goes
back through validation and is charged later, at the new price.

| HTTP | `message` | When |
|---|---|---|
| 400 | `a requested lineitem is pending for update, cannot be updated` | A line you send is still being re-validated: wait a few seconds |
| 400 | `order cannot be updated in its current fulfillment status` | The order is charged, in production or cancelled |
| 400 | `validation error`, detail in `error` | e.g. `validation failed: quantity must be greater than 0` |
| 400 | `unsupported shipping option` | |
| 400 | `a requested lineitem is cancelled, cannot be updated` | |
| 404 | `order not found` | |
| 409 | `order was not created via API` | Created by CSV, Shopify… — change it in the seller app |
| 422 | `invalid system sku: NOPE-SKU` | Also: a combo line changed apart from its combo |

### Cancel an order created through the API — `PATCH /api/integration/orders/cancel.json`

| Field | | |
|---|---|---|
| `order_id` | **required** | |
| `lineitem_ids` | | Lines to cancel. Empty: the whole order. |

- **Not charged yet**: cancel the whole order or some lines.
- **Charged** (`paid`, `error`, `awaiting`, `processing`): the whole order only. What was charged is refunded to the
  store balance, even for items already made.

```bash
curl -X PATCH "{base_url}/api/integration/orders/cancel.json" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order_id": "d689c4d1-f3dc-4c3b-ba65-ceb494ac0cec", "lineitem_ids": ["aad33abd-01be-4953-bd81-ed408da7ff6d"]}'
```

```json
{
  "message": "order cancelled",
  "status": true
}
```

| HTTP | `message` | When |
|---|---|---|
| 400 | `validation failed`, detail in `error` | `order_id` missing |
| 404 | `order not found` | |
| 409 | `order was not created via API` | Use [cancel-ship](#cancel-ship--post-apiintegrationorderscancel-shipjson) |
| 422 | `order has already been cancelled` | |
| 422 | `order is pending, please try again later` | Being sent to production right now: retry in a minute |
| 422 | `partial cancellation is not allowed for paid orders` | |
| 422 | `order cannot be cancelled in current status` | Shipped |
| 500 | `failed to cancel order` | Also when a `lineitem_ids` entry is not a line of the order, or is already cancelled. Nothing changed. |

For any order of the store, with a reason and the refund in the answer, use
[cancel-ship](#cancel-ship--post-apiintegrationorderscancel-shipjson).

---

## 5. Order holds and cancel-ship

For customer service: hold an order while the buyer decides, then release it or cancel it. These three routes
work on orders of **every** source of the store, like the Hold / Resume / Cancel buttons of the seller app, and
answer in one shape: `data` = `{order_id, order_number, order_code, result, hold, cancel_kind, refund_amount,
items, cs_hold}`.

### Where an order stands: `cs_hold`

`GET /orders/query.json` and every answer of these routes carry `cs_hold`:

```json
{
  "stage": "on_hold",
  "production_started": false,
  "can_hold": true,
  "can_cancel": true,
  "cancel_kind": "cancel",
  "hold": {
    "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
    "reason": "design",
    "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
    "note": "Buyer is sending a new photo",
    "source": "cs-hub",
    "requested_by": "cs@shop.example",
    "reference": "CS-1234",
    "until": "2026-11-20T00:00:00Z",
    "held_at": "2026-11-10T11:55:35.883986Z",
    "released_at": null
  }
}
```

| Key | |
|---|---|
| `stage` | `pre_production` (not charged), `on_hold`, `error`, `fulfilling` (charged, not in production), `in_production`, `shipped`, `cancelled`, `external`, `unknown` |
| `can_hold` | You can hold it now (it is not charged yet). |
| `production_started` | Items are being or were produced. |
| `can_cancel`, `cancel_kind` | Whether cancel-ship works now, and what it would do: `cancel` (nothing produced), `cancel-produce` (production stopped), `cancel-ship` (made, will not ship). |
| `hold` | Your open hold, or `null`. |

Suggested flow: `can_hold` → offer Hold; else `can_cancel` → offer Cancel (`cancel_kind` says what is lost);
else the order is shipped and nothing can be done in Pawdo.

### Hold — `POST /api/integration/orders/hold.json`

| Field | | |
|---|---|---|
| `order_id` or `order_number` | **one required** | `order_number` is tried as sent, then with / without a leading `#`. |
| `reason` | **required** | `design`, `variant`, `cancel`, `address`, `other`, `check`, `customer`, `agency`, `leader` |
| `note` | ≤ 2000 | |
| `requested_by` | ≤ 255 | Who asked (free text). |
| `reference` | ≤ 64 | Your ticket id. |
| `until` | RFC 3339 | When you expect to release it. Informative: Pawdo never releases by itself. |
| `source` | ≤ 32 | Label of your system; default `cs-hub`. |

```bash
curl -X POST "{base_url}/api/integration/orders/hold.json" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order_number": "DOCS-185527-H", "reason": "design", "note": "Buyer is sending a new photo", "requested_by": "cs@shop.example", "reference": "CS-1234", "until": "2026-11-20T00:00:00Z"}'
```

```json
{
  "data": {
    "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
    "order_number": "DOCS-185527-H",
    "order_code": "PD290-9320",
    "result": "held",
    "hold": {
      "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
      "reason": "design",
      "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
      "note": "Buyer is sending a new photo",
      "source": "cs-hub",
      "requested_by": "cs@shop.example",
      "reference": "CS-1234",
      "until": "2026-11-20T00:00:00Z",
      "held_at": "2026-11-10T11:55:35.883986163Z",
      "released_at": null
    },
    "cs_hold": {
      "stage": "on_hold",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": {
        "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
        "reason": "design",
        "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
        "note": "Buyer is sending a new photo",
        "source": "cs-hub",
        "requested_by": "cs@shop.example",
        "reference": "CS-1234",
        "until": "2026-11-20T00:00:00Z",
        "held_at": "2026-11-10T11:55:35.883986Z",
        "released_at": null
      }
    }
  },
  "message": "order on hold",
  "status": true
}
```

Holding a held order answers `result: already_held` and keeps the first reason. An order already charged cannot
be held — the 409 carries `cs_hold`, and the way out is cancel-ship:

```json
{
  "data": {
    "order_id": "6321be4b-5079-4dbb-9d56-52a997129efc",
    "order_number": "#1002",
    "order_code": "PD290-9249",
    "hold": null,
    "cs_hold": {
      "stage": "in_production",
      "production_started": true,
      "can_hold": false,
      "can_cancel": true,
      "cancel_kind": "cancel-produce",
      "hold": null
    }
  },
  "error_code": "ALREADY_IN_PRODUCTION",
  "message": "the order is in production; it can no longer be held, only cancelled (cancel-ship)",
  "status": false
}
```

### Release — `POST /api/integration/orders/release.json`

| Field | | |
|---|---|---|
| `order_id` or `order_number` | **one required** | |
| `outcome` | **required** | `continue`, `changed` or `cancel` |
| `note`, `requested_by` | | |

| `outcome` | Pawdo does | `result` |
|---|---|---|
| `continue` / `changed` | Resumes the order and validates it again; it is charged on schedule. | `resumed` |
| `continue` / `changed`, someone in Pawdo also holds it | Closes your hold; the order stays on hold. | `released_kept` |
| `continue` / `changed`, Pawdo already lifted the hold | Closes your hold. | `released_not_held` |
| `cancel` | Closes the hold and cancels the order, as cancel-ship. | `cancelled` |

`changed` means the buyer's change was already made in Pawdo — with
[`PATCH /orders/{id}.json`](#update-an-order--patch-apiintegrationordersidjson) for an API order, or in the seller
app — before releasing. Releasing again answers `already_released`.

```bash
curl -X POST "{base_url}/api/integration/orders/release.json" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e", "outcome": "continue", "note": "Buyer kept the design", "requested_by": "cs@shop.example"}'
```

```json
{
  "data": {
    "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
    "order_number": "DOCS-185527-H",
    "order_code": "PD290-9320",
    "result": "resumed",
    "hold": {
      "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
      "reason": "design",
      "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
      "note": "Buyer is sending a new photo",
      "source": "cs-hub",
      "requested_by": "cs@shop.example",
      "reference": "CS-1234",
      "until": "2026-11-20T00:00:00Z",
      "held_at": "2026-11-10T11:55:35.883986Z",
      "released_at": "2026-11-10T11:55:35.920654194Z",
      "release_outcome": "continue",
      "release_note": "Buyer kept the design",
      "released_by": "cs@shop.example"
    },
    "cs_hold": {
      "stage": "pre_production",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": null
    }
  },
  "message": "hold released",
  "status": true
}
```

### Cancel-ship — `POST /api/integration/orders/cancel-ship.json`

Cancels any order of the store that has not been handed to the carrier: Pawdo will not deliver it and refunds the
fulfillment charge to the store balance — **including items already produced**.

| Field | | |
|---|---|---|
| `order_id` or `order_number` | **one required** | |
| `reason` | **required** | Same values as hold. |
| `note`, `requested_by`, `reference` | | |

```bash
curl -X POST "{base_url}/api/integration/orders/cancel-ship.json" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order_id": "a2b05603-3d78-470f-bd3e-8bbe9f88acaa", "reason": "cancel", "requested_by": "cs@shop.example"}'
```

```json
{
  "data": {
    "order_id": "a2b05603-3d78-470f-bd3e-8bbe9f88acaa",
    "order_number": "#1004",
    "order_code": "PD290-9313",
    "result": "cancelled",
    "hold": null,
    "cancel_kind": "cancel-produce",
    "refund_amount": 20,
    "items": [
      {
        "id": "05e9c08d-3fe9-4cc4-9a77-4f429c5511d0",
        "print_code": 2572833,
        "sku": "SOC-M",
        "status": "cancel-produce",
        "cancelled_at": "2026-11-10T11:55:36.326938Z"
      },
      {
        "id": "2a8cf2ca-447c-460a-a353-e23e1f06ceca",
        "print_code": 2572834,
        "sku": "GP-L1",
        "status": "cancel-produce",
        "cancelled_at": "2026-11-10T11:55:36.326938Z"
      }
    ],
    "cs_hold": {
      "stage": "cancelled",
      "production_started": false,
      "can_hold": false,
      "can_cancel": false,
      "cancel_kind": "",
      "hold": null
    }
  },
  "message": "order cancelled",
  "status": true
}
```

`cancel_kind` is what was done; `refund_amount` what was refunded (absent when nothing had been charged); `items`
each unit with its new status — `cancel-produce` (will not be made) or `cancel-ship` (made, will not ship).
Calling again answers `already_cancelled` and refunds nothing more.

### Errors of the three routes

| HTTP | `error_code` | When | `data` |
|---|---|---|---|
| 400 | `BAD_REQUEST` | The body is not JSON | |
| 404 | `ORDER_NOT_FOUND` | No such order in the store | |
| 409 | `ALREADY_IN_PRODUCTION` | Hold: the order is charged or in production | `cs_hold` |
| 409 | `ALREADY_SHIPPED` | Hold or cancel: handed to the carrier | `cs_hold` |
| 409 | `ORDER_CANCELLED` | Hold: already cancelled | `cs_hold` |
| 409 | `ORDER_EXTERNAL` | Fulfilled outside Pawdo | `cs_hold` |
| 409 | `NOT_HOLDABLE` | Hold: the order is in `error` | `cs_hold` |
| 409 | `NOT_ON_HOLD` | Release: you never held it | `cs_hold` |
| 409 | `ORDER_BUSY` | Cancel: being sent to production right now — retry in a minute | `cs_hold` |
| 409 | `NOT_CANCELLABLE` | Cancel: refused at this stage | `cs_hold` |
| 409 | `AMBIGUOUS_ORDER` | `order_number` matches several orders — send `order_id` | `order_ids` |
| 422 | `VALIDATION_FAILED` | A field is missing or not allowed, e.g. `validation failed: reason must be one of [design variant cancel address other check customer agency leader]` | |
| 422 | `NO_STORE_OWNER` | The store has no owner account to cancel as — contact Pawdo | |
| 500 | | Nothing was written. Safe to resend. | |

---

## 6. Webhooks

Pawdo can call an endpoint of yours when something happens to your orders, so you do not have to poll.

| Event | Sent when |
|---|---|
| [`order.status_changed`](#orderstatus_changed) | Something about one of your orders changed — see [below](#orderstatus_changed). |
| [`webhook.ping`](#webhookping) | You click **Send test event** in the seller app. |

### Subscribe

In the Pawdo seller app, open **Integrations → Webhooks** and click **Add Webhook**:

| Field | |
|---|---|
| Endpoint URL | Your URL. It receives `POST` requests with a JSON body. Use HTTPS. |
| Description | Optional label. |
| Events | Tick `order.status_changed`. **Left empty, the webhook receives every event** of the store, event types added later included. Either way, read `X-NextFF-Event` and ignore the types you do not handle. |

After saving, the app shows the webhook's **secret** (`shpat_…`) **once**. Store it on your server: it signs every
delivery. Lost it? Delete the webhook and add a new one.

On the same page, **Send test event** sends a [`webhook.ping`](#webhookping) to your URL, and **Delivery Logs** list
every attempt with your answer's HTTP status and body. A webhook added while API access is not enabled for the store
is created inactive.

### The request

Every delivery is one `POST` with the event as the JSON body — no envelope — and these headers:

```http
POST /hooks/pawdo HTTP/1.1
Content-Type: application/json
X-NextFF-Event: order.status_changed
X-NextFF-Delivery: d31fbcfb-0fa8-42d0-b347-76f36ebe9414
X-NextFF-Timestamp: 1794320216
X-NextFF-Signature: sha256=e3beac478f0f6cc276d63a55f93492f49d6d90f1b14a9db06d89a5a995db7088

{"type":"order_update","reference_id":"DOCS-185527-A","order_id":"f4a795d5-8c5b-4c33-a987-b5640f87857b"}
```

| Header | |
|---|---|
| `X-NextFF-Event` | The event type. |
| `X-NextFF-Delivery` | The event id (UUID). The same on every retry of that event: use it to drop duplicates. |
| `X-NextFF-Timestamp` | Unix time, in seconds, when this attempt was signed. |
| `X-NextFF-Signature` | `sha256=` and the hex HMAC-SHA256 of the body (below). |

### Verify the signature

```
X-NextFF-Signature = "sha256=" + hex( HMAC-SHA256( secret, X-NextFF-Timestamp + "." + raw_body ) )
```

- `raw_body` is the body **exactly as received**, before any JSON parsing: JSON parsed and serialized again may
  not match byte for byte.
- Compare in constant time.
- Reject a timestamp too far from your clock (5 minutes is common), so a captured request cannot be replayed later.

Node.js (Express):

```js
const crypto = require("crypto")

app.post("/hooks/pawdo", express.raw({ type: "application/json" }), (req, res) => {
  const ts = req.get("X-NextFF-Timestamp") || ""
  const sig = req.get("X-NextFF-Signature") || ""
  const expected = "sha256=" + crypto.createHmac("sha256", process.env.PAWDO_WEBHOOK_SECRET)
    .update(ts + ".").update(req.body).digest("hex")
  const ok = sig.length === expected.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))
  if (!ok || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return res.sendStatus(401)

  res.sendStatus(200)                           // answer first …
  queue.push(JSON.parse(req.body.toString()))   // … then do the work
})
```

Python:

```python
import hashlib, hmac, time

def verify(secret: str, timestamp: str, raw_body: bytes, signature: str) -> bool:
    mac = hmac.new(secret.encode(), timestamp.encode() + b"." + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest("sha256=" + mac, signature) and abs(time.time() - int(timestamp)) <= 300
```

Go:

```go
func verify(secret, timestamp string, rawBody []byte, signature string) bool {
	mac := hmac.New(sha256.New, []byte(secret))
	mac.Write([]byte(timestamp + "."))
	mac.Write(rawBody)
	expected := "sha256=" + hex.EncodeToString(mac.Sum(nil))
	return hmac.Equal([]byte(expected), []byte(signature))
}
```

Check your code against the request above. It was signed with this secret, of a test environment:

| | |
|---|---|
| secret | `shpat_ltm0rh_UPGso4t7JeCh2PEnZOLgQVXjt7rwjN4p2vck` |
| `X-NextFF-Timestamp` | `1794320216` |
| body | `{"type":"order_update","reference_id":"DOCS-185527-A","order_id":"f4a795d5-8c5b-4c33-a987-b5640f87857b"}` |
| `X-NextFF-Signature` | `sha256=e3beac478f0f6cc276d63a55f93492f49d6d90f1b14a9db06d89a5a995db7088` |

(The timestamp check fails on it, of course: it is in the past.)

### Answer, retries, order

- **Answer 2xx within 15 seconds.** Any other status, a timeout or a refused connection is a failure. Do the work
  after answering — queue it — rather than before.
- A failed delivery is tried again: **3 attempts in all**, the last one about two minutes after the first. After
  the third failure the event is dropped — it stays in Delivery Logs, and the data is still on the API.
- **Deliveries are not in order**, and the same event can arrive twice (a retry after a timeout you did answer).
  Drop repeats by `X-NextFF-Delivery`, then read the order with
  [Get one order](#get-one-order--get-apiintegrationordersqueryjson) and store what it says: the event itself does
  not carry the order's state.

### `order.status_changed`

Sent for an order of the store — of any source (API, CSV, Shopify…) — when one of these happens:

- Pawdo finishes validating it and marks it valid, or finds a problem with its address (`invalid`, `exception`,
  `unavailable`) or its artwork (`design_status` `error`, `missing`, `invalid_dim`);
- Pawdo records the result of sending it to production (accepted, or an error);
- one of its packages gets a tracking number, or the tracking number shown for a package changes;
- it is held, released or cancel-shipped through the API ([section 5](#5-order-holds-and-cancel-ship));
- [`PATCH /orders/{id}.json`](#update-an-order--patch-apiintegrationordersidjson) changes it without sending it back
  to validation.

It is **not** sent for every change — not for payment, production progress or delivery, for example — and the body
does not carry the order's new state. On each event, read the order with
[`GET /orders/query.json?id=…`](#get-one-order--get-apiintegrationordersqueryjson) and store what it says; to see
changes the event does not cover, keep reading [`GET /order.json`](#list-orders--get-apiintegrationorderjson) on a
schedule.

The body's `type` is `order_update`, the event's older name: branch on the `X-NextFF-Event` header
(`order.status_changed`), not on `type`.

```json
{"type":"order_update","reference_id":"DOCS-185527-A","order_id":"f4a795d5-8c5b-4c33-a987-b5640f87857b"}
```

| Field | |
|---|---|
| `type` | Always `order_update`. |
| `reference_id` | The order's `order_number` — yours, as sent or imported. |
| `order_id` | Pawdo's order id: read the order with it. |

### `webhook.ping`

Sent by **Send test event** in the seller app, signed like every other delivery:

```json
{
  "message": "This is a test webhook delivery",
  "type": "webhook.ping"
}
```

---

## 7. Error code index

`error_code` is stable; `message` is not. Routes without a code are identified by HTTP status and route.

| `error_code` | HTTP | Route | Meaning |
|---|---|---|---|
| `ORDER_NOT_FOUND` | 404 | hold, release, cancel-ship | No such order in the store |
| `BAD_REQUEST` | 400 | hold, release, cancel-ship | Body not JSON |
| `VALIDATION_FAILED` | 422 | hold, release, cancel-ship | A field is missing or not allowed |
| `ALREADY_IN_PRODUCTION` | 409 | hold | Charged or in production |
| `ALREADY_SHIPPED` | 409 | hold, cancel-ship, release (cancel) | Handed to the carrier |
| `ORDER_CANCELLED` | 409 | hold | Already cancelled |
| `ORDER_EXTERNAL` | 409 | hold, cancel-ship | Fulfilled outside Pawdo |
| `NOT_HOLDABLE` | 409 | hold | Order in `error` |
| `NOT_ON_HOLD` | 409 | release | Never held by you |
| `ORDER_BUSY` | 409 | cancel-ship, release (cancel) | Being sent to production; retry shortly |
| `NOT_CANCELLABLE` | 409 | cancel-ship, release (cancel) | Cannot be cancelled at this stage |
| `AMBIGUOUS_ORDER` | 409 | hold, release, cancel-ship | `order_number` matches several orders |
| `NO_STORE_OWNER` | 422 | cancel-ship, release (cancel) | The store has no owner account |

---

## 8. Endpoint reference

Every route of this file: its parameters, the exact body types (defined in [section 9](#9-data-types)), every HTTP
status it answers, and the examples recorded on a Pawdo test environment — the request, then one answer per status
and case. The rules behind them are in sections 2–5 and 7. Replace the examples' ids, order numbers and SKUs with
your own.

| Method | Path | Summary |
|---|---|---|
| GET | `/api/integration/store/info.json` | Get the token's store |
| GET | `/api/integration/order.json` | List the store's orders |
| POST | `/api/integration/orders.json` | Create an order |
| GET | `/api/integration/orders/query.json` | Get one order |
| PATCH | `/api/integration/orders/{order_id}.json` | Update an order created through the API |
| PATCH | `/api/integration/orders/cancel.json` | Cancel an order created through the API |
| POST | `/api/integration/orders/hold.json` | Hold an order before it is charged |
| POST | `/api/integration/orders/release.json` | Release a hold |
| POST | `/api/integration/orders/cancel-ship.json` | Cancel an order at any stage before shipping |

### Common responses

Answers several routes share; each route below names the ones it can give.

- **Unauthorized** `Error` — The token is missing, unknown, deactivated or expired, or the store is deactivated. Do not retry with the same token: create a new one in the seller app. Examples: `missing_token` `{"message":"missing access token","status":false}`; `unknown_token` `{"message":"token contains an invalid number of segments","status":false}`; `deactivated_token` `{"message":"access token is not active","status":false}`; `expired_token` `{"message":"access token has expired","status":false}`.
- **ApiDisabled** `Error` — API access is not enabled for the store. Ask Pawdo to enable it. The body of this answer is not stable yet — rely on the status code.
- **RateLimited** `Error` — More than 800 requests in the last minute for this store. Wait `Retry-After` seconds. Headers: `Retry-After`. Examples: `rate_limited` `{"message":"request rate limited","status":false}`.
- **ServerError** `Error` — Something failed on Pawdo's side; the message is generic. Retry with backoff; contact Pawdo if it persists.
- **HoldBadRequest** `Error` — `BAD_REQUEST`: the body is not JSON. Examples: `malformed` `{"error_code":"BAD_REQUEST","message":"invalid request body: unexpected end of JSON input","status":false}`.
- **HoldOrderNotFound** `Error` — `ORDER_NOT_FOUND`: no such order in the store. Examples: `not_found` `{"error_code":"ORDER_NOT_FOUND","message":"order not found","status":false}`.
- **HoldServerError** `Error` — Nothing was written (the change is rolled back). Safe to resend.

### Store

The store the access token belongs to.

#### `GET /api/integration/store/info.json`

**Get the token's store** · `getStoreInfo` · needs API access

The store the access token belongs to, and its owner account. A good first call to check a token.

Responses:

- **200** — The store. Note the key is `store`, not `data`.

  ```ts
  {
    status: boolean;
    store: Store;
  }
  ```
- **401** — [Unauthorized](#common-responses)
- **403** — [ApiDisabled](#common-responses)
- **429** — [RateLimited](#common-responses)

Examples:

Request:

```http
GET {base_url}/api/integration/store/info.json
X-pawdo-access-token: <token>
```

Answer **200**, `ok`:

```json
{
  "status": true,
  "store": {
    "id": "20d02210-e9b2-4238-93b2-829fa0878199",
    "name": "Store 964",
    "status": "active",
    "user_id": "a63d7f14-7728-4b4b-8570-6f42a2a6ccb4",
    "phone": "+15556973964",
    "support_email": "store73964@example.test",
    "currency": "USD",
    "fulfillment_type": "pod",
    "allow_public_api": true,
    "allow_pick_stock": true,
    "allow_pack_return": true,
    "created_at": "2026-05-04T02:28:21.43319Z",
    "updated_at": "2026-05-27T02:30:30.324044Z",
    "admin": {
      "id": "a63d7f14-7728-4b4b-8570-6f42a2a6ccb4",
      "name": "Seller 609",
      "email": "seller68609@example.test",
      "phone": "+15552468609",
      "status": "active"
    }
  }
}
```

### Orders

Lastmile orders pushed through the API, and every order of the store for reading.

#### `GET /api/integration/order.json`

**List the store's orders** · `listOrders` · needs API access

Every order of the store, of any source, newest `processed_at` first. Rows carry the order fields but no
line items — fetch one order with `GET /orders/query.json` for those and for tracking.

A date range filter needs both ends, in RFC 3339 with a time and a zone. A value that is not RFC 3339
(`2026-11-01`) is not rejected: the list comes back empty.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `page` | query | `integer` (minimum 1, default 1) |  | Page number, from 1. |
| `limit` | query | `integer` (minimum 1, maximum 1000, default 10) |  | Page size. Above 1000 is cut to 1000. |
| `search` | query | `string` |  | Part of `order_number`, or the beginning of `order_code`. |
| `fulfillment_status` | query | `string` |  | One status or several separated by commas. See `Order.fulfillment_status`. E.g. `ready,unfulfilled`. |
| `design_status` | query | `"missing" \| "invalid_dim" \| "error" \| "incompleted" \| "completed"` |  |  |
| `address_status` | query | `"pending" \| "valid" \| "invalid" \| "exception"` |  | Matches `validate_address`. |
| `tracking_status` | query | `"missing" \| "incompleted" \| "completed"` |  |  |
| `is_have_ticket` | query | `boolean` |  |  |
| `start_time` | query | `datetime` |  | `processed_at` from (inclusive). Needs `end_time`. E.g. `2026-11-01T00:00:00Z`. |
| `end_time` | query | `datetime` |  | `processed_at` to (inclusive). Needs `start_time`. E.g. `2026-12-01T00:00:00Z`. |
| `start_time_ship` | query | `datetime` |  | `shipped_at` from. Needs `end_time_ship`. |
| `end_time_ship` | query | `datetime` |  | `shipped_at` to. Needs `start_time_ship`. |

Responses:

- **200** — One page of orders, `total` across all pages. Note the key is `orders`, not `data`. On a server error this route answers HTTP 200 with `status: false` — check `status`.

  ```ts
  {
    status: boolean;
    message: string;
    orders: Order[];
    total: integer;
  }
  ```
- **401** — [Unauthorized](#common-responses)
- **403** — [ApiDisabled](#common-responses)
- **429** — [RateLimited](#common-responses)

Examples:

Request:

```http
GET {base_url}/api/integration/order.json?page=1&limit=10
X-pawdo-access-token: <token>
```

Request:

```http
GET {base_url}/api/integration/order.json?fulfillment_status=ready,unfulfilled
X-pawdo-access-token: <token>
```

Request:

```http
GET {base_url}/api/integration/order.json?start_time=2026-11-01T00:00:00Z&end_time=2026-12-01T00:00:00Z
X-pawdo-access-token: <token>
```

Answer **200**, `page`:

```json
{
  "message": "Success",
  "orders": [
    {
      "id": "f4a795d5-8c5b-4c33-a987-b5640f87857b",
      "created_at": "2026-11-10T11:55:34.71384Z",
      "updated_at": "2026-11-10T11:55:34.71384Z",
      "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
      "external_order_id": "",
      "shipping_address": {
        "city": "Mountain View",
        "name": "Jane Doe",
        "email": "jane@example.com",
        "phone": "+1 650-253-0000",
        "state": "California",
        "country": "United States",
        "address1": "1600 Amphitheatre Pkwy",
        "address2": "",
        "label_ship": "",
        "tax_number": "",
        "option_ship": "standard",
        "postal_code": "94043",
        "country_code": "US",
        "province_code": "CA"
      },
      "order_number": "DOCS-185527-A",
      "is_have_ticket": false,
      "design_status": "incompleted",
      "validate_address": "pending",
      "fulfillment_status": "unfulfilled",
      "tracking_status": "incompleted",
      "skip_verify_address": false,
      "fulfillment_cost": 0,
      "note": "first API order",
      "processed_at": "2026-11-10T11:55:34.713659Z",
      "address_validate_message": "",
      "design_validate_message": "order's artwork is pending for validation",
      "order_code": "PD290-9318",
      "source_type": "api",
      "fulfillment_type": "pod",
      "fulfillment_shipping": 0,
      "base_cost": 0,
      "external_transaction_id": ""
    }
  ],
  "status": true,
  "total": 38
}
```

Answer **200**, `filtered`:

```json
{
  "message": "Success",
  "orders": [
    {
      "id": "f4a795d5-8c5b-4c33-a987-b5640f87857b",
      "created_at": "2026-11-10T11:55:34.71384Z",
      "updated_at": "2026-11-10T11:55:34.71384Z",
      "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
      "external_order_id": "",
      "shipping_address": {
        "city": "Mountain View",
        "name": "Jane Doe",
        "email": "jane@example.com",
        "phone": "+1 650-253-0000",
        "state": "California",
        "country": "United States",
        "address1": "1600 Amphitheatre Pkwy",
        "address2": "",
        "label_ship": "",
        "tax_number": "",
        "option_ship": "standard",
        "postal_code": "94043",
        "country_code": "US",
        "province_code": "CA"
      },
      "order_number": "DOCS-185527-A",
      "is_have_ticket": false,
      "design_status": "incompleted",
      "validate_address": "pending",
      "fulfillment_status": "unfulfilled",
      "tracking_status": "incompleted",
      "skip_verify_address": false,
      "fulfillment_cost": 0,
      "note": "first API order",
      "processed_at": "2026-11-10T11:55:34.713659Z",
      "address_validate_message": "",
      "design_validate_message": "order's artwork is pending for validation",
      "order_code": "PD290-9318",
      "source_type": "api",
      "fulfillment_type": "pod",
      "fulfillment_shipping": 0,
      "base_cost": 0,
      "external_transaction_id": ""
    }
  ],
  "status": true,
  "total": 2
}
```

Answer **200**, `date_range`:

```json
{
  "message": "Success",
  "orders": [
    {
      "id": "f4a795d5-8c5b-4c33-a987-b5640f87857b",
      "created_at": "2026-11-10T11:55:34.71384Z",
      "updated_at": "2026-11-10T11:55:34.71384Z",
      "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
      "external_order_id": "",
      "shipping_address": {
        "city": "Mountain View",
        "name": "Jane Doe",
        "email": "jane@example.com",
        "phone": "+1 650-253-0000",
        "state": "California",
        "country": "United States",
        "address1": "1600 Amphitheatre Pkwy",
        "address2": "",
        "label_ship": "",
        "tax_number": "",
        "option_ship": "standard",
        "postal_code": "94043",
        "country_code": "US",
        "province_code": "CA"
      },
      "order_number": "DOCS-185527-A",
      "is_have_ticket": false,
      "design_status": "incompleted",
      "validate_address": "pending",
      "fulfillment_status": "unfulfilled",
      "tracking_status": "incompleted",
      "skip_verify_address": false,
      "fulfillment_cost": 0,
      "note": "first API order",
      "processed_at": "2026-11-10T11:55:34.713659Z",
      "address_validate_message": "",
      "design_validate_message": "order's artwork is pending for validation",
      "order_code": "PD290-9318",
      "source_type": "api",
      "fulfillment_type": "pod",
      "fulfillment_shipping": 0,
      "base_cost": 0,
      "external_transaction_id": ""
    }
  ],
  "status": true,
  "total": 5
}
```

Answer **200**, `date_without_time` — start_time=2026-11-01 (not RFC 3339): empty, not an error:

```json
{"message":"Success","orders":[],"status":true,"total":0}
```

#### `POST /api/integration/orders.json`

**Create an order** · `createOrder` · needs API access

Pushes one order. Pawdo answers at once with the new order's id, then validates it in the background:
SKUs, artwork, and the address (unless `skip_verify_address`). Read the outcome with
`GET /orders/query.json`: a valid order moves to `ready` and is charged on the store's payment schedule.

`order_number` is unique within the store, across every source: a second order with the same number is
refused with 409. After a timeout, resend the same request — a 409 means the first one landed; fetch it
with `GET /orders/query.json?order_name=…`.

Request body (JSON, required): [`OrderCreate`](#type-ordercreate).

Responses:

- **200** — Created.

  ```ts
  Envelope & {
    data: {
      order_id: uuid;
    };
  }
  ```
- **400** `Error` — The body is not JSON, a required field is missing, or `option_ship` is not a shipping option of Pawdo. Seen: "bad request"; "unsupported shipping option".
- **401** — [Unauthorized](#common-responses)
- **403** — [ApiDisabled](#common-responses)
- **409** `Error` — The store already has an order with this `order_number`. Seen: "order existed".
- **422** `Error` — A `system_sku` is not a Pawdo SKU your store can order. Seen: "invalid system sku: NOPE-SKU".
- **429** — [RateLimited](#common-responses)
- **500** — [ServerError](#common-responses)

Examples:

Request `order`:

```http
POST {base_url}/api/integration/orders.json
X-pawdo-access-token: <token>
Content-Type: application/json

{
  "order_number": "DOCS-185527-A",
  "order_note": "first API order",
  "address": {
    "name": "Jane Doe",
    "option_ship": "standard",
    "address1": "1600 Amphitheatre Pkwy",
    "address2": "",
    "city": "Mountain View",
    "state": "California",
    "province_code": "CA",
    "country": "United States",
    "country_code": "US",
    "postal_code": "94043",
    "email": "jane@example.com",
    "phone": "+1 650-253-0000"
  },
  "line_items": [
    {
      "sku": "MY-SHOP-TEE-1",
      "system_sku": "QTN-S",
      "quantity": 1,
      "title": "Custom tee",
      "note": "gift wrap",
      "designs": [
        {
          "key": "design1",
          "design": "https://example.com/art/front.png",
          "mockup": "https://example.com/art/front-mockup.png"
        }
      ]
    }
  ]
}
```

Answer **200**, `created`:

```json
{"data":{"order_id":"f4a795d5-8c5b-4c33-a987-b5640f87857b"},"message":"ok","status":true}
```

Answer **400**, `validation`:

```json
{
  "error": "validation failed: line_items must contain more than 0 items, country_code is a required field, postal_code is a required field",
  "message": "bad request",
  "status": false
}
```

Answer **400**, `malformed`:

```json
{"error":"unexpected end of JSON input","message":"bad request","status":false}
```

Answer **400**, `unsupported_shipping_option`:

```json
{"message":"unsupported shipping option","status":false}
```

Answer **409**, `duplicate`:

```json
{"message":"order existed","status":false}
```

Answer **422**, `unknown_sku`:

```json
{"message":"invalid system sku: NOPE-SKU","status":false}
```

#### `GET /api/integration/orders/query.json`

**Get one order** · `getOrder` · needs API access

One order of the store, of any source, with its line items, their items in production (`item_fulfills`,
with tracking once shipped) and the `cs_hold` block (see *Order holds*).

Pass `id`, or `order_name` — the `order_number` exactly as stored (`#1001` and `1001` are different). If
several orders of the store share a number, one of them is returned: prefer `id`.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | query | `uuid` |  | Pawdo order id. Required without `order_name`. E.g. `831272e2-b1fe-47f9-bfe6-c5a97fadc9a2`. |
| `order_name` | query | `string` |  | Your order number. Required without `id`. E.g. `DOCS-190644-V2`. |

Responses:

- **200** — The order.

  ```ts
  Envelope & {
    data: OrderDetail;
  }
  ```
- **400** `Error` — Neither `id` nor `order_name` was given. `data` lists the problems. Seen: "bad request".
- **401** — [Unauthorized](#common-responses)
- **403** — [ApiDisabled](#common-responses)
- **404** `Error` — No such order in the store. Seen: "data not found".
- **429** — [RateLimited](#common-responses)
- **500** — [ServerError](#common-responses)

Examples:

Request:

```http
GET {base_url}/api/integration/orders/query.json?id=831272e2-b1fe-47f9-bfe6-c5a97fadc9a2
X-pawdo-access-token: <token>
```

Request:

```http
GET {base_url}/api/integration/orders/query.json?order_name=DOCS-190644-V2
X-pawdo-access-token: <token>
```

Answer **200**, `just_created` — Right after create: validation still running:

```json
{
  "data": {
    "id": "f4a795d5-8c5b-4c33-a987-b5640f87857b",
    "created_at": "2026-11-10T11:55:34.71384Z",
    "updated_at": "2026-11-10T11:55:34.71384Z",
    "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
    "external_order_id": "",
    "shipping_address": {
      "city": "Mountain View",
      "name": "Jane Doe",
      "email": "jane@example.com",
      "phone": "+1 650-253-0000",
      "state": "California",
      "country": "United States",
      "address1": "1600 Amphitheatre Pkwy",
      "address2": "",
      "label_ship": "",
      "tax_number": "",
      "option_ship": "standard",
      "postal_code": "94043",
      "country_code": "US",
      "province_code": "CA"
    },
    "order_number": "DOCS-185527-A",
    "is_have_ticket": false,
    "design_status": "incompleted",
    "validate_address": "pending",
    "fulfillment_status": "unfulfilled",
    "tracking_status": "incompleted",
    "skip_verify_address": false,
    "fulfillment_cost": 0,
    "note": "first API order",
    "processed_at": "2026-11-10T11:55:34.713659Z",
    "address_validate_message": "",
    "design_validate_message": "order's artwork is pending for validation",
    "order_code": "PD290-9318",
    "source_type": "api",
    "fulfillment_type": "pod",
    "fulfillment_shipping": 0,
    "base_cost": 0,
    "external_transaction_id": "",
    "line_items": [
      {
        "id": "ea7e9a40-7aa4-47ca-aed0-7891401565e6",
        "created_at": "2026-11-10T11:55:34.716205Z",
        "updated_at": "2026-11-10T11:55:34.716205Z",
        "order_id": "f4a795d5-8c5b-4c33-a987-b5640f87857b",
        "external_line_item_id": "",
        "designs": [
          {
            "key": "design1",
            "design": "https://example.com/art/front.png",
            "mockup": "https://example.com/art/front-mockup.png"
          }
        ],
        "title": "Custom tee",
        "sku": "MY-SHOP-TEE-1",
        "system_sku": "QTN-S",
        "quantity": 1,
        "tags": [],
        "option1": "Thin Short",
        "option2": "",
        "option3": "",
        "cancelled_at": null,
        "status": "open",
        "system_message": "",
        "note": "gift wrap",
        "external_transaction_id": ""
      }
    ],
    "cs_hold": {
      "stage": "pre_production",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": null
    }
  },
  "message": "ok",
  "status": true
}
```

Answer **200**, `ready` — Validated and priced: waiting for the charge:

```json
{
  "data": {
    "id": "831272e2-b1fe-47f9-bfe6-c5a97fadc9a2",
    "created_at": "2026-11-10T12:06:45.059776Z",
    "updated_at": "2026-11-10T12:06:51.765792Z",
    "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
    "external_order_id": "",
    "shipping_address": {
      "city": "Mountain View",
      "name": "Jane Doe",
      "email": "jane@example.com",
      "phone": "+1 650-253-0000",
      "state": "California",
      "country": "United States",
      "address1": "1600 Amphitheatre Pkwy",
      "address2": "",
      "label_ship": "",
      "tax_number": "",
      "option_ship": "standard",
      "postal_code": "94043",
      "country_code": "US",
      "province_code": "CA"
    },
    "order_number": "DOCS-190644-V2",
    "is_have_ticket": false,
    "design_status": "completed",
    "validate_address": "valid",
    "fulfillment_status": "ready",
    "tracking_status": "incompleted",
    "skip_verify_address": true,
    "fulfillment_cost": 10,
    "note": "",
    "processed_at": "2026-11-10T12:06:45.059604Z",
    "address_validate_message": "",
    "design_validate_message": "",
    "order_code": "PD290-9324",
    "source_type": "api",
    "fulfillment_type": "pod",
    "fulfillment_shipping": 0,
    "base_cost": 10,
    "external_transaction_id": "",
    "line_items": [
      {
        "id": "2b5a6951-5ca2-4cd6-8f90-d57a0d191e2e",
        "created_at": "2026-11-10T12:06:45.06056Z",
        "updated_at": "2026-11-10T12:06:51.770398Z",
        "order_id": "831272e2-b1fe-47f9-bfe6-c5a97fadc9a2",
        "external_line_item_id": "",
        "designs": null,
        "title": "Insert pillow - ",
        "sku": "MY-GP-L1",
        "system_sku": "GP-L1",
        "quantity": 1,
        "tags": [],
        "option1": "GP-L1",
        "option2": "",
        "option3": "",
        "cancelled_at": null,
        "status": "open",
        "total_basecost": 10,
        "system_message": "",
        "note": "",
        "external_transaction_id": ""
      }
    ],
    "cs_hold": {
      "stage": "pre_production",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": null
    }
  },
  "message": "ok",
  "status": true
}
```

Answer **200**, `validation_failed` — Artwork missing: design_status missing, the line says why in system_message:

```json
{
  "data": {
    "id": "edc52990-7864-4212-83a9-40a35624ef8c",
    "created_at": "2026-11-10T12:06:45.016587Z",
    "updated_at": "2026-11-10T12:06:49.685647Z",
    "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
    "external_order_id": "",
    "shipping_address": {
      "city": "Mountain View",
      "name": "Jane Doe",
      "email": "jane@example.com",
      "phone": "+1 650-253-0000",
      "state": "California",
      "country": "United States",
      "address1": "1600 Amphitheatre Pkwy",
      "address2": "",
      "label_ship": "",
      "tax_number": "",
      "option_ship": "standard",
      "postal_code": "94043",
      "country_code": "US",
      "province_code": "CA"
    },
    "order_number": "DOCS-190644-V0",
    "is_have_ticket": false,
    "design_status": "missing",
    "validate_address": "valid",
    "fulfillment_status": "unfulfilled",
    "tracking_status": "incompleted",
    "skip_verify_address": true,
    "fulfillment_cost": 0,
    "note": "",
    "processed_at": "2026-11-10T12:06:45.01587Z",
    "address_validate_message": "",
    "design_validate_message": "order is missing artwork",
    "order_code": "PD290-9322",
    "source_type": "api",
    "fulfillment_type": "pod",
    "fulfillment_shipping": 0,
    "base_cost": 0,
    "external_transaction_id": "",
    "line_items": [
      {
        "id": "69fc5025-46e5-4319-9dcb-f906fc6ea2b5",
        "created_at": "2026-11-10T12:06:45.020969Z",
        "updated_at": "2026-11-10T12:06:49.688686Z",
        "order_id": "edc52990-7864-4212-83a9-40a35624ef8c",
        "external_line_item_id": "",
        "designs": null,
        "title": "Quilted Tote Bag new - Thin Short",
        "sku": "MY-QTN-S",
        "system_sku": "QTN-S",
        "quantity": 1,
        "tags": [],
        "option1": "Thin Short",
        "option2": "",
        "option3": "",
        "cancelled_at": null,
        "status": "design_error",
        "system_message": "item artwork validation failed: (Preview #1) empty url on required field",
        "note": "",
        "external_transaction_id": ""
      }
    ],
    "cs_hold": {
      "stage": "pre_production",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": null
    }
  },
  "message": "ok",
  "status": true
}
```

Answer **200**, `by_order_name`:

```json
{
  "data": {
    "id": "f4a795d5-8c5b-4c33-a987-b5640f87857b",
    "created_at": "2026-11-10T11:55:34.71384Z",
    "updated_at": "2026-11-10T11:55:34.71384Z",
    "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
    "external_order_id": "",
    "shipping_address": {
      "city": "Mountain View",
      "name": "Jane Doe",
      "email": "jane@example.com",
      "phone": "+1 650-253-0000",
      "state": "California",
      "country": "United States",
      "address1": "1600 Amphitheatre Pkwy",
      "address2": "",
      "label_ship": "",
      "tax_number": "",
      "option_ship": "standard",
      "postal_code": "94043",
      "country_code": "US",
      "province_code": "CA"
    },
    "order_number": "DOCS-185527-A",
    "is_have_ticket": false,
    "design_status": "incompleted",
    "validate_address": "pending",
    "fulfillment_status": "unfulfilled",
    "tracking_status": "incompleted",
    "skip_verify_address": false,
    "fulfillment_cost": 0,
    "note": "first API order",
    "processed_at": "2026-11-10T11:55:34.713659Z",
    "address_validate_message": "",
    "design_validate_message": "order's artwork is pending for validation",
    "order_code": "PD290-9318",
    "source_type": "api",
    "fulfillment_type": "pod",
    "fulfillment_shipping": 0,
    "base_cost": 0,
    "external_transaction_id": "",
    "line_items": [
      {
        "id": "ea7e9a40-7aa4-47ca-aed0-7891401565e6",
        "created_at": "2026-11-10T11:55:34.716205Z",
        "updated_at": "2026-11-10T11:55:34.716205Z",
        "order_id": "f4a795d5-8c5b-4c33-a987-b5640f87857b",
        "external_line_item_id": "",
        "designs": [
          {
            "key": "design1",
            "design": "https://example.com/art/front.png",
            "mockup": "https://example.com/art/front-mockup.png"
          }
        ],
        "title": "Custom tee",
        "sku": "MY-SHOP-TEE-1",
        "system_sku": "QTN-S",
        "quantity": 1,
        "tags": [],
        "option1": "Thin Short",
        "option2": "",
        "option3": "",
        "cancelled_at": null,
        "status": "open",
        "system_message": "",
        "note": "gift wrap",
        "external_transaction_id": ""
      }
    ],
    "cs_hold": {
      "stage": "pre_production",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": null
    }
  },
  "message": "ok",
  "status": true
}
```

Answer **200**, `on_hold`:

```json
{
  "data": {
    "id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
    "created_at": "2026-11-10T11:55:35.665497Z",
    "updated_at": "2026-11-10T11:55:35.88484Z",
    "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
    "external_order_id": "",
    "shipping_address": {
      "city": "Mountain View",
      "name": "Jane Doe",
      "email": "jane@example.com",
      "phone": "+1 650-253-0000",
      "state": "California",
      "country": "United States",
      "address1": "1600 Amphitheatre Pkwy",
      "address2": "",
      "label_ship": "",
      "tax_number": "",
      "option_ship": "standard",
      "postal_code": "94043",
      "country_code": "US",
      "province_code": "CA"
    },
    "order_number": "DOCS-185527-H",
    "is_have_ticket": false,
    "design_status": "incompleted",
    "validate_address": "pending",
    "fulfillment_status": "on_hold",
    "tracking_status": "incompleted",
    "skip_verify_address": false,
    "fulfillment_cost": 0,
    "note": "",
    "processed_at": "2026-11-10T11:55:35.665327Z",
    "last_hold_at": "2026-11-10T11:55:35.883986Z",
    "address_validate_message": "",
    "design_validate_message": "order's artwork is pending for validation",
    "order_code": "PD290-9320",
    "source_type": "api",
    "fulfillment_type": "pod",
    "fulfillment_shipping": 0,
    "base_cost": 0,
    "external_transaction_id": "",
    "line_items": [
      {
        "id": "02cae1ba-8d28-4d1e-8eb0-d591e7a081c3",
        "created_at": "2026-11-10T11:55:35.667817Z",
        "updated_at": "2026-11-10T11:55:35.667817Z",
        "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
        "external_line_item_id": "",
        "designs": [
          {
            "key": "design1",
            "design": "https://example.com/art/front.png",
            "mockup": "https://example.com/art/front-mockup.png"
          }
        ],
        "title": "Custom tee",
        "sku": "MY-SHOP-TEE-1",
        "system_sku": "QTN-S",
        "quantity": 1,
        "tags": [],
        "option1": "Thin Short",
        "option2": "",
        "option3": "",
        "cancelled_at": null,
        "status": "open",
        "system_message": "",
        "note": "gift wrap",
        "external_transaction_id": ""
      }
    ],
    "cs_hold": {
      "stage": "on_hold",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": {
        "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
        "reason": "design",
        "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
        "note": "Buyer is sending a new photo",
        "source": "cs-hub",
        "requested_by": "cs@shop.example",
        "reference": "CS-1234",
        "until": "2026-11-20T00:00:00Z",
        "held_at": "2026-11-10T11:55:35.883986Z",
        "released_at": null
      }
    }
  },
  "message": "ok",
  "status": true
}
```

Answer **200**, `shipped` — Shipped: item_fulfills carry the tracking:

```json
{
  "data": {
    "id": "5e365b1d-16c0-4335-90a3-eb38024241a5",
    "created_at": "2026-06-15T03:28:51.77728Z",
    "updated_at": "2026-06-16T06:36:51.743075Z",
    "store_id": "20d02210-e9b2-4238-93b2-829fa0878199",
    "external_order_id": "",
    "shipping_address": {
      "tax": 0,
      "city": "Menifee",
      "name": "Customer 127",
      "email": "c88127@example.test",
      "phone": "+15552188127",
      "state": "California",
      "country": "US",
      "address1": "3568 Example St",
      "address2": "",
      "label_ship": "",
      "option_ship": "standard",
      "postal_code": "92584",
      "country_code": "US",
      "province_code": "CA"
    },
    "order_number": "#1001",
    "is_have_ticket": false,
    "design_status": "completed",
    "validate_address": "valid",
    "fulfillment_status": "ship-out",
    "tracking_status": "completed",
    "skip_verify_address": true,
    "fulfillment_cost": 10,
    "note": "",
    "processed_at": "2026-06-15T03:26:41.469324Z",
    "production_at": "2026-06-15T08:20:18.979967Z",
    "fulfillment_cost_paid": "2026-06-15T04:38:58.942204Z",
    "shipped_at": "2026-06-16T06:36:45.676743Z",
    "address_validate_message": "address not found",
    "design_validate_message": "",
    "order_code": "PD290-8958",
    "source_type": "csv",
    "fulfillment_type": "pod",
    "fulfillment_shipping": 0,
    "base_cost": 10,
    "external_transaction_id": "",
    "line_items": [
      {
        "id": "6297fc4f-5923-4df4-80d0-ec8b7ae65fbc",
        "created_at": "2026-06-15T03:28:51.78041Z",
        "updated_at": "2026-06-15T04:39:12.996291Z",
        "order_id": "5e365b1d-16c0-4335-90a3-eb38024241a5",
        "external_line_item_id": "13012345678901",
        "designs": [
          {
            "key": "design1",
            "design": "https://example.com/files/b69d89fc89.png",
            "mockup": "https://example.com/files/1399ecdb8d.jpg"
          }
        ],
        "title": "Tumbler 40oz - Black",
        "sku": "",
        "system_sku": "THF-B14",
        "quantity": 1,
        "tags": [],
        "option1": "",
        "option2": "",
        "option3": "",
        "cancelled_at": null,
        "status": "open",
        "total_basecost": 10,
        "system_message": "",
        "note": "",
        "external_transaction_id": "TXN-1001",
        "item_fulfills": [
          {
            "id": "6e694dfd-91da-4073-8974-7bf58fc65121",
            "created_at": "2026-06-15T04:38:59.137722Z",
            "updated_at": "2026-06-16T06:36:46.817621Z",
            "variant_code": "THF-B14",
            "shipping_carrier": "JCW",
            "quantity": 1,
            "status": "ship-out",
            "cancel_at": null,
            "production_at": "2026-06-15T08:20:18.979967Z",
            "shipped_at": "2026-06-16T06:36:45.676743Z",
            "cancel_status": "cannot-cancel",
            "tracking_code": "JCW10000095619",
            "note": "Tumbler with Handle 40 oz 3D Black - 14",
            "handoff_tracking_code": "",
            "handoff_shipping_carrier": ""
          }
        ]
      }
    ],
    "cs_hold": {
      "stage": "shipped",
      "production_started": true,
      "can_hold": false,
      "can_cancel": false,
      "cancel_kind": "",
      "hold": null
    }
  },
  "message": "ok",
  "status": true
}
```

Answer **400**, `missing_param`:

```json
{
  "data": [
    "id: This field is required if OrderName is absent",
    "order_name: This field is required if ID is absent"
  ],
  "error": "Key: 'id' Error:Field validation for 'id' failed on the 'required_without' tag\nKey: 'order_name' Error:Field validation for 'order_name' failed on the 'required_without' tag",
  "message": "bad request",
  "status": false
}
```

Answer **404**, `not_found`:

```json
{"message":"data not found","status":false}
```

#### `PATCH /api/integration/orders/{order_id}.json`

**Update an order created through the API** · `updateOrder` · needs API access

Changes the address, the `skip_verify_address` flag, or line items of an order **created through this
API**, while its `fulfillment_status` is `unfulfilled`, `on_hold`, `payment_awaiting` or `ready`.
Everything is optional; send only what changes.

* `shipping_address` replaces the whole address — send every field.
* A line item is addressed by its `id` (from `GET /orders/query.json`). `system_sku` and `quantity` are
  required for it; `note`, `title`, `sku` and `designs` replace the stored values (an omitted `note` is
  cleared).
* Lines you change go back to `pending` until Pawdo has re-validated them (a few seconds). Changing the
  same line again in that window is refused with 400 — wait, then retry.
* An order that was `ready` is taken back for validation, and charged later at the new price.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `order_id` | path | `uuid` | yes | Pawdo order id. E.g. `f4a795d5-8c5b-4c33-a987-b5640f87857b`. |

Request body (JSON, required): [`OrderUpdate`](#type-orderupdate).

Responses:

- **200** `Envelope` — Updated.
- **400** `Error` — The body fails validation, `option_ship` is unknown, the order's status no longer allows changes, or a line is `pending` (re-validation still running) or cancelled. Seen: "validation error"; "a requested lineitem is pending for update, cannot be updated"; "order cannot be updated in its current fulfillment status"; "unsupported shipping option".
- **401** — [Unauthorized](#common-responses)
- **403** — [ApiDisabled](#common-responses)
- **404** `Error` — No such order in the store. Seen: "order not found".
- **409** `Error` — The order was not created through the API (CSV, Shopify…). Change it in the seller app. Seen: "order was not created via API".
- **422** `Error` — A `system_sku` is unknown, or a combo line was changed apart from the rest of its combo. Seen: "invalid system sku: NOPE-SKU".
- **429** — [RateLimited](#common-responses)
- **500** — [ServerError](#common-responses)

Examples:

Request `address_and_quantity`:

```http
PATCH {base_url}/api/integration/orders/f4a795d5-8c5b-4c33-a987-b5640f87857b.json
X-pawdo-access-token: <token>
Content-Type: application/json

{
  "shipping_address": {
    "name": "Jane Doe",
    "option_ship": "standard",
    "address1": "1600 Amphitheatre Pkwy",
    "address2": "Building 40",
    "city": "Mountain View",
    "state": "California",
    "province_code": "CA",
    "country": "United States",
    "country_code": "US",
    "postal_code": "94043",
    "email": "jane@example.com",
    "phone": "+1 650-253-0000"
  },
  "line_items": [
    {
      "id": "ea7e9a40-7aa4-47ca-aed0-7891401565e6",
      "system_sku": "QTN-S",
      "quantity": 2,
      "note": "two please"
    }
  ]
}
```

Answer **200**, `updated`:

```json
{"message":"order updated","status":true}
```

Answer **400**, `validation`:

```json
{
  "error": "validation failed: quantity must be greater than 0",
  "message": "validation error",
  "status": false
}
```

Answer **400**, `line_pending`:

```json
{"message":"a requested lineitem is pending for update, cannot be updated","status":false}
```

Answer **400**, `status_not_editable`:

```json
{"message":"order cannot be updated in its current fulfillment status","status":false}
```

Answer **400**, `unsupported_shipping_option`:

```json
{"message":"unsupported shipping option","status":false}
```

Answer **404**, `not_found`:

```json
{"message":"order not found","status":false}
```

Answer **409**, `not_api_order`:

```json
{"message":"order was not created via API","status":false}
```

Answer **422**, `unknown_sku`:

```json
{"message":"invalid system sku: NOPE-SKU","status":false}
```

#### `PATCH /api/integration/orders/cancel.json`

**Cancel an order created through the API** · `cancelOrder` · needs API access

Cancels an order **created through this API**, whole or some of its lines. For orders of other sources,
or to cancel with a reason and get the refund back in the answer, use `POST /orders/cancel-ship.json`.

* Not charged yet: cancel the whole order (`lineitem_ids` empty) or some lines.
* Already charged (`paid`, `error`, `awaiting`, `processing`): only the whole order. The fulfillment
  charge is refunded to the store balance, even for items already produced.
* `pending` (being sent to production right now): refused, retry a little later.
* Shipped or already cancelled: refused.

Request body (JSON, required):

```ts
{
  order_id: uuid;
  /** Lines to cancel. Empty or absent cancels the whole order. */
  lineitem_ids?: uuid[];
}
```

Responses:

- **200** `Envelope` — Cancelled.
- **400** `Error` — The body is not JSON or `order_id` is missing. Seen: "validation failed".
- **401** — [Unauthorized](#common-responses)
- **403** — [ApiDisabled](#common-responses)
- **404** `Error` — No such order in the store. Seen: "order not found".
- **409** `Error` — The order was not created through the API. Use `POST /orders/cancel-ship.json`. Seen: "order was not created via API".
- **422** `Error` — The order cannot be cancelled now: `order has already been cancelled`, `order is pending, please try again later`, `order cannot be cancelled in current status`, `partial cancellation is not allowed for paid orders`. Seen: "order has already been cancelled".
- **429** — [RateLimited](#common-responses)
- **500** `Error` — Nothing was cancelled. Also the answer when `lineitem_ids` names a line that is not on the order or is already cancelled. Seen: "failed to cancel order".

Examples:

Request `some_lines`:

```http
PATCH {base_url}/api/integration/orders/cancel.json
X-pawdo-access-token: <token>
Content-Type: application/json

{
  "order_id": "d689c4d1-f3dc-4c3b-ba65-ceb494ac0cec",
  "lineitem_ids": [
    "aad33abd-01be-4953-bd81-ed408da7ff6d"
  ]
}
```

Request `whole_order`:

```http
PATCH {base_url}/api/integration/orders/cancel.json
X-pawdo-access-token: <token>
Content-Type: application/json

{
  "order_id": "d689c4d1-f3dc-4c3b-ba65-ceb494ac0cec"
}
```

Answer **200**, `cancelled`:

```json
{"message":"order cancelled","status":true}
```

Answer **400**, `validation`:

```json
{
  "error": "validation failed: order_id is a required field",
  "message": "validation failed",
  "status": false
}
```

Answer **404**, `not_found`:

```json
{"message":"order not found","status":false}
```

Answer **409**, `not_api_order`:

```json
{"message":"order was not created via API","status":false}
```

Answer **422**, `already_cancelled`:

```json
{"message":"order has already been cancelled","status":false}
```

Answer **500**, `unknown_line`:

```json
{"message":"failed to cancel order","status":false}
```

### Order holds

Hold an order before Pawdo charges it, release it, or cancel it at any stage before it is handed to the
carrier. Works on orders of every source of the store (API, CSV, Shopify…), like the seller app's own
Hold / Resume / Cancel buttons.

#### `POST /api/integration/orders/hold.json`

**Hold an order before it is charged** · `holdOrder` · needs API access

Puts an order on hold (`fulfillment_status: on_hold`) so Pawdo does not charge or produce it until you
release it. Possible while the order is not charged yet — `cs_hold.can_hold` tells you. After that the
answer is 409 with `cs_hold`, and the way out is `POST /orders/cancel-ship.json`.

Idempotent: holding a held order answers `already_held` and keeps the first reason. Pawdo does not release
a hold by itself, `until` is informative.

Request body (JSON, required): [`HoldRequest`](#type-holdrequest).

Responses:

- **200** `HoldResultEnvelope` — `data.result` is `held` or `already_held`.
- **400** — [HoldBadRequest](#common-responses)
- **401** — [Unauthorized](#common-responses)
- **403** — [ApiDisabled](#common-responses)
- **404** — [HoldOrderNotFound](#common-responses)
- **409** `HoldResultEnvelope` — The order cannot be held. `error_code`: `ALREADY_IN_PRODUCTION` (charged — `cs_hold.cancel_kind` says what a cancel would do), `ALREADY_SHIPPED`, `ORDER_CANCELLED`, `ORDER_EXTERNAL`, `NOT_HOLDABLE` (status `error`), `AMBIGUOUS_ORDER` (`order_number` matches several orders: send `order_id`, the candidates are in `data.order_ids`). `data.cs_hold` is the order's current state. Seen: `ALREADY_IN_PRODUCTION` ("the order is in production; it can no longer be held, only cancelled (cancel-ship)"); `ALREADY_SHIPPED` ("the order has been handed to the carrier"); `ORDER_CANCELLED` ("the order is cancelled").
- **422** `Error` — `VALIDATION_FAILED`: a field is missing or not allowed. Seen: `VALIDATION_FAILED` ("validation failed: reason must be one of [design variant cancel address other check customer agency leader]").
- **429** — [RateLimited](#common-responses)
- **500** — [HoldServerError](#common-responses)

Examples:

Request `by_order_number`:

```http
POST {base_url}/api/integration/orders/hold.json
X-pawdo-access-token: <token>
Content-Type: application/json

{
  "order_number": "DOCS-185527-H",
  "reason": "design",
  "note": "Buyer is sending a new photo",
  "requested_by": "cs@shop.example",
  "reference": "CS-1234",
  "until": "2026-11-20T00:00:00Z"
}
```

Answer **200**, `held`:

```json
{
  "data": {
    "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
    "order_number": "DOCS-185527-H",
    "order_code": "PD290-9320",
    "result": "held",
    "hold": {
      "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
      "reason": "design",
      "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
      "note": "Buyer is sending a new photo",
      "source": "cs-hub",
      "requested_by": "cs@shop.example",
      "reference": "CS-1234",
      "until": "2026-11-20T00:00:00Z",
      "held_at": "2026-11-10T11:55:35.883986163Z",
      "released_at": null
    },
    "cs_hold": {
      "stage": "on_hold",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": {
        "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
        "reason": "design",
        "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
        "note": "Buyer is sending a new photo",
        "source": "cs-hub",
        "requested_by": "cs@shop.example",
        "reference": "CS-1234",
        "until": "2026-11-20T00:00:00Z",
        "held_at": "2026-11-10T11:55:35.883986Z",
        "released_at": null
      }
    }
  },
  "message": "order on hold",
  "status": true
}
```

Answer **200**, `already_held`:

```json
{
  "data": {
    "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
    "order_number": "DOCS-185527-H",
    "order_code": "PD290-9320",
    "result": "already_held",
    "hold": {
      "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
      "reason": "design",
      "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
      "note": "Buyer is sending a new photo",
      "source": "cs-hub",
      "requested_by": "cs@shop.example",
      "reference": "CS-1234",
      "until": "2026-11-20T00:00:00Z",
      "held_at": "2026-11-10T11:55:35.883986Z",
      "released_at": null
    },
    "cs_hold": {
      "stage": "on_hold",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": {
        "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
        "reason": "design",
        "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
        "note": "Buyer is sending a new photo",
        "source": "cs-hub",
        "requested_by": "cs@shop.example",
        "reference": "CS-1234",
        "until": "2026-11-20T00:00:00Z",
        "held_at": "2026-11-10T11:55:35.883986Z",
        "released_at": null
      }
    }
  },
  "message": "the order is already on hold",
  "status": true
}
```

Answer **409**, `already_in_production`:

```json
{
  "data": {
    "order_id": "6321be4b-5079-4dbb-9d56-52a997129efc",
    "order_number": "#1002",
    "order_code": "PD290-9249",
    "hold": null,
    "cs_hold": {
      "stage": "in_production",
      "production_started": true,
      "can_hold": false,
      "can_cancel": true,
      "cancel_kind": "cancel-produce",
      "hold": null
    }
  },
  "error_code": "ALREADY_IN_PRODUCTION",
  "message": "the order is in production; it can no longer be held, only cancelled (cancel-ship)",
  "status": false
}
```

Answer **409**, `already_shipped`:

```json
{
  "data": {
    "order_id": "5e365b1d-16c0-4335-90a3-eb38024241a5",
    "order_number": "#1001",
    "order_code": "PD290-8958",
    "hold": null,
    "cs_hold": {
      "stage": "shipped",
      "production_started": true,
      "can_hold": false,
      "can_cancel": false,
      "cancel_kind": "",
      "hold": null
    }
  },
  "error_code": "ALREADY_SHIPPED",
  "message": "the order has been handed to the carrier",
  "status": false
}
```

Answer **409**, `cancelled`:

```json
{
  "data": {
    "order_id": "a46eaeeb-c930-4c45-95d3-dbdfdaba4275",
    "order_number": "#1003",
    "order_code": "PD290-8015",
    "hold": null,
    "cs_hold": {
      "stage": "cancelled",
      "production_started": false,
      "can_hold": false,
      "can_cancel": false,
      "cancel_kind": "",
      "hold": null
    }
  },
  "error_code": "ORDER_CANCELLED",
  "message": "the order is cancelled",
  "status": false
}
```

Answer **422**, `bad_reason`:

```json
{
  "error_code": "VALIDATION_FAILED",
  "message": "validation failed: reason must be one of [design variant cancel address other check customer agency leader]",
  "status": false
}
```

#### `POST /api/integration/orders/release.json`

**Release a hold** · `releaseOrder` · needs API access

Ends a hold placed with `POST /orders/hold.json`. `outcome` is required — Pawdo never guesses:

| `outcome` | Pawdo does | `data.result` |
|---|---|---|
| `continue` / `changed` | resumes the order and validates it again (prices included); it is charged on schedule | `resumed` |
| `continue` / `changed`, the order was also held by someone in Pawdo | closes your hold, the order stays on hold | `released_kept` |
| `continue` / `changed`, Pawdo already lifted the hold | closes your hold | `released_not_held` |
| `cancel` | closes the hold and cancels the order as `POST /orders/cancel-ship.json` does | `cancelled` |

`changed` means the buyer's change was already made in Pawdo — through `PATCH /orders/{order_id}.json` for an
API order, or the seller app — before the release. Releasing twice answers `already_released`.

Request body (JSON, required): [`ReleaseRequest`](#type-releaserequest).

Responses:

- **200** `HoldResultEnvelope` — `data.result`: `resumed`, `released_kept`, `released_not_held`, `cancelled` or `already_released`.
- **400** — [HoldBadRequest](#common-responses)
- **401** — [Unauthorized](#common-responses)
- **403** — [ApiDisabled](#common-responses)
- **404** — [HoldOrderNotFound](#common-responses)
- **409** `HoldResultEnvelope` — `NOT_ON_HOLD`: the order never had a hold of yours. With `outcome: cancel`, the cancel codes of `POST /orders/cancel-ship.json` — the hold is then kept. `AMBIGUOUS_ORDER` as for hold. Seen: `NOT_ON_HOLD` ("the order has no hold to release").
- **422** `Error` — `VALIDATION_FAILED`. Seen: `VALIDATION_FAILED` ("validation failed: outcome is a required field").
- **429** — [RateLimited](#common-responses)
- **500** — [HoldServerError](#common-responses)

Examples:

Request `continue`:

```http
POST {base_url}/api/integration/orders/release.json
X-pawdo-access-token: <token>
Content-Type: application/json

{
  "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
  "outcome": "continue",
  "note": "Buyer kept the design",
  "requested_by": "cs@shop.example"
}
```

Request `cancel`:

```http
POST {base_url}/api/integration/orders/release.json
X-pawdo-access-token: <token>
Content-Type: application/json

{
  "order_id": "23284439-f4f6-460a-bfe1-bb90b494aa54",
  "outcome": "cancel",
  "note": "Buyer cancelled",
  "requested_by": "cs@shop.example"
}
```

Answer **200**, `resumed`:

```json
{
  "data": {
    "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
    "order_number": "DOCS-185527-H",
    "order_code": "PD290-9320",
    "result": "resumed",
    "hold": {
      "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
      "reason": "design",
      "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
      "note": "Buyer is sending a new photo",
      "source": "cs-hub",
      "requested_by": "cs@shop.example",
      "reference": "CS-1234",
      "until": "2026-11-20T00:00:00Z",
      "held_at": "2026-11-10T11:55:35.883986Z",
      "released_at": "2026-11-10T11:55:35.920654194Z",
      "release_outcome": "continue",
      "release_note": "Buyer kept the design",
      "released_by": "cs@shop.example"
    },
    "cs_hold": {
      "stage": "pre_production",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": null
    }
  },
  "message": "hold released",
  "status": true
}
```

Answer **200**, `already_released`:

```json
{
  "data": {
    "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
    "order_number": "DOCS-185527-H",
    "order_code": "PD290-9320",
    "result": "already_released",
    "hold": {
      "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
      "reason": "design",
      "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
      "note": "Buyer is sending a new photo",
      "source": "cs-hub",
      "requested_by": "cs@shop.example",
      "reference": "CS-1234",
      "until": "2026-11-20T00:00:00Z",
      "held_at": "2026-11-10T11:55:35.883986Z",
      "released_at": "2026-11-10T11:55:35.920654Z",
      "release_outcome": "continue",
      "release_note": "Buyer kept the design",
      "released_by": "cs@shop.example"
    },
    "cs_hold": {
      "stage": "pre_production",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": null
    }
  },
  "message": "the hold is already released",
  "status": true
}
```

Answer **200**, `cancelled`:

```json
{
  "data": {
    "order_id": "23284439-f4f6-460a-bfe1-bb90b494aa54",
    "order_number": "DOCS-185527-R",
    "order_code": "PD290-9321",
    "result": "cancelled",
    "hold": {
      "id": "f44163b6-8a8a-4409-8d39-e6b8ce6f90e3",
      "reason": "cancel",
      "reason_label": "Khách cân nhắc huỷ đơn",
      "note": "",
      "source": "cs-hub",
      "requested_by": "cs@shop.example",
      "reference": "",
      "until": null,
      "held_at": "2026-11-10T11:55:36.239542Z",
      "released_at": "2026-11-10T11:55:36.251817414Z",
      "release_outcome": "cancel",
      "release_note": "Buyer cancelled",
      "released_by": "cs@shop.example"
    },
    "cancel_kind": "cancel",
    "cs_hold": {
      "stage": "cancelled",
      "production_started": false,
      "can_hold": false,
      "can_cancel": false,
      "cancel_kind": "",
      "hold": null
    }
  },
  "message": "hold released",
  "status": true
}
```

Answer **409**, `not_on_hold`:

```json
{
  "data": {
    "order_id": "f4a795d5-8c5b-4c33-a987-b5640f87857b",
    "order_number": "DOCS-185527-A",
    "order_code": "PD290-9318",
    "hold": null,
    "cs_hold": {
      "stage": "pre_production",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": null
    }
  },
  "error_code": "NOT_ON_HOLD",
  "message": "the order has no hold to release",
  "status": false
}
```

Answer **422**, `missing_outcome`:

```json
{
  "error_code": "VALIDATION_FAILED",
  "message": "validation failed: outcome is a required field",
  "status": false
}
```

#### `POST /api/integration/orders/cancel-ship.json`

**Cancel an order at any stage before shipping** · `cancelShipOrder` · needs API access

Cancels an order of any source, as the seller app's Cancel button: Pawdo will not deliver it and refunds
the fulfillment charge to the store balance — including items already produced. `data.cancel_kind` says
what happened, `data.refund_amount` what was refunded (absent when nothing was charged), `data.items`
what became of each item:

| Stage (`cs_hold.stage`) | `cancel_kind` | Items |
|---|---|---|
| `pre_production`, `on_hold`, `error` (not charged) | `cancel` | none yet |
| `fulfilling` (charged, no item yet) | `cancel` | none |
| `fulfilling` / `in_production` (items exist) | `cancel-produce` or `cancel-ship` | `cancel-produce`: not made; `cancel-ship`: made or being made, not shipped |
| `shipped` | — | 409 `ALREADY_SHIPPED`, nothing changes |

A hold of yours on the order is closed. Idempotent: a second call answers `already_cancelled` and refunds
nothing more.

Request body (JSON, required): [`CancelShipRequest`](#type-cancelshiprequest).

Responses:

- **200** `HoldResultEnvelope` — `data.result` is `cancelled` or `already_cancelled`.
- **400** — [HoldBadRequest](#common-responses)
- **401** — [Unauthorized](#common-responses)
- **403** — [ApiDisabled](#common-responses)
- **404** — [HoldOrderNotFound](#common-responses)
- **409** `HoldResultEnvelope` — `ALREADY_SHIPPED`, `ORDER_BUSY` (`pending`: being sent to production right now — retry in a minute), `ORDER_EXTERNAL`, `NOT_CANCELLABLE`, `AMBIGUOUS_ORDER`. `data.cs_hold` is the current state. Seen: `ALREADY_SHIPPED` ("the order has been handed to the carrier and can no longer be cancelled").
- **422** `Error` — `VALIDATION_FAILED`, or `NO_STORE_OWNER` (the store has no owner account to cancel as — contact Pawdo). Seen: `VALIDATION_FAILED` ("validation failed: order_id is a required field, order_number is a required field").
- **429** — [RateLimited](#common-responses)
- **500** — [HoldServerError](#common-responses)

Examples:

Request `cancel`:

```http
POST {base_url}/api/integration/orders/cancel-ship.json
X-pawdo-access-token: <token>
Content-Type: application/json

{
  "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
  "reason": "cancel",
  "note": "Buyer changed their mind",
  "requested_by": "cs@shop.example",
  "reference": "CS-1234"
}
```

Answer **200**, `not_charged`:

```json
{
  "data": {
    "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
    "order_number": "DOCS-185527-H",
    "order_code": "PD290-9320",
    "result": "cancelled",
    "hold": null,
    "cancel_kind": "cancel",
    "cs_hold": {
      "stage": "cancelled",
      "production_started": false,
      "can_hold": false,
      "can_cancel": false,
      "cancel_kind": "",
      "hold": null
    }
  },
  "message": "order cancelled",
  "status": true
}
```

Answer **200**, `in_production_refunded`:

```json
{
  "data": {
    "order_id": "a2b05603-3d78-470f-bd3e-8bbe9f88acaa",
    "order_number": "#1004",
    "order_code": "PD290-9313",
    "result": "cancelled",
    "hold": null,
    "cancel_kind": "cancel-produce",
    "refund_amount": 20,
    "items": [
      {
        "id": "05e9c08d-3fe9-4cc4-9a77-4f429c5511d0",
        "print_code": 2572833,
        "sku": "SOC-M",
        "status": "cancel-produce",
        "cancelled_at": "2026-11-10T11:55:36.326938Z"
      },
      {
        "id": "2a8cf2ca-447c-460a-a353-e23e1f06ceca",
        "print_code": 2572834,
        "sku": "GP-L1",
        "status": "cancel-produce",
        "cancelled_at": "2026-11-10T11:55:36.326938Z"
      }
    ],
    "cs_hold": {
      "stage": "cancelled",
      "production_started": false,
      "can_hold": false,
      "can_cancel": false,
      "cancel_kind": "",
      "hold": null
    }
  },
  "message": "order cancelled",
  "status": true
}
```

Answer **200**, `already_cancelled`:

```json
{
  "data": {
    "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
    "order_number": "DOCS-185527-H",
    "order_code": "PD290-9320",
    "result": "already_cancelled",
    "hold": null,
    "cs_hold": {
      "stage": "cancelled",
      "production_started": false,
      "can_hold": false,
      "can_cancel": false,
      "cancel_kind": "",
      "hold": null
    }
  },
  "message": "the order is already cancelled",
  "status": true
}
```

Answer **409**, `already_shipped`:

```json
{
  "data": {
    "order_id": "bf3a4e8f-1bdf-4046-a375-5b82ff9dd030",
    "order_number": "#1005",
    "order_code": "PD290-8873",
    "hold": null,
    "cs_hold": {
      "stage": "shipped",
      "production_started": true,
      "can_hold": false,
      "can_cancel": false,
      "cancel_kind": "",
      "hold": null
    }
  },
  "error_code": "ALREADY_SHIPPED",
  "message": "the order has been handed to the carrier and can no longer be cancelled",
  "status": false
}
```

Answer **422**, `missing_order`:

```json
{
  "error_code": "VALIDATION_FAILED",
  "message": "validation failed: order_id is a required field, order_number is a required field",
  "status": false
}
```

---

## 9. Data types

Every object of the routes above as a TypeScript declaration.

- **Request types** (bodies you send, and the types inside them): a field without `?` is required; a field with `?`
  may be left out.
- **Response and webhook types** have no `?`: they list the fields Pawdo sends. Pawdo does not promise every field on
  every answer — treat a missing field like an empty one, and ignore fields not listed here.
- `T | null` may be `null`. A union of string literals lists every value Pawdo accepts or sends today; a client
  should still tolerate a new value in a response.
- Comments carry each field's meaning and limits (`maxLength`, `minimum`, `default`, …).

```ts
type uuid = string;     // e.g. "f4a795d5-8c5b-4c33-a987-b5640f87857b"
type datetime = string; // RFC 3339 in UTC, e.g. "2026-11-10T11:55:34.71384Z"; the number of fractional digits varies
type date = string;     // calendar date "YYYY-MM-DD"
type url = string;      // absolute http(s) URL
type integer = number;  // a whole number
```

### Type `Envelope`

Used by: `POST /api/integration/orders.json` (response), `GET /api/integration/orders/query.json` (response), `PATCH /api/integration/orders/{order_id}.json` (response), `PATCH /api/integration/orders/cancel.json` (response).

```ts
interface Envelope {
  /** `true` on success. */
  status: boolean;
  message: string;
  /** The payload. Its shape depends on the route. */
  data: unknown;
  /** On list routes, the number of rows across all pages. */
  total: integer;
}
```

### Type `Error`

```ts
interface Error {
  status: false;
  /** What went wrong. Meant for people; branch on the HTTP status and `error_code`. */
  message: string;
  /** A stable code, on the routes that have one: see the error code index (section 7). */
  error_code: string;
  /** Extra detail on some 400 answers. */
  error: string;
  /**
   * On some refusals: the problems (`GET /orders/query.json`), or the order's current state (`cs_hold`) on hold routes.
   */
  data: unknown;
}
```

### Type `Store`

Used by: `GET /api/integration/store/info.json` (response).

```ts
interface Store {
  id: uuid;
  name: string;
  /** e.g. "active" */
  status: string;
  /** The owner account. */
  user_id: uuid;
  phone: string;
  support_email: string;
  /** e.g. "USD" */
  currency: string;
  fulfillment_type: "pod" | "dropship";
  allow_public_api: boolean;
  /** A feature switch of the store; the routes of this file do not use it. */
  allow_pick_stock: boolean;
  /** A feature switch of the store; the routes of this file do not use it. */
  allow_pack_return: boolean;
  created_at: datetime;
  updated_at: datetime;
  /** The store owner. */
  admin: {
    id: uuid;
    name: string;
    email: string;
    phone: string;
    status: string;
  };
}
```

### Type `Address`

Used in: [`OrderCreate`](#type-ordercreate), [`OrderUpdate`](#type-orderupdate), [`Order`](#type-order).

```ts
interface Address {
  name?: string;
  /** Shipping option code, e.g. `standard`, `express`. Lowercased. */
  option_ship?: string;
  /** URL of a shipping label you provide, if any. */
  label_ship?: string;
  address1?: string;
  address2?: string;
  city?: string;
  state?: string;
  /** e.g. "CA" */
  province_code?: string;
  country?: string;
  /** e.g. "US" */
  country_code?: string;
  postal_code?: string;
  email?: string;
  phone?: string;
  tax_number?: string;
  /** Present on some imported orders. Not read in a request body: send `tax_number`. */
  tax?: number;
}
```

### Type `DesignSlot`

Used in: [`OrderLineCreate`](#type-orderlinecreate), [`OrderUpdate`](#type-orderupdate), [`OrderDetail`](#type-orderdetail).

```ts
interface DesignSlot {
  /**
   * The print area: `design1` … `design15`, as the product's design requirements name them.
   * e.g. "design1"
   */
  key?: string;
  /** Artwork file URL. */
  design?: url;
  /** Mockup image URL. */
  mockup?: url;
}
```

### Type `OrderCreate`

Used by: `POST /api/integration/orders.json` (request).

```ts
interface OrderCreate {
  /** Your order number. Unique within the store across every source. */
  order_number: string;
  order_note?: string;
  /** Your payment / transaction reference, copied onto every line. */
  external_transaction_id?: string;
  /**
   * `true`: Pawdo does not verify the address and treats it as valid.
   * default false
   */
  skip_verify_address?: boolean;
  /** Required inside: `name`, `option_ship`, `address1`, `province_code`, `country_code`, `postal_code`. */
  address: Address & Required<Pick<Address, "name" | "option_ship" | "address1" | "province_code" | "country_code" | "postal_code">>;
  /** minItems 1 · maxItems 500 */
  line_items: OrderLineCreate[];
}
```

### Type `OrderLineCreate`

Used in: [`OrderCreate`](#type-ordercreate).

```ts
interface OrderLineCreate {
  /** The Pawdo SKU (variant, alias or combo of your catalog). */
  system_sku: string;
  /** minimum 1 · maximum 999 */
  quantity: integer;
  /** Your own SKU, kept for reference. */
  sku?: string;
  /** Default: `<catalog name> - <variant title>`. */
  title?: string;
  note?: string;
  tags?: string[];
  designs?: DesignSlot[];
  /**
   * Older flat form of `designs`: `design1`…`design15` and `mockup1`…`mockup15`. Ignored when `designs` is sent.
   */
  design1?: string;
  mockup1?: string;
  /** Overrides the variant's option 1. */
  option1?: string;
  /** Taken only when `option1` is also sent. */
  option2?: string;
  /** Taken only when `option1` is also sent. */
  option3?: string;
  external_line_item_id?: string;
  brand_code?: string;
  ring_code?: string;
}
```

### Type `OrderUpdate`

Used by: `PATCH /api/integration/orders/{order_id}.json` (request).

```ts
interface OrderUpdate {
  skip_verify_address?: boolean;
  shipping_address?: Address;
  line_items?: Array<{
    /** The line item id. */
    id: uuid;
    system_sku: string;
    /** minimum 1 · maximum 999 */
    quantity: integer;
    sku?: string;
    title?: string;
    /** Replaces the stored note; omitted clears it. */
    note?: string;
    designs?: DesignSlot[];
  }>;
}
```

### Type `Order`

Used by: `GET /api/integration/order.json` (response).
Used in: [`OrderDetail`](#type-orderdetail).

```ts
interface Order {
  id: uuid;
  store_id: uuid;
  external_order_id: string;
  external_transaction_id: string;
  order_number: string;
  /** Pawdo's order code. */
  order_code: string;
  /**
   * Where the order came from: `api`, `csv`, `shopify`…
   * e.g. "api"
   */
  source_type: string;
  /**
   * `unfulfilled` new, being validated · `on_hold` held · `ready` valid, waiting for the charge ·
   * `payment_awaiting` waiting for balance · `paid` charged · `pending` being sent to production ·
   * `awaiting` sent to production · `processing` in production · `ship-out` handed to the carrier ·
   * `delivered` · `pickup` waiting at a carrier office · `exception` carrier problem · `cancel`,
   * `cancel-produce`, `cancel-ship`, `cancel-shipout` cancelled (before / during / after production) ·
   * `error` could not be sent to production · `external` fulfilled outside Pawdo.
   */
  fulfillment_status: "unfulfilled" | "on_hold" | "ready" | "payment_awaiting" | "paid" | "pending" | "awaiting" | "processing" | "ship-out" | "delivered" | "pickup" | "exception" | "cancel" | "cancel-produce" | "cancel-ship" | "cancel-shipout" | "error" | "external";
  design_status: "missing" | "invalid_dim" | "error" | "incompleted" | "completed";
  design_validate_message: string;
  validate_address: "pending" | "valid" | "invalid" | "exception";
  address_validate_message: string;
  tracking_status: "missing" | "incompleted" | "completed";
  skip_verify_address: boolean;
  shipping_address: Address;
  note: string;
  /** What Pawdo charges for the order. */
  fulfillment_cost: number;
  base_cost: number;
  fulfillment_shipping: number;
  fulfillment_type: string;
  is_have_ticket: boolean;
  processed_at: datetime;
  created_at: datetime;
  updated_at: datetime;
}
```

### Type `OrderDetail`

Used by: `GET /api/integration/orders/query.json` (response).

```ts
type OrderDetail = Order & {
  line_items: Array<{
    id: uuid;
    order_id: uuid;
    system_sku: string;
    sku: string;
    title: string;
    quantity: integer;
    option1: string;
    option2: string;
    option3: string;
    tags: string[];
    external_line_item_id: string;
    external_transaction_id: string;
    /** Base cost of the line, once priced. */
    total_basecost: number;
    created_at: datetime;
    updated_at: datetime;
    /** `pending` while Pawdo validates the line. */
    status: "open" | "pending" | "invalid_sku" | "design_error" | "cancel";
    /** Why the line failed validation (`invalid_sku`, `design_error`). Empty otherwise. */
    system_message: string;
    note: string;
    designs: DesignSlot[] | null;
    cancelled_at: datetime | null;
    /** One per unit in production, once the order is charged. */
    item_fulfills: Array<{
      id: uuid;
      variant_code: string;
      note: string;
      /** `cannot-cancel` once shipped. */
      cancel_status: string;
      created_at: datetime;
      updated_at: datetime;
      quantity: integer;
      status: string;
      production_at: datetime | null;
      shipped_at: datetime | null;
      shipping_carrier: string;
      /** The tracking the buyer follows. */
      tracking_code: string;
      /** Lastmile tracking, when the warehouse hands the parcel to another carrier. Empty otherwise. */
      handoff_tracking_code: string;
      handoff_shipping_carrier: string;
      cancel_at: datetime | null;
    }>;
  }>;
  cs_hold: CsHold;
};
```

### Type `CsHold`

Used in: [`OrderDetail`](#type-orderdetail), [`HoldResult`](#type-holdresult).

```ts
/** Where the order stands for holding and cancelling. Absent if it could not be read. */
interface CsHold {
  stage: "pre_production" | "on_hold" | "error" | "fulfilling" | "in_production" | "shipped" | "cancelled" | "external" | "unknown";
  /** Items are being (or were) produced. */
  production_started: boolean;
  can_hold: boolean;
  can_cancel: boolean;
  /** What a cancel would do now. */
  cancel_kind: "cancel" | "cancel-produce" | "cancel-ship" | "";
  hold: OrderHold;
}
```

### Type `OrderHold`

Used in: [`CsHold`](#type-cshold), [`HoldResult`](#type-holdresult).

```ts
/** A hold placed through this API. `null` when there is none. */
interface OrderHold {
  id: uuid;
  reason: string;
  reason_label: string;
  note: string;
  source: string;
  requested_by: string;
  reference: string;
  until: datetime | null;
  held_at: datetime;
  released_at: datetime | null;
  release_outcome: string;
  release_note: string;
  released_by: string;
} // may be null
```

### Type `HoldTarget`

Used in: [`HoldRequest`](#type-holdrequest), [`ReleaseRequest`](#type-releaserequest), [`CancelShipRequest`](#type-cancelshiprequest).

```ts
interface HoldTarget {
  /** Required without `order_number`. */
  order_id?: uuid;
  /**
   * Required without `order_id`. Tried as sent, then with / without a leading `#`.
   * maxLength 255
   */
  order_number?: string;
  /**
   * Who asked, free text (e.g. the agent's email).
   * maxLength 255
   */
  requested_by?: string;
  /**
   * Free label of the calling system.
   * maxLength 32 · default "cs-hub"
   */
  source?: string;
}
```

### Type `HoldRequest`

Used by: `POST /api/integration/orders/hold.json` (request).

```ts
type HoldRequest = HoldTarget & {
  reason: "design" | "variant" | "cancel" | "address" | "other" | "check" | "customer" | "agency" | "leader";
  /** maxLength 2000 */
  note?: string;
  /**
   * Your ticket id.
   * maxLength 64
   */
  reference?: string;
  /** When you expect to release it. Informative only. */
  until?: datetime;
};
```

### Type `ReleaseRequest`

Used by: `POST /api/integration/orders/release.json` (request).

```ts
type ReleaseRequest = HoldTarget & {
  outcome: "continue" | "changed" | "cancel";
  /** maxLength 2000 */
  note?: string;
};
```

### Type `CancelShipRequest`

Used by: `POST /api/integration/orders/cancel-ship.json` (request).

```ts
type CancelShipRequest = HoldTarget & {
  reason: "design" | "variant" | "cancel" | "address" | "other" | "check" | "customer" | "agency" | "leader";
  /** maxLength 2000 */
  note?: string;
  /** maxLength 64 */
  reference?: string;
};
```

### Type `HoldResult`

Used in: [`HoldResultEnvelope`](#type-holdresultenvelope).

```ts
interface HoldResult {
  order_id: uuid;
  order_number: string;
  order_code: string | null;
  result: "held" | "already_held" | "resumed" | "released_kept" | "released_not_held" | "already_released" | "cancelled" | "already_cancelled";
  hold: OrderHold;
  cancel_kind: string;
  /** Refunded to the store balance by this cancel. Absent when nothing was charged. */
  refund_amount: number;
  items: Array<{
    id: uuid;
    print_code: integer;
    sku: string;
    status: "cancel-produce" | "cancel-ship";
    cancelled_at: datetime | null;
  }>;
  cs_hold: CsHold;
  /** On `AMBIGUOUS_ORDER` only. */
  order_ids: uuid[];
}
```

### Type `HoldResultEnvelope`

Used by: `POST /api/integration/orders/hold.json` (response), `POST /api/integration/orders/release.json` (response), `POST /api/integration/orders/cancel-ship.json` (response).

```ts
interface HoldResultEnvelope {
  status: boolean;
  message: string;
  /** On a refusal. */
  error_code: string;
  data: HoldResult;
}
```

### Type `WebhookPing`

Used by: webhook `webhook.ping`.

```ts
interface WebhookPing {
  type: "webhook.ping";
  message: string;
}
```

---

## 10. Webhook events

The events of this file. How to subscribe, the request headers, how to verify the signature, and the answer / retry
rules are in [section 6](#6-webhooks); they are the same for every event. A webhook with no event ticked receives
every event of the store, including kinds this file does not describe and kinds added later: branch on the
`X-NextFF-Event` header, answer 2xx to events you do not handle, and ignore them.

| `X-NextFF-Event` | Sent when | Body |
|---|---|---|
| `order.status_changed` | Something about one of the store's orders changed — [when exactly](#orderstatus_changed) | [`OrderStatusChangedEvent`](#event-orderstatus_changed) |
| `webhook.ping` | Test event | [`WebhookPing`](#type-webhookping) |

### Event `order.status_changed`

When it is sent, and what to do with it: [section 6](#orderstatus_changed).

```ts
interface OrderStatusChangedEvent {
  /** Always "order_update". Branch on the X-NextFF-Event header, not on this field. */
  type: "order_update";
  /** The order's `order_number` — yours, as sent or imported. */
  reference_id: string;
  /** Pawdo's order id: pass it to GET /orders/query.json?id=… */
  order_id: uuid;
}
```

A delivery, signed with the test secret of [Verify the signature](#verify-the-signature):

```http
POST /hooks/pawdo HTTP/1.1
Content-Type: application/json
X-NextFF-Event: order.status_changed
X-NextFF-Delivery: d31fbcfb-0fa8-42d0-b347-76f36ebe9414
X-NextFF-Timestamp: 1794320216
X-NextFF-Signature: sha256=e3beac478f0f6cc276d63a55f93492f49d6d90f1b14a9db06d89a5a995db7088

{"type":"order_update","reference_id":"DOCS-185527-A","order_id":"f4a795d5-8c5b-4c33-a987-b5640f87857b"}
```

### Event `webhook.ping`

Sent by **Send test event** in the seller app, signed like every other delivery.

Body: [`WebhookPing`](#type-webhookping).

Example `ping`:

```json
{"message":"This is a test webhook delivery","type":"webhook.ping"}
```

---

## 11. Changes from the previous Postman collection

The previous Postman collection (`integration`) describes an older state of these routes. Code written from it must
change as follows; everything else in this file applies too.

### Removed: `POST /api/integration/orders/import.json`

The bulk import route (several orders in one `data` array) was removed on 2026-07-08 and answers 404. Send each order
to [`POST /api/integration/orders.json`](#create-an-order--post-apiintegrationordersjson). Its body is not an import
row: the address goes in `address`, the products in `line_items[]`.

### New: hold, release, cancel-ship

[`POST /orders/hold.json`](#hold--post-apiintegrationordersholdjson),
[`POST /orders/release.json`](#release--post-apiintegrationordersreleasejson) and
[`POST /orders/cancel-ship.json`](#cancel-ship--post-apiintegrationorderscancel-shipjson) hold an order for customer
service, release it (continue or cancel), or cancel it at any stage before it is handed to the carrier
([section 5](#5-order-holds-and-cancel-ship)).

### Authentication and limits

- The header is unchanged: `X-pawdo-access-token`, without `Bearer`. Tokens are now created by the seller in the
  Pawdo seller app, **Integrations → API** (`pdat_…`, shown once, up to 20 per store); tokens issued before keep
  working.
- New: 800 requests per minute per store; over it, HTTP 429 with `Retry-After` ([rate limit](#rate-limit)).
- The collection's `{{DOMAIN}}` is `{base_url}` in this file.

### `POST /api/integration/orders.json`

- Required, though the collection did not say so: `line_items[].system_sku`, `address.address1`,
  `address.province_code` and `address.postal_code`. A missing one answers 400.
- `address.tax` (a number) is no longer read: send `address.tax_number` (a string). A `tax` field is ignored, with
  no error.
- New optional fields: `order_note`; per line `tags`, `brand_code`, `ring_code`, and `designs` — the print areas as
  `[{key, design, mockup}]` (`key` = `design1`, `design2`, …), which replaces the flat `design1` / `mockup1` fields.
  The flat form is still read when `designs` is absent, up to `design15` / `mockup15` (the collection showed 1–4).
- Fixed answers: a duplicate `order_number` → 409 `order existed`; an unsupported `option_ship` → 400; an unknown
  SKU → 422.

### `PATCH /api/integration/orders/{order_id}.json`

- Only orders created through the API can be changed: an order of another source answers 409, another store's
  order 404.
- Only while the order is `unfulfilled`, `on_hold`, `ready` or `payment_awaiting`; later, 400
  `order cannot be updated in its current fulfillment status`.
- Every line sent must carry `quantity`. In `shipping_address`, `tax` is now `tax_number` (a string).

### `PATCH /api/integration/orders/cancel.json`

- Same body: `order_id`, plus `lineitem_ids` to cancel only some lines.
- Only orders created through the API (409 otherwise); another store's order answers 404. Cancelling an order already
  cancelled answers 422 `order has already been cancelled`.

### `GET /api/integration/orders/query.json`

- New fields in the answer: `cs_hold` (the order's hold), `designs`, `handoff_tracking_code`.
- Send `id` or `order_name`; with neither the answer is 400, and its message has changed — rely on the status.

### `GET /api/integration/order.json`

- Same parameters. `page` defaults to 1 and `limit` to 10, at most 1000.
- `fulfillment_status` takes one status or several separated by commas (`ready,unfulfilled`): the values of
  [section 4](#4-orders).
- `start_time` / `end_time`, and `start_time_ship` / `end_time_ship`, apply only when both ends are sent, as RFC 3339
  with a time and a zone (`2026-11-01T00:00:00Z`). A date without time is not rejected: the list comes back empty.

### `GET /api/integration/store/info.json`

- `callback_api`, which the collection showed, is no longer used: webhooks replaced it. Ignore it if the answer
  still carries it.

### Webhooks

- Pawdo no longer posts to the store's `callback_api`. The seller adds webhooks in the seller app,
  **Integrations → Webhooks**: several URLs, the events each one receives, one secret per webhook. The old
  `callback_api` URL was turned into a webhook.
- The order event keeps its body — `type: "order_update"` and `reference_id` (your order number) — and adds
  `order_id`.
- Every delivery now carries `X-NextFF-Event` (`order.status_changed`), `X-NextFF-Delivery`, `X-NextFF-Timestamp`
  and `X-NextFF-Signature`: verify the signature ([how](#verify-the-signature)).
- The event is not sent for every change of an order ([when it is](#orderstatus_changed)): read the order on each
  event, and keep reading the list on a schedule.
- New: `webhook.ping`, sent by **Send test event** in the seller app.
