# PurchaseOrderHeaders

> A purchase order (inkooporder): what is bought from one supplier, with its terms, currency and dates.

Subject: Purchase.

A purchase order (inkooporder): what is bought from one supplier, with its terms, currency and dates. It holds no articles, no total and no status: the articles are its lines (PurchaseOrderLines), and where each line is in the orderflow is on PurchaseOrderLineStatuses.

Label in Fledge: Inkooporder header.

| | |
| --- | --- |
| URL | `https://odata-api.fledge.nl/v2-8/PurchaseOrderHeaders` |
| Key | `administration_id`, `purchase_order_header_id` |
| Administration-specific | yes: always filter on `administration_id` |
| Operations | GET list, GET one, POST, PATCH, DELETE |
| Read licenses | BASIS, URENPC |
| Write licenses | INKOOP |
| Scopes | FLEDGE_PORTAL, FLEDGE_TERMINAL |

> **Watch out:** closed isn't kept up to date by the Fledge API, so it doesn't tell whether an order is done. Use the order's open status rows: PurchaseOrderLineStatuses/any(s: s/is_finished eq false and ...).

> **Watch out:** is_confirmed is the supplier's confirmation of the order. The internal approval (Bevestigen in the orderflow) is status 2 on the open status rows. Check which one the user means.

> **Watch out:** The order's delivery_date is a default; every line has its own PurchaseOrderLines.delivery_date. Use the lines for anything about delivery.

## Example requests

