---
title: "POST /api/orders/"
method: POST
path: "/api/orders/"
tags: ["Orders"]
---

# POST /api/orders/

`POST /api/orders/`

Create an order for the current company, optionally with nested order lines (created atomically with the order). The order number must be unique within the company for the same order type — a duplicate returns 400 (order_number_already_existing).

## Request body

- object
  - `orderNumber` string, required
  - `orderSubType` 'STANDARD' | 'REPEAT' | 'COMMIT' | 'SAMPLE' | 'EXTRACTION_SPLIT'
  - `status` 'IN_PROGRESS' | 'IN_REVIEW' | 'COMPLETED'
  - `tags` string[]
  - `source` 'PUBLIC_API' | 'IMPORTER' | 'INTERNAL_API'
  - `buyerCompanyId` string, required
  - `supplierCompanyId` string, required
  - `receiverCompanyId` string
  - `vendorCompanyId` string
  - `factory` string
  - `buyerFacilityProcess` string
  - `supplierFacilityProcess` string
  - `receiverFacilityProcess` string
  - `orderDate` string, date
  - `deliveryDate` string, date
  - `agreedDeliveryDate` string, date
  - `expectedShippingDate` string, date
  - `shippingDate` string, date
  - `handoverDate` string, date
  - `actualDeliveryDate` string, date
  - `shipmentReference` string
  - `internalResponsiblePersons` string[]
  - `counterpartyOrderNumberRef` string
  - `tracingAttachmentTemplateId` string, nullable
  - `orderType` 'PURCHASE_ORDER' | 'SALES_ORDER' | 'INTERNAL_ORDER', nullable
  - `tracingStatus` string, nullable
  - `isArchived` boolean
  - `isAuto` boolean
  - `lines` object[]
    - `orderLineNumber` string
    - `styleId` string, required
    - `quantity` number, required
    - `unit` 'LITRE' | 'MILLILITRE' | 'CENTILITRE' | 'CUBIC_DECIMETRE' | 'CUBIC_METRE' | 'GALLON' | 'QUART' | 'PINT' | 'GILL' | 'FLUID_OUNCE' | 'FLUID_DRAM' | 'MINIM' | 'BUSHEL' | 'ACRE_FOOT' | 'CORD' | 'CUBIC_YARD' | 'CUBIC_FOOT' | 'CUBIC_INCH' | 'PECK' | 'METRE' | 'MILLIMETRE' | 'DECIMETRE' | 'CENTIMETRE' | 'INCH' | 'NAUTICAL_MILE' | 'MILE' | 'FURLONG' | 'ROD' | 'FATHOM' | 'YARD' | 'FOOT' | 'GRAM' | 'GRAM_PER_SQUARE_METER' | 'GRAM_PER_SQUARE_FOOT' | 'GRAM_PER_SQUARE_YARD' | 'OUNCE_PER_SQUARE_YARD' | 'MILLIGRAM' | 'KILOGRAM' | 'METRIC_TON' | 'POUNDS' | 'SHORT_TON' | 'LONG_TON' | 'HUNDREDWEIGHT' | 'SHORT_HUNDREDWEIGHT' | 'LONG_HUNDREDWEIGHT' | 'OUNCE' | 'DRAM' | 'GRAIN' | 'PENNYWEIGHT' | 'SCRUPLE' | 'STONE' | 'SQUARE_METRE' | 'SQUARE_DECIMETRE' | 'SQUARE_CENTIMETRE' | 'SQUARE_INCH' | 'SQUARE_MILE' | 'SQUARE_FEET' | 'SQUARE_ROD' | 'SQUARE_YARD' | 'ACRE' | 'PIECES' | 'PAIR' | 'PERCENTAGE' | 'DENIER' | 'JUTE' | 'ENGLISH_COUNT' | 'METRIC_COUNT' | 'WORSTED_COUNT' | 'TEX' | 'KILOWATT_HOUR' | 'MOUND', required
    - `secondaryQuantity` number
    - `secondaryUnit` 'KILOGRAM'

## Response `200`

Default Response

