> ## Documentation Index
> Fetch the complete documentation index at: https://betterdatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Orders

> Import customer orders into SCM.

This endpoint accepts batched order payloads and creates or updates `dcmOrder` and
`dcmOrderLine` records for the authenticated organization.

## Import Orders

`POST /api/import/orders`

### Authentication

Pass an API key in the request header:

<ParamField body="x-api-key" type="string" required>
  Import API key with `import:write`, `import:read`, or `import:*` scope.
</ParamField>

### Request Body

<ParamField body="orders" type="array" required>
  Array of order rows to import.
</ParamField>

Each order row supports:

<ParamField body="orders[].externalOrderId" type="string" required>
  External order identifier used as the order ID.
</ParamField>

<ParamField body="orders[].lines" type="array" required>
  Order lines for the order.
</ParamField>

<ParamField body="orders[].lines[].skuId" type="string" required>
  Product SKU identifier.
</ParamField>

<ParamField body="orders[].lines[].quantity" type="number" required>
  Requested quantity for the line.
</ParamField>

<ParamField body="orders[].lines[].locationId" type="string" required>
  Source location code (stored as `{organizationId}-{locationId}`).
</ParamField>

### Success Response

`202 Accepted`

<ResponseField name="jobId" type="string">
  Created import job ID.
</ResponseField>

<ResponseField name="status" type="string">
  Always `ACCEPTED` when the job is accepted for processing.
</ResponseField>

<ResponseField name="rowCount" type="number">
  Number of received order rows.
</ResponseField>

### Validation Error

`400 Bad Request` when `orders[]` is missing or empty.

```json theme={null}
{
  "error": "orders[] is required"
}
```