```http
GET https://odata-api.fledge.nl/v2-8/PurchaseOrderHeaders?$filter=administration_id eq 1&$select=purchase_order_header_id,closed,confirmed_date,creditor_id&$top=50
GET https://odata-api.fledge.nl/v2-8/PurchaseOrderHeaders(administration_id=1,purchase_order_header_id='{purchase_order_header_id}')
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `administration_id` (key) | Int32 | Administratienummer |
| `purchase_order_header_id` (key) | String, not null | Ordernummer |
| `automatic_collection` | Boolean | Automatische incasso (j/n) |
| `change_date` | Date | Datum wijzig |
| `closed` | Boolean | Afgesloten (ja/nee). Not kept up to date by the Fledge API and not documented. Whether an order is done comes from its status rows. |
| `confirmed_date` | Date | Bevestigde leverdatum. The delivery date the supplier confirmed, with is_confirmed, confirmed_date_shift_reason (why it moved) and confirmed_delivery_date_confirmed_on_date (when it was confirmed). |
| `confirmed_date_shift_reason` | String | Reden verschuiving |
| `confirmed_delivery_date_confirmed_on_date` | Date | Leverdatum bevestigd op |
| `container` | Boolean | Vervoer via container ja/nee |
| `country_of_origin` | Int32 | Land oorsprong: Land van oorsprong voor intrastat |
| `country_of_source` | Int32 | Land herkomst: Land van herkomst voor intrastat |
| `created_by` | Int32 | User aanmaak |
| `creation_date` | Date | Datum aanmaak |
| `creditor_group_id` | Int32 | Crediteurgroep nummer |
| `creditor_id` | Int32 | Crediteurnummer. The supplier ordered from (Creditors.creditor_id in this administration). |
| `currency_code_id` | Int32 | Valutanummer. The order's currency. With a foreign currency the lines hold prices in both currencies, converted at exchange_rate (per currency_unit). 0 or the local currency means local prices only. |
| `currency_unit` | Int32 | Eenheid valuta |
| `delivery_city_1` | String | Plaats aflevering |
| `delivery_city_2` | String | Plaats aflevering 2 |
| `delivery_condition_id` | Int32 | Leveringsconditie |
| `delivery_country_code_id` | Int32 | Landnr.aflevering: Landnummer aflevering |
| `delivery_date` | Date | Datum levering. The expected delivery date of the order (leverdatum verwacht). A default: every line has its own delivery_date, which counts for anything about delivery. Reporting a delay moves this date too. |
| `delivery_name` | String | Aflevernaam |
| `delivery_note_layout_id` | Int32 | Layout |
| `delivery_number_1` | Int32 | Straatnummer aflevering |
| `delivery_number_2` | String | Nummer 2: Straatnummer aflevering 2 |
| `delivery_postal_code` | String | Postcode aflevering |
| `delivery_remark` | String | Opmerking: Memo aflevering |
| `delivery_street_1` | String | Straat aflevering |
| `delivery_street_2` | String | Straat aflevering 2 |
| `delivery_week` | Int32 | Week levering |
| `delivery_with_regard_to` | String | Aflevering t.a.v. |
| `description_1` | String | Omschrijving |
| `description_2` | String | Omschrijving 2 |
| `description_3` | String | Omschrijving |
| `exchange_rate` | Decimal | Koers |
| `exchange_rate_invoice` | Int32 | Koers fact.: Koers die gebruikt wordt bij factureren (0 = koers van de order, 1= koers uit de valuta tabel) |
| `include_vat` | Boolean | BTW j/n: BTW ja/nee. Whether VAT is calculated on the order; amounts on the lines are always without VAT. |
| `instalment_division_header_id` | Int32 | Termijn nummer |
| `intrastat_goods_flow_id` | Int32 | Intrastat goederenstroomcode |
| `intrastat_order_type_id` | Int32 | ICT: Soort order mbt intrastataangifte (0 = Nederland; 2 = ICL binnen EU; 4 = ICL buiten EU; 6 = ICV binnen EU; 8 = ICV buiten EU).. Values: 0 = Domestic (Nederland); 2 = Intra-community delivery, within the EU (ICL); 4 = Intra-community delivery, outside the EU; 6 = Intra-community acquisition, within the EU (ICV); 8 = Intra-community acquisition, outside the EU |
| `intrastat_preference_id` | Int32 | Intrastat preferentiecode |
| `intrastat_shipping_type_id` | Int32 | Vervoerwijze code: Intrastat vervoerwijzecode |
| `intrastat_statistic_scheme_id` | Int32 | Stelsel-code: Intrastat statistisch stelsel code |
| `intrastat_taric_id` | Int32 | Intrastat taric-code |
| `intrastat_traffic_area_id` | Int32 | Verkeersgebied code: Verkeersgebiedcode |
| `intrastat_transaction_id` | Int32 | Transactie code intrastat |
| `invoice_creditor` | Int32 | Factuurcrediteur. The supplier that sends the invoice, a creditor number; usually the same as creditor_id. |
| `invoice_relation_id` | Int32 | Relatienr fact.cred.: Relatienummer factuurcrediteur |
| `is_confirmed` | Boolean | Bevestigd ja/nee. Whether the supplier confirmed the order. Not the internal approval, which is status 2 on the status rows. |
| `is_partial_delivery` | Boolean | Deellevering ja/nee |
| `is_vat_reverse_charge` | Boolean | BTW verlegd (j/n) |
| `language_code_id` | Int32 | Taalkode |
| `leading_currency` | Int32 | Bepalende valuta. 1 when the order was priced in its foreign currency, 0 otherwise. Prices on the lines are in both currencies either way. |
| `memo` | String | Memo |
| `modified_by` | Int32 | User wijzig |
| `order_date` | Date | Datum order. The order date (orderdatum). |
| `order_discount` | Decimal | Orderkorting. The supplier's order discount, proposed for new lines. It is not applied to any amount: a line's discount is already in its net price. |
| `order_week` | Int32 | Week order |
| `payment_conditions_id` | Int32 | Betalingskonditie |
| `purchase_invoice_layout_id` | Int32 | Layout |
| `purchase_order_layout_id` | Int32 | Layout |
| `purchaser_id` | Int32 | Inkoper. The buyer (Purchasers.purchaser_id), 0 when none. |
| `reference` | String | Referentie. The order's reference. |
| `relation_address_id` | Int32 | Adresnummer |
| `relation_contact_person_id` | Int32 | Kontaktpers.: Kontakt persoon nummer |
| `relation_id` | Int32 | Relatienr. cred.: Relatienummer crediteur. The supplier's relation, for its addresses and contact persons. |
| `revenue_group_id` | Int32 | Omzetgroep |
| `selection` | String | Selectie. A search key the backend builds from the supplier, purchaser and the open actions. Not user data. |
| `term_invoice` | Boolean | Termijn facturering. Whether the order is an instalment order (termijnorder), invoiced through PurchaseOrderInstalments. |
| `warehouse_address_id` | Int32 | Adresnummer. With warehouse_aisle_id and warehouse_shelf_id the default receiving location for new lines; each line has its own. |
| `warehouse_aisle_id` | Int32 | Magazijn |
| `warehouse_shelf_id` | Int32 | Locatie |

## Relations

- `Administration` → [Administrations](https://docs.fledge.nl/en/api/reference/Administrations.md) (one)
- `Creditor` → [Creditors](https://docs.fledge.nl/en/api/reference/Creditors.md) (one)
- `CreditorGroup` → [CreditorGroups](https://docs.fledge.nl/en/api/reference/CreditorGroups.md) (one)
- `DeliveryCondition` → [DeliveryConditions](https://docs.fledge.nl/en/api/reference/DeliveryConditions.md) (one)
- `InstalmentDivisionHeader` → [InstalmentDivisionHeaders](https://docs.fledge.nl/en/api/reference/InstalmentDivisionHeaders.md) (one)
- `IntrastatGoodsFlow` → [IntrastatGoodsFlows](https://docs.fledge.nl/en/api/reference/IntrastatGoodsFlows.md) (one)
- `IntrastatPreference` → [IntrastatPreferences](https://docs.fledge.nl/en/api/reference/IntrastatPreferences.md) (one)
- `IntrastatStatisticScheme` → [IntrastatStatisticSchemes](https://docs.fledge.nl/en/api/reference/IntrastatStatisticSchemes.md) (one)
- `IntrastatTariff` → [IntrastatTariffs](https://docs.fledge.nl/en/api/reference/IntrastatTariffs.md) (one)
- `IntrastatTrafficArea` → [IntrastatTrafficAreas](https://docs.fledge.nl/en/api/reference/IntrastatTrafficAreas.md) (one)
- `IntrastatTransaction` → [IntrastatTransactions](https://docs.fledge.nl/en/api/reference/IntrastatTransactions.md) (one)
- `IntrastatTransportMode` → [IntrastatTransportModes](https://docs.fledge.nl/en/api/reference/IntrastatTransportModes.md) (one)
- `InvoiceCreditor` → [Creditors](https://docs.fledge.nl/en/api/reference/Creditors.md) (one)
- `LanguageCode` → [LanguageCodes](https://docs.fledge.nl/en/api/reference/LanguageCodes.md) (one)
- `PaymentTerm` → [PaymentConditions](https://docs.fledge.nl/en/api/reference/PaymentConditions.md) (one)
- `PurchaseDeliveryNoteLayout` → [PurchaseDeliveryNoteLayouts](https://docs.fledge.nl/en/api/reference/PurchaseDeliveryNoteLayouts.md) (one)
- `PurchaseOrderInvoiceLayout` → [PurchaseOrderInvoiceLayouts](https://docs.fledge.nl/en/api/reference/PurchaseOrderInvoiceLayouts.md) (one)
- `PurchaseOrderLayout` → [PurchaseOrderLayouts](https://docs.fledge.nl/en/api/reference/PurchaseOrderLayouts.md) (one)
- `Purchaser` → [Purchasers](https://docs.fledge.nl/en/api/reference/Purchasers.md) (one)
- `RelationAddress` → [RelationAddresses](https://docs.fledge.nl/en/api/reference/RelationAddresses.md) (one)
- `RelationContactPerson` → [RelationContactPeople](https://docs.fledge.nl/en/api/reference/RelationContactPeople.md) (one)
- `RevenueGroup` → [RevenueGroups](https://docs.fledge.nl/en/api/reference/RevenueGroups.md) (one)
- `WarehouseAddress` → [WarehouseAddresses](https://docs.fledge.nl/en/api/reference/WarehouseAddresses.md) (one)
- `WarehouseAisle` → [WarehouseAisles](https://docs.fledge.nl/en/api/reference/WarehouseAisles.md) (one)
- `WarehouseShelf` → [WarehouseShelfs](https://docs.fledge.nl/en/api/reference/WarehouseShelfs.md) (one)
- `DocumentLinks` → [DocumentLinks](https://docs.fledge.nl/en/api/reference/DocumentLinks.md) (many)
- `FinancialInfo` → [FinancialInfos](https://docs.fledge.nl/en/api/reference/FinancialInfos.md) (many)
- `HistoricProductionOrderPostCalculationOthers` → [HistoricProductionOrderPostCalculationOthers](https://docs.fledge.nl/en/api/reference/HistoricProductionOrderPostCalculationOthers.md) (many)
- `HistoricPurchaseStatuses` → [HistoricPurchaseStatuses](https://docs.fledge.nl/en/api/reference/HistoricPurchaseStatuses.md) (many)
- `PostCalculationBuyMakeParts` → [PostCalculationBuyMakeParts](https://docs.fledge.nl/en/api/reference/PostCalculationBuyMakeParts.md) (many)
- `PostCalculationMaterials` → [PostCalculationMaterials](https://docs.fledge.nl/en/api/reference/PostCalculationMaterials.md) (many)
- `PostCalculationOutsourcedItems` → [PostCalculationOutsourcedItems](https://docs.fledge.nl/en/api/reference/PostCalculationOutsourcedItems.md) (many)
- `PurchaseMaterials` → [PurchaseMaterials](https://docs.fledge.nl/en/api/reference/PurchaseMaterials.md) (many)
- `PurchaseOrderInstalments` → [PurchaseOrderInstalments](https://docs.fledge.nl/en/api/reference/PurchaseOrderInstalments.md) (many)
- `PurchaseOrderInstructionHeaders` → [PurchaseOrderInstructionHeaders](https://docs.fledge.nl/en/api/reference/PurchaseOrderInstructionHeaders.md) (many)
- `PurchaseOrderInstructionLines` → [PurchaseOrderInstructionLines](https://docs.fledge.nl/en/api/reference/PurchaseOrderInstructionLines.md) (many)
- `PurchaseOrderLines` → [PurchaseOrderLines](https://docs.fledge.nl/en/api/reference/PurchaseOrderLines.md) (many)
- `PurchaseOrderLineStatuses` → [PurchaseOrderLineStatuses](https://docs.fledge.nl/en/api/reference/PurchaseOrderLineStatuses.md) (many)
- `PurchaseOrderProductionOrderLinks` → [PurchaseOrderProductionOrderLinks](https://docs.fledge.nl/en/api/reference/PurchaseOrderProductionOrderLinks.md) (many)
- `SalesPurchaseOrderLinks` → [SalesPurchaseOrderLinks](https://docs.fledge.nl/en/api/reference/SalesPurchaseOrderLinks.md) (many)
- `SerialNumbers` → [SerialNumbers](https://docs.fledge.nl/en/api/reference/SerialNumbers.md) (many)

## Actions

- `POST PurchaseOrderHeaders/augment` — returns PurchaseOrderHeader
- `POST PurchaseOrderHeaders(administration_id=1,purchase_order_header_id='{purchase_order_header_id}')/generatePurchaseOrderInstructions` — body: `PurchaseOrderLineStatuses` GeneratePurchaseOrderInstructionsPurchaseOrderLineStatusDto[]: purchase_order_line_id (Int32), purchase_order_line_status_id (Int32), sticker_quantity (Decimal) — returns PurchaseOrderInstructionHeader
- `POST PurchaseOrderHeaders/generatePurchaseOrderReceipts` — body: `generatePurchaseOrderReceipts` GeneratePurchaseOrderReceiptsDto: administration_id (Int32), date_received (Date), supplier_receipt_id (String), PurchaseOrderLineStatuses (GeneratePurchaseOrderReceiptLineStatusDto[]) — returns PurchaseOrderReceiptHeader[]
- `GET PurchaseOrderHeaders/nextId(…)` — returns PurchaseOrderHeaderNextIdResultDto

---

Source: https://docs.fledge.nl/en/api/reference/PurchaseOrderHeaders
