# Purchase Orders _(Realtime-enabled)_

`GET` `POST` `PATCH` `DELETE` _(Table: Purchase Header)_

```
eOne/core/v1.0/purchaseOrders
```

Read and write Purchase Orders, the AP-side counterpart of [posted documents](https://eonesolutions.github.io/eone-bc-integration/posted-documents.md) on the sales side. POST a full order (header + `purchaseOrderLines`) in a single call; the header alone is rarely useful, so the line child collection is part of the same deep insert.

## Resolve the buy-from vendor

Three ways to name the vendor, in order of convenience: `vendorNumber` (the Business Central No.), `vendorId` (its SystemId), or `vendorIntegrationId`, the vendor's eOne integration external key. `vendorIntegrationId` is a [resolver](https://eonesolutions.github.io/eone-bc-integration/resolvers.md): it is bound to a global, not a stored column, and on validate it looks the vendor up by its `EONE Integration Id` and stamps `Buy-from Vendor No.` for you. Supply exactly one.

> **Caution:** If no vendor matches the `vendorIntegrationId` you send, the call errors. The order is not created with a blank vendor.

## Deep insert: header + lines

`POST` `/purchaseOrders`

```
{
  "vendorIntegrationId": "ACME-001",
  "integrationId": "PO-9F3A",
  "purchaseOrderLines": [
    { "itemNumber": "1000", "quantity": 5, "directUnitCost": 12.50 }
  ]
}
```

The store's order Id round-trips via `integrationId`; the supplier reference via `vendorInvoiceNumber` / `yourReference`. See [Purchase Order Lines](https://eonesolutions.github.io/eone-bc-integration/core-purchaseOrderLines.md) for how the nested lines behave.

## Currency

`currencyCode` is the ISO code. A blank value means the company's local currency (LCY). It is translated to and from Business Central's blank-is-LCY convention automatically, so you send ISO and never the empty Business Central code.

## Bound actions

`POST /purchaseOrders({id})/Microsoft.NAV.release` releases the order and `…/Microsoft.NAV.reopen` returns a released order to Open. `POST /purchaseOrders({id})/Microsoft.NAV.receiveAndInvoice` posts both receipt and invoice in one step. `…/Microsoft.NAV.createWarehouseReceipt` hands a released order to a require-receive warehouse; the response redirects to the resulting [warehouseReceipt](https://eonesolutions.github.io/eone-bc-integration/core-warehouseReceipts.md).

`archive` / `cancel` snapshot a version and keep the order open, or archive then delete it (soft delete). See [Archiving & cancelling](https://eonesolutions.github.io/eone-bc-integration/archive.md).

> **Caution:** On a full `receiveAndInvoice` the Purchase Header is **deleted** (it becomes a posted receipt + posted invoice). The action runs against a fresh local copy for that reason. Do not expect the order to still be GET-able afterward.

> **Note:** Dimension columns `shortcutDimension1Code`–`8Code` are writable here — see [Dimensions](https://eonesolutions.github.io/eone-bc-integration/dimensions.md).

## Purchase Orders fields

_API column → BC field._

**Legend**

- _(req)_ required on create
- _(res)_ resolver
- _(cur)_ currency-translated
- _(ro)_ read-only
- _(ext)_ added to this endpoint by another extension (BC field name shown; its API column name is not known here)

| API | BC field | Notes |
| --- | --- | --- |
| `id` | SystemId | BC record GUID. _(ro)_ |
| `bcCompanyId` | bcCompanyId | The company this row belongs to - the same GUID that appears in the request URL. Present on every endpoint so a store pooling several companies can keep them apart without relying on which URL it called. _(ro)_ |
| `bcCompanyName` | bcCompanyName | The name of the company this row belongs to. _(ro)_ |
| `number` | No. | Document number; auto-assigned by the number series if left blank. |
| `integrationId` | EONE Integration Id | Your external order key. |
| `vendorInvoiceNumber` | Vendor Invoice No. | Supplier reference. |
| `yourReference` | Your Reference | Your reference back to the supplier. |
| `vendorNumber` | Buy-from Vendor No. | Buy-from vendor; one of three resolver inputs. |
| `vendorName` | Buy-from Vendor Name | _(ro)_ |
| `vendorIntegrationId` | vendorIntegrationId | Resolves the vendor by its Integration Id, then sets Buy-from Vendor No. _(res)_ |
| `payToVendorNumber` | Pay-to Vendor No. | Pay-to vendor, if different from buy-from. |
| `orderDate` | Order Date |  |
| `postingDate` | Posting Date |  |
| `documentDate` | Document Date |  |
| `dueDate` | Due Date |  |
| `expectedReceiptDate` | Expected Receipt Date |  |
| `currencyCode` | currencyCode | ISO code; blank = LCY (translated automatically). _(cur)_ |
| `paymentTermsCode` | Payment Terms Code |  |
| `reasonCode` | Reason Code | Supplementary source code used to trace this document. |
| `paymentMethodCode` | Payment Method Code |  |
| `purchaserCode` | Purchaser Code |  |
| `locationCode` | Location Code |  |
| `pricesIncludeTax` | Prices Including VAT |  |
| `buyFromAddressLine1` | Buy-from Address |  |
| `buyFromAddressLine2` | Buy-from Address 2 |  |
| `buyFromCity` | Buy-from City |  |
| `buyFromCounty` | Buy-from County |  |
| `buyFromCountryRegionCode` | Buy-from Country/Region Code |  |
| `buyFromPostCode` | Buy-from Post Code |  |
| `payToName` | Pay-to Name | _(ro)_ |
| `buyFromContact` | Buy-from Contact No. | Number of your contact at the vendor. |
| `payToContact` | Pay-to Contact No. | Contact who sends the invoice, when different from the buy-from contact. |
| `payToAddressLine1` | Pay-to Address | Remit-to address of the pay-to vendor. |
| `payToAddressLine2` | Pay-to Address 2 |  |
| `payToCity` | Pay-to City |  |
| `payToCounty` | Pay-to County |  |
| `payToPostCode` | Pay-to Post Code |  |
| `payToCountryRegionCode` | Pay-to Country/Region Code |  |
| `shipToCode` | Ship-to Code | Order-address code selecting a saved receiving address; also used for drop shipment. |
| `shipToName` | Ship-to Name |  |
| `shipToAddressLine1` | Ship-to Address | Address the items are shipped/received to. |
| `shipToAddressLine2` | Ship-to Address 2 |  |
| `shipToCity` | Ship-to City |  |
| `shipToCounty` | Ship-to County |  |
| `shipToPostCode` | Ship-to Post Code |  |
| `shipToCountryRegionCode` | Ship-to Country/Region Code |  |
| `shipToContact` | Ship-to Contact |  |
| `shipmentMethodCode` | Shipment Method Code | Delivery terms (Incoterms), such as FOB, for the receipt. |
| `vatRegistrationNumber` | VAT Registration No. |  |
| `taxLiable` | Tax Liable | Whether this vendor charges you sales tax on purchases. |
| `taxAreaCode` | Tax Area Code | Tax area used to calculate and post sales tax for this purchase. |
| `shortcutDimension1Code` | Shortcut Dimension 1 Code | Shortcut dimension 1. See Dimensions. |
| `shortcutDimension2Code` | Shortcut Dimension 2 Code | Shortcut dimension 2. See Dimensions. |
| `shortcutDimension3Code` | EONE Shortcut Dim 3 Code | Shortcut dimension 3. See Dimensions. |
| `shortcutDimension4Code` | EONE Shortcut Dim 4 Code | Shortcut dimension 4. See Dimensions. |
| `shortcutDimension5Code` | EONE Shortcut Dim 5 Code | Shortcut dimension 5. See Dimensions. |
| `shortcutDimension6Code` | EONE Shortcut Dim 6 Code | Shortcut dimension 6. See Dimensions. |
| `shortcutDimension7Code` | EONE Shortcut Dim 7 Code | Shortcut dimension 7. See Dimensions. |
| `shortcutDimension8Code` | EONE Shortcut Dim 8 Code | Shortcut dimension 8. See Dimensions. |
| `dimensionSetId` | Dimension Set ID | The dimension set this record carries. Join it to the dimensionSetEntries endpoint to resolve the full set of dimension codes and values, including any beyond the eight shortcut dimension columns. _(ro)_ |
| `status` | Status | _(ro)_ |
| `fullyReceived` | Completely Received | _(ro)_ |
| `totalAmountExcludingTax` | totalAmountExcludingTax | Sum of line amounts. _(ro)_ |
| `totalTaxAmount` | totalTaxAmount | Computed tax total. _(ro)_ |
| `totalAmountIncludingTax` | totalAmountIncludingTax | _(ro)_ |
| `lastModifiedDateTime` | SystemModifiedAt | _(ro)_ |

## Related pages

Collections nested under this endpoint:

- [Purchase Order Lines](https://eonesolutions.github.io/eone-bc-integration/core-purchaseOrderLines.md)