- object
  - `metadata` object, required
    - `success` boolean, required — True when the request succeeded.
  - `data` object, required
    - `id` string, required
    - `forCompanyId` string, required
    - `orderNumber` string, required
    - `orderType` 'PURCHASE_ORDER' | 'SALES_ORDER' | 'INTERNAL_ORDER', required
    - `orderSubType` string, nullable, required
    - `status` string, nullable, required
    - `tags` string[], required
    - `source` string, nullable, required
    - `buyerCompanyId` string, required
    - `supplierCompanyId` string, required
    - `receiverCompanyId` string, required
    - `vendorCompanyId` string, nullable, required
    - `factory` string, nullable, required
    - `buyerFacilityProcess` string, nullable, required
    - `supplierFacilityProcess` string, nullable, required
    - `receiverFacilityProcess` string, nullable, required
    - `orderDate` string, nullable, required
    - `deliveryDate` string, nullable, required
    - `agreedDeliveryDate` string, nullable, required
    - `expectedShippingDate` string, nullable, required
    - `shippingDate` string, nullable, required
    - `handoverDate` string, nullable, required
    - `actualDeliveryDate` string, nullable, required
    - `shipmentReference` string, nullable, required
    - `internalResponsiblePersons` string[], required
    - `styleProperties` object
      - `seasons` object[], required
        - `id` string, required
        - `name` string, required
      - `brands` object[], required
        - `id` string, required
        - `name` string, required
    - `counterpartyOrderNumberRef` string, nullable, required
    - `tracingAttachmentTemplateId` string, nullable, required
    - `isArchived` boolean, required
    - `tracingStatus` string, nullable, required
    - `createdAt` string, nullable, required
    - `createdByUserId` string, nullable, required
    - `createdByUserName` string, nullable, required
    - `createdByCompanyId` string, nullable, required
    - `createdByCompanyName` string, nullable, required
    - `createdByImpersonateId` string, nullable, required
    - `createdByImpersonateName` string, nullable, required
    - `createdByApiKeyId` string, nullable, required
    - `createdByApiKeyLabel` string, nullable, required
    - `updatedAt` string, nullable, required
    - `updatedByUserId` string, nullable, required
    - `updatedByUserName` string, nullable, required
    - `updatedByCompanyId` string, nullable, required
    - `updatedByCompanyName` string, nullable, required
    - `updatedByImpersonateId` string, nullable, required
    - `updatedByImpersonateName` string, nullable, required
    - `updatedByApiKeyId` string, nullable, required
    - `updatedByApiKeyLabel` string, nullable, required
    - `lineCount` integer, required
    - `sentLineCount` integer, required
    - `readyLineCount` integer, required
    - `lastTracingRequestedAt` string, nullable, required
    - `sentDateCount` integer, required
    - `permissions` string[]
    - `lines` object[], required
      - `id` string, required
      - `orderLineNumber` string, nullable, required
      - `lineNo` integer, nullable, required
      - `styleId` string, required
      - `quantity` number, required
      - `unit` string, required
      - `secondaryQuantity` number, nullable, required
      - `secondaryUnit` string, nullable, required
      - `tracingReflectionOrderId` string, nullable, required
      - `tracingOrderRequestedAt` string, nullable, required

## Other responses

- `400` — Default Response
- `401` — Default Response
- `409` — Default Response

## Changes

> 22 revisions in range; 1 not diffed.

- **2026-08-31** `97e51f27dc77` — 49 breaking, 6 warning, 54 info
  - request property `orderType` was restricted to a list of enum values
  - request property `orderType` list-of-types was narrowed by removing types `null` from media type `application/json`
  - request property `tracingAttachmentTemplateId` list-of-types was narrowed by removing types `null` from media type `application/json`
  - request property `tracingStatus` list-of-types was narrowed by removing types `null` from media type `application/json`
  - …105 more
- **2026-08-25** `dacbff173c49` — 2 info
  - added the new optional request property `tracingAttachmentTemplateId`
  - added the required property `data/tracingAttachmentTemplateId` to the response with the `200` status
- **2026-08-14** `838f3ea6647d` — 1 info
  - the `source` request property default value `INTERNAL_API` was added

[Change history](https://skmtc.dev/retraced/apis/api-reference/changes/api/orders/post.md)

---

[API](https://skmtc.dev/retraced/apis/api-reference.md) · [All operations](https://skmtc.dev/retraced/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/retraced/api-reference/revisions/97e51f27dc77/schema)
