---
title: "Attaches purchase orders to a contract job (ERP-12219)."
method: POST
path: "/v{version}/ContractJobs/{jobId}/purchaseOrders"
tags: ["ContractJobs"]
---

# Attaches purchase orders to a contract job (ERP-12219).

`POST /v{version}/ContractJobs/{jobId}/purchaseOrders`

## Request

- Base URL: `https://api.bilflo.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.bilflo.com/v{version}/ContractJobs/{jobId}/purchaseOrders`
- Auth: API key in header `Authorization`

Body: an array of { orderNumber, balance, hours, expiration, startDate, endDate, isPrimary }; only orderNumber
is required. Each PO is matched by orderNumber among the job's client's POs, or created for that client
with the balance, hours and expiration given (an existing PO's values are never changed). It is then linked
to the job with startDate/endDate. The entry with isPrimary true becomes the job's primary PO, the one the
invoice shows; at most one entry may set it. With none set, the job keeps its primary, or the first entry
becomes primary if it has none. POs already on the job and not in the body stay linked: this never
detaches. Sending the same body again changes nothing. Returns the job's POs, as GET.

## Path parameters

- `jobId` integer, required
- `version` string, required

## Headers

- `company-id` string, required

## Request body

- ContractsContractsPurchaseOrdersContractJobPurchaseOrderEntry[]
  - `orderNumber` string, nullable
  - `balance` number, double, nullable
  - `hours` integer, nullable
  - `expiration` string, date-time, nullable
  - `startDate` string, date-time, nullable
  - `endDate` string, date-time, nullable
  - `isPrimary` boolean, nullable

## Response `200`

Success

- ContractsContractsPurchaseOrdersContractJobPurchaseOrdersResponse
  - `isValid` boolean
  - `errors` string[], nullable
  - `warnings` string[], nullable
  - `info` string[], nullable
  - `message` string, nullable
  - `data` ContractsContractsPurchaseOrdersContractJobPurchaseOrderView[], nullable
    - `purchaseOrderId` integer
    - `orderNumber` string, nullable
    - `isPrimary` boolean
    - `isActive` boolean
    - `balance` number, double, nullable
    - `currentBalance` number, double, nullable
    - `hours` integer, nullable
    - `expiration` string, date-time, nullable
    - `startDate` string, date-time, nullable
    - `endDate` string, date-time, nullable

## Changes

- **2026-10-14** `23c229cc0bb6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bilflo/apis/bilflo-api/changes/v:version/ContractJobs/:jobId/purchaseOrders/post.md)

---

[API](https://skmtc.dev/bilflo/apis/bilflo-api.md) - [All operations](https://skmtc.dev/bilflo/apis/bilflo-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bilflo/apis/bilflo-api/revisions/408a84d01c3f?raw)
