---
title: "Send up to 50 orders in"
method: POST
path: "/orders/batch"
tags: ["Orders"]
---

# Send up to 50 orders in

`POST /orders/batch`

## Request

- Base URL: `https://sitesplaced.com/api/v1`
- URL: `https://sitesplaced.com/api/v1/orders/batch`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Api-Key`

Secret key. Permission `orders:write`. One bad order never fails the batch. `backfill: true` means "this is history": no mobile push, no WhatsApp and no webhooks.

## Request body

- OrderBatchRequest
  - `orders` OrderInput[], required
    - `external_id` string, required: The order's id on the other system. Sending the same one again updates the order.
    - `number` string: The order number a shopper sees.
    - `status` string: Read according to `status_kind`.
    - `status_kind` 'woocommerce' | 'shopify' | 'sitesplaced': `woocommerce`: WooCommerce status slugs, with or without `wc-`. `shopify`: `open`, `partial`, `fulfilled` or `cancelled`. `sitesplaced`: the six order statuses, plus the aliases `delivered`, `fulfilled`, `processing`, `paid` and `canceled`. A connection key defaults to its platform; any other key defaults to `sitesplaced`.
    - `payment` object
      - `status` 'unpaid' | 'pending' | 'paid' | 'failed' | 'refunded' | 'partially_refunded': Send it. If it is missing the server guesses from the status.
      - `method` string
      - `method_title` string
      - `is_cod` boolean: True for cash on delivery. This is what turns on the COD risk flags.
      - `transaction_id` string
      - `refunded_amount` number
    - `currency` string
    - `totals` object, required
      - `total` number, required
      - `discount` number
      - `shipping` number
      - `cod_fee` number
      - `tax` number
    - `customer` object
      - `name` string
      - `email` string
      - `phone` string
      - `address_line1` string
      - `address_line2` string
      - `city` string
      - `state` string
      - `postcode` string
      - `country` string
    - `items` object[]: Up to 200 line items are kept.
      - `external_product_id` string
      - `name` string
      - `sku` string
      - `variant` string
      - `quantity` number
      - `unit_price` number
      - `image_url` string
    - `note` string
    - `tracking` object
      - `number` string, nullable
      - `courier` string, nullable
      - `url` string, nullable
    - `created_at` string, date-time: ISO 8601, in UTC.
    - `updated_at` string, date-time: Older than the copy SitesPlaced holds → ignored (`action: "unchanged"`).
    - `admin_url` string: The order's admin address on the other system.
    - `deleted` boolean: True archives the copy. It is never hard-deleted.
    - `test` boolean: True → skipped.
    - `delivered` boolean
  - `backfill` boolean: True means "this is history": no mobile push, no WhatsApp, no webhooks.

## Response `200`

One result per order.

- OrderBatchResult
  - `results` object[], required
    - `external_id` string, nullable, required
    - `ok` boolean, required
    - `action` 'created' | 'updated' | 'unchanged' | 'skipped'
    - `id` string, uuid
    - `error` string

## Other responses

- `400`: `invalid_request`. The request is malformed or a field has a bad value; `param` names the field.
- `401`: `unauthorized`. The key is missing, wrong or revoked.
- `403`: `forbidden`. The key may not do this: a secret key sent from a browser, a publishable key from a website not on its list, the wrong kind of key, or a missing permission.
- `413`: `payload_too_large`. Bodies can be up to 1 MB.
- `429`: `rate_limited`. Wait for `Retry-After` seconds.
- `500`: `internal_error`.
- `503`: `unavailable`.

---

[API](https://skmtc.dev/sitesplaced/apis/sitesplaced-developer-api.md) · [All operations](https://skmtc.dev/sitesplaced/apis/sitesplaced-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sitesplaced/apis/sitesplaced-developer-api/revisions/66fbfbbaad1a?raw)
