# HistoricPurchaseOrders

> Purchase order lines moved to history (inkooporderhistorie): one flat row with order, line, receipt and invoice data, and the frontend treats one row as one invoice of (part of) a line.

Subject: Purchase.

Purchase order lines moved to history (inkooporderhistorie): one flat row with order, line, receipt and invoice data, and the frontend treats one row as one invoice of (part of) a line. The legacy ERP moves them here; the Fledge API only reads them. Questions about purchases from the past need this set, not only PurchaseOrderLines. It has no navigation to the order: join on order_header_id and order_line_id. Several names are misleading or misspelled: read the notes.

Label in Fledge: Inkooporder historie.

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

## Example requests

```http
GET https://odata-api.fledge.nl/v2-8/HistoricPurchaseOrders?$filter=administration_id eq 1&$select=historic_purchase_order_id,order_header_id,order_line_id,compan_name,creditor_id,date_deliverv&$top=50
GET https://odata-api.fledge.nl/v2-8/HistoricPurchaseOrders(administration_id=1,historic_purchase_order_id={historic_purchase_order_id},order_header_id='{order_header_id}',order_line_id={order_line_id})
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `administration_id` (key) | Int32 | Administratienummer |
| `historic_purchase_order_id` (key) | Int32, not null | Volgnummer |
| `order_header_id` (key) | String, not null | Order nummer. The purchase order number (PurchaseOrderHeaders.purchase_order_header_id). |
| `order_line_id` (key) | Int32, not null | Order regel nummer. The order line (PurchaseOrderLines.purchase_order_line_id). |
| `agent_id` | Int32 | Agent |
| `amount_of_sawing` | Int32 | Aantal maal zagen |
| `angle_1` | Decimal | Hoek 1 |
| `angle_2` | Decimal | Hoek 2 |
| `apply_offset_sawing_price` | Boolean | Toepassen verstekzaagprijs |
| `area_of_country_id` | Int32 | Rayon |
| `article_current_status_id` | Int32 | Courantstatus |
| `article_custom_fields_id` | Int32 | Volgnummer |
| `article_group_id` | Int32 | Artikelgroep |
| `basic_tracking_id` | Int32 | Intern volgnummer |
| `batch_id` | String | Lotnummer/partijregistratie |
| `benchmark` | Decimal | Maatstaf intrastat-aangifte |
| `burn` | Boolean | Branden |
| `calculation_method` | Int32 | Rekenmethode |
| `compan_name` | String | Bedrijfsnaam. The supplier's name when the row became history (sic). |
| `contact_person_id` | Int32 | Persoon |
| `container` | Boolean | Vervoer via container (intrastat-aangifte) |
| `cost_system` | Int32 | Kostprijssysteem |
| `country_id` | Int32 | Landcode |
| `created_by` | Int32 | User aanmaak |
| `creation_date` | Date | Datum aanmaak |
| `creditor_group_id` | Int32 | Crediteurgroep |
| `creditor_id` | Int32 | Leverancier. The supplier. |
| `currency_code_id` | Int32 | Valuta code |
| `currency_unit` | Int32 | Valuta eenheid |
| `currency_unit_invoice` | Int32 | Valuta eenheid factuur |
| `date_deliverv` | Date | Datum pakbon. Despite its name (sic), the date of the receipt, so when the goods arrived. |
| `date_order` | Date | Datum order. The order date. |
| `date_purchase_order` | Date | Datum bestelopdracht. The date of the order instruction (bestelopdracht). |
| `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_name` | String | Aflevernaam |
| `delivery_note_header` | String | Pakbon |
| `delivery_note_layout_id` | Int32 | Pakbon layout |
| `delivery_note_line` | Int32 | Pakbon regel |
| `delivery_note_quantity` | Decimal | Aantal pakbon. The quantity received on the receipt (delivery_note_header, delivery_note_line). |
| `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_with_regard_to` | String | Aflevering t.a.v. |
| `description_1` | String | Omschrijving |
| `description_2` | String | Omschrijving |
| `description_3` | String | Omschrijving |
| `determined_surface` | Boolean | Bepaal oppervlakte |
| `determined_weight` | Boolean | Bepaal gewicht |
| `discount` | Decimal | Korting |
| `drawing_number` | String | Tekeningnummer |
| `exchange_rate` | Decimal | Koers |
| `exchange_rate_invoice` | Decimal | Koers factuur. The exchange rate of the invoice. |
| `extra_price` | Boolean | Overprijs |
| `financial_year` | Int32 | Boekjaar |
| `foreign_currency_price` | Decimal | Bestelprijs bruto VV |
| `gross_weight` | Decimal | Gewicht bruto |
| `has_multiple_angles` | Boolean | Meerdere hoeken |
| `historical_date` | Date | Datum historie. When the row became history. |
| `historic_intrastat_id` | String | Intrastatnummer: Instrastatnummer. An IntrastatItems code, not a goods code. |
| `include_vat` | Boolean | BTW berekenen (ja/nee) |
| `inrastat_weight` | Decimal | Gewicht voor intrastat-aangifte |
| `intrastat_date` | Date | Datum intrastat: Datum goederenverplaatsing intrastat. The date the goods moved, for the Intrastat declaration. |
| `intrastat_goods_flow_id` | Int32 | Intrastat goederenstroomcode |
| `intrastat_ict_order_id` | Int32 | Soort ICT-order (intrastat): Soort ICT-order voor intrastat. The Intrastat order type (0 domestic, 2 or 4 delivery to another country, 6 or 8 acquisition). |
| `intrastat_id` | String | Intrastat goederencode. The goods code (IntrastatGoodsCodes). |
| `intrastat_preference_id` | Int32 | Intrastat preferentiecode |
| `intrastat_processed` | Boolean | Intrastat verwerkt: In intrastat-aangifte verwerkt. Processed in an Intrastat declaration. |
| `intrastat_report_period_id` | Int32 | Volgnummer. The Intrastat reporting period the row was declared in; 0 or empty when not declared. |
| `intrastat_shipping_type_id` | Int32 | Vervoerwijze code: Intrastat vervoerwijzecode |
| `intrastat_stats_system_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_id` | Int32 | Factuur crediteur |
| `invoice_currency` | Int32 | Valuta factuur: Valuta code factuur |
| `invoice_date` | Date | Datum factuur. The date of the invoice. |
| `invoice_header_id` | String | Factuur nummer. The purchase invoice, with financial_year; 0 or empty when not invoiced. |
| `invoice_layout` | Int32 | Factuur layout |
| `invoice_line_id` | Int32 | Factuur regel. The purchase invoice line (navigation PurchaseOrderInvoiceLine). |
| `invoice_price` | Decimal | Factuurprijs. The invoiced price per unit. |
| `invoice_price_foreign_currency` | Decimal | Factuurprijs vv |
| `invoice_quantity` | Decimal | Aantal factuur. The quantity invoiced; 0 or less is a credit note. |
| `invoice_value` | Decimal | Factuurwaarde intrastat-aangifte. The invoice value for the Intrastat declaration, not the invoiced amount. |
| `language_id` | Int32 | Taalcode |
| `line_function` | Int32 | Functie van de regel |
| `line_type` | Int32 | Type |
| `main_creditor_id` | Int32 | Hoofd crediteur: Hoofdcrediteur |
| `material` | Int32 | Mat/art/tekst: Materiaal/artikel/tekst |
| `material_article_id` | String | Artikel (torm.part_code, msrt.part_code) |
| `material_id` | String | Materiaalsoort: alfanumerieke code voor het materiaal, 15 karakters  lang |
| `material_price` | Decimal | Prijs per stuk |
| `material_shape_id` | String | Materiaalvorm code |
| `memo` | String | Memo |
| `memo_header` | String | Memo |
| `net_gross_manual` | Int32 | Netto/Bruto/Handmatig |
| `net_weight` | Decimal | Gewicht netto |
| `offset_sawing` | Boolean | Verstekzagen |
| `operation_tracking_id_1` | Int32 | Intern volgnummer |
| `operation_tracking_id_2` | Int32 | Intern volgnummer |
| `operation_tracking_id_3` | Int32 | Intern volgnummer |
| `operation_tracking_id_4` | Int32 | Nummer: Bewerkingsprijs 4 |
| `operation_tracking_id_5` | Int32 | Nummer: Bewerkingsprijs 5 |
| `operation_tracking_id_6` | Int32 | Nummer: Bewerkingsprijs 6 |
| `order_assignment_layout_id` | Int32 | Bestelopdracht layout |
| `order_code` | String | Bestelkode |
| `order_discount` | Decimal | Order korting |
| `order_unit` | Int32 | Besteleenheid |
| `order_unit_operator` | String | Operator besteleenheid |
| `order_unit_ratio` | Decimal | Factor besteleenheid |
| `order_without_vat` | Decimal | Bestel bruto: Besteleenheid bruto. Not a VAT amount: a gross price per order unit of a production material. |
| `order_wit_vat` | Decimal | Bestel netto. Not a VAT amount (sic): a net price per order unit of a production material. |
| `origin_country` | Int32 | Land oorsprong: Land van oorsprong voor intrastat-aangifte |
| `overrun` | Boolean | Toeslag |
| `overrun_tracking_id_1` | Int32 | Nummer: Toeslagprijs 1 |
| `parameter_1` | Decimal | Par 1: Parameter 1 |
| `parameter_2` | Decimal | Par 2: Parameter 2 |
| `parameter_3` | Decimal | Par 3: Parameter 3 |
| `parameter_4` | Decimal | Par 4: Parameter 4 |
| `parameter_5` | Decimal | Par 5: Parameter 5 |
| `parameter_6` | Decimal | Par 6: Parameter 6 |
| `partial_delivery` | Boolean | Deellevering (ja/nee) |
| `payment_term_id` | Int32 | Betalingsconditie |
| `period_invoice` | Int32 | Periode factuur |
| `planned_delivery_date` | Date | Datum geplande levering. The expected delivery date. |
| `pos_number_id` | String | Pos-nummer |
| `price_per_unit` | Decimal | Prijs eenheid |
| `price_system` | Int32 | Prijssysteem |
| `price_with_vat` | Decimal | Bestelprijs netto. Despite its name, the net price per unit (after discount), without VAT. |
| `price_with_vat_foreign_currency` | Decimal | Bestelprijs netto vv. Despite its name, the net price per unit in the foreign currency, without VAT. |
| `purchase_invoice_unit` | Int32 | Inkoopfactuur eenheid |
| `purchase_invoice_unit_factor` | Decimal | Factor inkoopfactuur eenheid |
| `purchase_invoice_unit_operator` | String | Operator inkoopfactuur eenheid |
| `purchase_order_header_article_id` | String | Artikel. Despite the prefix, the article of this row. Headers have no article. |
| `purchase_order_header_delivery_confirmed` | Date | Bevestigde leverdatum |
| `purchase_order_header_delivery_confirmed_on` | Date | Leverdatum bevestigd op |
| `purchase_order_header_description_1` | String | Omschrijving |
| `purchase_order_header_gross_price` | Decimal | Bestelprijs bruto. Despite the prefix, the gross price per unit of this line. |
| `purchase_order_header_is_confirmed` | Boolean | Bevestigd ja/nee |
| `purchase_order_header_shift_reason` | String | Reden verschuiving |
| `purchase_order_instruction_header_id` | Int32 | Bestelopdracht |
| `purchase_order_instruction_line_id` | Int32 | Bestelopdracht regel |
| `purchase_order_line_confimation_date_2` | Date | Datum bevestiging |
| `purchase_order_line_confirmation_date` | Date | Datum bevestiging |
| `purchase_order_line_delivery_confirmed` | Date | Bevestigde leverdatum |
| `purchase_order_line_delivery_confirmed_at` | Date | Leverdatum bevestigd op |
| `purchase_order_line_is_confirmed` | Boolean | Bevestigd ja/nee |
| `purchase_order_line_shift_reason` | String | Reden verschuiving |
| `purchase_quotation_header_id` | String | Offertenummer: Offerte nummer |
| `purchase_quotation_line_id` | Int32 | Offertregel: Regelnummer |
| `purchaser_id` | Int32 | Inkoper |
| `quantity_ordered` | Decimal | Aantal besteld. The quantity ordered. |
| `radius` | Boolean | Stralen |
| `receiving_unit` | Int32 | Ontvangsteenheid |
| `receiving_unit_operator` | String | Operator ontvangsteenheid |
| `receiving_unit_ratio` | Decimal | Factor ontvangsteenheid |
| `reference` | String | Referentie |
| `relation_address_id` | Int32 | Adres |
| `relation_id` | Int32 | Relatie |
| `relation_invoice_creditor` | Int32 | Relatie factuurcrediteur |
| `relation_main_creditor` | Int32 | Relatie hoofdcrediteur |
| `remaining_tracking_id` | Int32 | Intern volgnummer |
| `revision` | String | Revisie |
| `sales_group_id` | Int32 | Omzetgroep |
| `sand_blast_and_prime` | Boolean | Stralen + menie`: Stralen + menie |
| `sand_blast_and_sigma_weld` | Boolean | Stralen + sigmaweld |
| `sawing` | Boolean | Zagen |
| `sawing_type` | Int32 | Type verstekzagen (liggend, staand) |
| `source_country` | Int32 | Land herkomst: Land van herkomst voor intrastat-aangifte |
| `special` | Boolean | Fixed lengte |
| `special_quantity` | Decimal | Aantal |
| `staistics_value` | Decimal | Statistische waarde voor intrastat-aangifte |
| `statistics_id` | String | Statistieknummer |
| `storage` | Decimal | Opslag |
| `term_invoice` | Boolean | Termijn facturering |
| `total_invoice_price` | Decimal | Totaal factuurprijs. The invoiced amount of this row. |
| `total_invoice_price_foreign_currency` | Decimal | Totaal factuurprijs vv |
| `user_delivery_note` | Int32 | User pakbon |
| `user_historical` | Int32 | User historie |
| `user_invoice` | Int32 | User factuur |
| `user_purchase_order` | Int32 | User bestelopdracht |
| `valuation_price` | Decimal | Waarderingsprijs |
| `vat_category` | String | BTW rubriek |
| `vat_code_id` | Int32 | BTW code |
| `vat_number` | String | BTW-nummer |
| `vat_shifted` | Boolean | BTW verlegd (j/n) |
| `waranty_period_id` | Int32 | Garantie termijn |
| `warehouse_address_i` | Int32 | Magazijn adres |
| `warehouse_aisle_id` | Int32 | Magazijn |
| `warehouse_shelf_id` | Int32 | Magazijn locatie |
| `width_of_cut` | Decimal | Zaagsnede |

## 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)
- `IntrastatGoodsCode` → [IntrastatGoodsCodes](https://docs.fledge.nl/en/api/reference/IntrastatGoodsCodes.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)
- `IntrastatReportPeriod` → [IntrastatReportPeriods](https://docs.fledge.nl/en/api/reference/IntrastatReportPeriods.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)
- `MaterialShape` → [MaterialShapes](https://docs.fledge.nl/en/api/reference/MaterialShapes.md) (one)
- `MaterialType` → [MaterialTypes](https://docs.fledge.nl/en/api/reference/MaterialTypes.md) (one)
- `PurchaseOrderInvoiceHeader` → [PurchaseOrderInvoiceHeaders](https://docs.fledge.nl/en/api/reference/PurchaseOrderInvoiceHeaders.md) (one)
- `PurchaseOrderInvoiceLine` → [PurchaseOrderInvoiceLines](https://docs.fledge.nl/en/api/reference/PurchaseOrderInvoiceLines.md) (one)
- `PurchaseOrderReceiptHeader` → [PurchaseOrderReceiptHeaders](https://docs.fledge.nl/en/api/reference/PurchaseOrderReceiptHeaders.md) (one)

---

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