---
title: "POST order links"
method: POST
path: "/orders/{order_id}/links"
tags: ["Orders"]
---

# POST order links

`POST /orders/{order_id}/links`

## Request

- Base URL: `https://api.equipmentshare.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.equipmentshare.com/orders/{order_id}/links`
- Auth: HTTP bearer

Link one or more records of a single type to an order. The batch is all-or-nothing: a rejected id rolls back the rest.

## Path parameters

- `order_id` integer, required

## Request body

- OrderLinkCreateRequest
  - `linked_entity_ids` string[], required: Ids of the records to link. Integer ids for sales orders and work orders; a UUID for a CostCapture purchase order.
  - `order_link_type_id` integer, required: Link type: 1 = sales order, 2 = work order, 3 = purchase order.

## Response `201`

- OrderLinksResponse
  - `purchase_orders` LinkedPurchaseOrder[], required
    - `order_link_id` integer, required
    - `purchase_order_id` string, required
  - `sales_orders` LinkedSalesOrder[], required
    - `branch_name` string, nullable
    - `company_id` integer, nullable
    - `company_name` string, nullable
    - `order_id` integer, required
    - `order_link_id` integer, required
    - `order_status` string, nullable
  - `work_orders` LinkedWorkOrder[], required
    - `description` string, nullable
    - `order_link_id` integer, required
    - `status` string, nullable
    - `work_order_id` integer, required
    - `work_order_type_id` integer, nullable

## Other responses

- `400`: Bad request – validation failed or malformed data.
- `401`: Unauthorized – valid Bearer token required.
- `403`: Forbidden – insufficient permissions to perform this action.
- `404`: Order not found.
- `409`: Conflict – self-link, duplicate link, or unknown linked record.

## Changes

- **2026-12-01** `e598b74c6170`: 1 info
  - added the media type `application/json` for the response with the status `201`
- **2026-11-30** `73a8eb97ff7e`: 1 breaking
  - removed the media type `application/json` for the response with the status `201`
- **2026-11-30** `79da4ac3e73c`: 1 info
  - added the media type `application/json` for the response with the status `201`
- **2026-11-30** `697f7de36c08`: 1 breaking
  - removed the media type `application/json` for the response with the status `201`
- **2026-11-30** `c89ff9129d3f`: 1 info
  - added the media type `application/json` for the response with the status `201`

[Operation history](https://skmtc.dev/equipmentshare/apis/es-api/changes/orders/:order_id/links/post.md)

---

[API](https://skmtc.dev/equipmentshare/apis/es-api.md) - [All operations](https://skmtc.dev/equipmentshare/apis/es-api/llms.txt) - [OpenAPI document](https://skmtc.dev/equipmentshare/apis/es-api/revisions/40651e1558ac?raw)
