---
title: "Create document for order."
method: POST
path: "/rest/api/orders/{id}/documents/"
tags: ["Order"]
---

# Create document for order.

`POST /rest/api/orders/{id}/documents/`

Create document for order

## Path parameters

- `id` string, required

## Request body

- RestOrderDocumentDTO — This object represents a document belongs to an order with the specified ID
  - `idExternal` string, nullable, required — External unique ID of the document - used for the update
  - `number` string, nullable — External document number
  - `priceWithTax` string, nullable — The gross value
  - `priceWithoutTax` string, nullable — The net value
  - `currency` string, nullable — Currency on the document
  - `currencyValue` string, nullable — Currency exchange rate
  - `type` integer, nullable, required — Document type - <a href='#tag/Order/operation/get_rest_documents_map'>order document types endpoint</a>
  - `media` string — Null or media UUID - <a href='#tag/Media/operation/post_rest_media_new'>media attachment endpoint</a>

## Response `200`

Order document with the given idExternal already exists

- RestOrderDocumentDTO2 — This object represents a document belongs to an order with the specified ID
  - `id` integer, nullable — Internal ID of the shipment
  - `idExternal` string, nullable, required — External unique ID of the document - used for the update
  - `number` string, nullable — External document number
  - `priceWithTax` string, nullable — The gross value
  - `priceWithoutTax` string, nullable — The net value
  - `currency` string, nullable — Currency on the document
  - `currencyValue` string, nullable — Currency exchange rate
  - `type` integer, nullable, required — Document type - <a href='#tag/Order/operation/get_rest_documents_map'>order document types endpoint</a>
  - `media` string — Null or media UUID - <a href='#tag/Media/operation/post_rest_media_new'>media attachment endpoint</a>
  - `createdAt` string, date-time, nullable — Date the document was added to Apilo

## Other responses

- `201` — Create document correctly
- `401` — Authorization failed
- `404` — Order not found
- `422` — Validation fail

---

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