# Purchase Invoices _(Realtime-enabled)_

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

```
eOne/core/v1.0/purchaseInvoices
```

Read and write unposted purchase invoices, the `Purchase Header` filtered to `Document Type = Invoice`. POST a full invoice in one call (header plus the `purchaseInvoiceLines` child collection); `Document Type` is stamped for you, so you never send it. Your external key round-trips on `integrationId`.

## Resolve the vendor

You do not have to know the Business Central vendor number. Send **any one** of `vendorNumber`, or `vendorIntegrationId`. The latter is a _(res)_ resolver field that looks the vendor up by its [Integration Id](https://eonesolutions.github.io/eone-bc-integration/integration-id.md) and sets `Buy-from Vendor No.` for you. See [resolvers](https://eonesolutions.github.io/eone-bc-integration/resolvers.md) for how resolver fields behave.

> **Caution:** If `vendorIntegrationId` matches no vendor the call errors. It does not silently create one.

## Currency

`currencyCode` is an ISO code, not the raw Business Central currency code. The local currency (LCY) is represented as the blank/empty code, and the endpoint translates ISO&harr;blank in both directions, so send `""` (or omit it) for an LCY invoice.

## Deep insert

`POST` `/purchaseInvoices`

```
{
  "vendorIntegrationId": "ACME-001",
  "vendorInvoiceNumber": "INV-5567",
  "purchaseInvoiceLines": [
    { "itemNumber": "1000", "quantity": 5, "directUnitCost": 12.50 }
  ]
}
```

See [posted documents](https://eonesolutions.github.io/eone-bc-integration/posted-documents.md) for reading back the result, and [dimensions](https://eonesolutions.github.io/eone-bc-integration/dimensions.md) for the shortcut-dimension columns.

## Bound actions

`release` performs a manual release and `reopen` returns a released invoice to Open. `post` releases the invoice on its way through, so use `release` when you want the invoice released and left unposted for a person to check.

`POST` `/purchaseInvoices({id})/Microsoft.NAV.release`

The bound action `post` receives and invoices the document (equivalent to Post in Business Central). It is invoked on a single invoice:

`POST` `/purchaseInvoices({id})/Microsoft.NAV.post`

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

> **Caution:** Posting is irreversible, it removes the unposted header and produces a posted purchase invoice. The totals fields (`totalAmountExcludingTax`, `totalTaxAmount`, `totalAmountIncludingTax`) are read-only sums; you cannot set them.

## Purchase Invoices 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; assigned by the number series if left blank. |
| `integrationId` | EONE Integration Id | Your external key. Round-trips unchanged. |
| `vendorInvoiceNumber` | Vendor Invoice No. | Supplier's own invoice reference. |
| `vendorNumber` | Buy-from Vendor No. | BC vendor number. Set directly or via a resolver below. |
| `vendorName` | Buy-from Vendor Name | Pulled from the vendor. _(ro)_ |
| `vendorIntegrationId` | vendorIntegrationId | Resolves the vendor by its Integration Id and sets Buy-from Vendor No. _(res)_ |
| `payToVendorNumber` | Pay-to Vendor No. | Pay-to vendor when it differs from buy-from. |
| `postingDate` | Posting Date |  |
| `documentDate` | Document Date |  |
| `dueDate` | Due Date |  |
| `currencyCode` | currencyCode | ISO currency code; blank/empty means LCY. Translated ISO&harr;blank. _(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 |  |
| `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 | 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)_ |
| `totalAmountExcludingTax` | totalAmountExcludingTax | Sum of line amounts. _(ro)_ |
| `totalTaxAmount` | totalTaxAmount | Computed tax total. _(ro)_ |
| `totalAmountIncludingTax` | totalAmountIncludingTax | Sum incl. tax. _(ro)_ |
| `lastModifiedDateTime` | SystemModifiedAt | _(ro)_ |

## Related pages

Collections nested under this endpoint:

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