Sales order lines moved to history (verkooporderhistorie), one flat row per invoice of a line with order, line, delivery and invoice data; count lines by sales_order_header_id + sales_order_line_id, not rows. The legacy ERP moves them here; the Fledge API only reads them. Questions about orders from the past need this set or the invoices, not only SalesOrderLines. Several field names are misleading: read the notes. Quantities and prices are per the article's price unit, as on SalesOrderLines.

Label in Fledge: Verkooporderhistorie

URLhttps://odata-api.fledge.nl/v2-8/HistoricSalesOrders
Keyadministration_idhistoric_sales_order_idsales_order_header_idsales_order_line_id
AdministrationRows belong to one administration: always filter on administration_id.
OperationsGET listGET onePOSTPATCHDELETE
Read licensesBASIS
Write licensesVERKOOPBEHEER
ScopesFLEDGE_PORTAL

Example requests

A page of rows, with only the fields you need. See Authentication for the token.

curl -G "https://odata-api.fledge.nl/v2-8/HistoricSalesOrders" \
  --data-urlencode '$filter=administration_id eq 1' \
  --data-urlencode '$select=historic_sales_order_id,sales_order_header_id,sales_order_line_id,invoice_quantity,amount_of_packaging_slip,amount_ordered' \
  --data-urlencode '$top=50' \
  -H "Authorization: Bearer $TOKEN"
const url = new URL('https://odata-api.fledge.nl/v2-8/HistoricSalesOrders');
url.searchParams.set('$filter', 'administration_id eq 1');
url.searchParams.set('$select', 'historic_sales_order_id,sales_order_header_id,sales_order_line_id,invoice_quantity,amount_of_packaging_slip,amount_ordered');
url.searchParams.set('$top', '50');

const response = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
const { value } = await response.json();
var url = "https://odata-api.fledge.nl/v2-8/HistoricSalesOrders" + "?" + string.Join("&",
    "$filter=" + Uri.EscapeDataString("administration_id eq 1"),
    "$select=" + Uri.EscapeDataString("historic_sales_order_id,sales_order_header_id,sales_order_line_id,invoice_quantity,amount_of_packaging_slip,amount_ordered"),
    "$top=" + Uri.EscapeDataString("50"));

http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var json = await http.GetStringAsync(url);

One row by its key:

GET https://odata-api.fledge.nl/v2-8/HistoricSalesOrders(administration_id=1,historic_sales_order_id={historic_sales_order_id},sales_order_header_id='{sales_order_header_id}',sales_order_line_id={sales_order_line_id})

Fields

FieldTypeDescription
administration_idkeyInt32Administratienummer
historic_sales_order_idkeyInt32Volgnummer
sales_order_header_idkeyStringOrder nummer
sales_order_line_idkeyInt32Order regel nummer
actual_state_idInt32Courantstatus
agent_idInt32Agent
invoice_quantityDecimalAantal factuur

The quantity invoiced.

amount_of_packaging_slipDecimalAantal pakbon

The quantity on the delivery note, not an amount of money. Repeated on every invoice row of the line: count each delivery_note_header_id + delivery_note_line_id once.

amount_orderedDecimalAantal besteld

The quantity ordered, not an amount of money.

article_group_idInt32Artikelgroep
article_idStringArtikel
based_upon_erBooleanOp basis van VC/NC
benchmarkDecimalMaatstaf intrastat-aangifte
confirmation_date_1DateDatum bevestiging
confirmation_date_2DateDatum bevestiging
containerBooleanVervoer via container ja/nee (intrastat-aangifte)
costDecimalKostprijs
cost_systemInt32Kostprijs systeem
country_idInt32Landnummer
created_byInt32User aanmaak
creation_dateDateDatum aanmaak
creditor_idInt32Leverancier
currency_idInt32Valutacode
currency_unitInt32Valuta eenheid
debtor_company_nameStringBedrijfsnaam debiteur
debtor_group_idInt32Debiteurgroep
debtor_idInt32Debiteur
deed_of_assignmentBooleanAkte van cessie (j/n)
delivery_address_idInt32Aflever adres
delivery_byInt32User pakbon
delivery_condition_idInt32Leveringsconditie
delivery_country_idInt32Landcode aflever adres
delivery_method_idInt32Verzendmethode
delivery_note_header_idStringPakbon
delivery_note_layout_idInt32Pakbon layout
delivery_note_line_idInt32Pakbon regel
delivery_note_memoStringMemo pakbon
delivery_note_weightDecimalGewicht
delivery_person_idInt32Aflever persoon
description_1StringOmschrijving
description_2StringOmschrijving
description_3StringOmschrijving
destination_address_idInt32Land bestemming: Land van bestemming (intrastat-aangifte)

The destination country for the Intrastat declaration (CountryCodes), not an address.

discountDecimalKorting
district_idInt32Rayon
drawing_numberStringTekeningnummer
exchange_rateDecimalKoers
factorDecimalFactor verkoop eenheid
financial_yearInt32Boekjaar
flow_of_goods_code_idInt32Intrastat goederenstroomcode
functionInt32Functie van de regel
has_vatBooleanBTW berekenen
header_descriptionStringOmschrijving order: Omschrijving verkooporderheader
historical_userInt32User historie
history_dateDateDatum historie
import_originInt32Order herkomst
in_intrastat_declarationBooleanIntrastat verwerkt: In intrastat-aangifte verwerkt

Processed in an Intrastat declaration.

intrastat_codeStringIntrastat nummer

An IntrastatItems code, not a goods code.

intrastat_goods_code_idStringIntrastat goederencode

The goods code (IntrastatGoodsCodes).

intrastat_intra_community_delivery_idInt32Soort ICT-order intrastat-aangifte

The Intrastat order type (0 domestic, 2 or 4 delivery to another country, 6 or 8 acquisition); not a key of another table.

intrastat_moving_dateDateDatum intrastat: Datum goederenverplaatsing intrastat

The date the goods moved, for the Intrastat declaration.

intrastat_report_period_idInt32Volgnummer

The Intrastat reporting period the row was declared in; 0 or empty when not declared.

intrastat_traffic_area_idInt32Verkeersgebied code: Verkeersgebiedcode
intrastat_weightDecimalGewicht voor intrastat-aangifte
invoiceStringFactuur

The invoice number.

invoice_address_country_idInt32Landcode fact. adres: Landcode factuur adres
invoice_address_idInt32Factuur adres
invoice_dateDateDatum factuur

The date of the invoice.

invoiced_byInt32User factuur
invoice_debtor_idInt32Factuur debiteur: Factuurdebiteur
invoice_layout_idInt32Factuur layout
invoice_lineInt32Factuur regel
invoice_memoStringMemo factuur
invoice_person_idInt32Factuur persoon
invoice_relation_idInt32Relatie factuur debiteur: Relatie nummer factuur debiteur
invoice_run_idInt32Factuur run
invoice_valueDecimalFactuurwaarde intrastat-aangifte

The invoice value for the Intrastat declaration, not the invoiced amount.

iso_codeStringLandscode
language_codeInt32Taalcode
line_referenceStringReferentie verkooporderregel
main_customer_relation_idInt32Relatie hoofd debiteur: Relatie nummer hoofd debiteur
main_debtor_idInt32Hoofddebiteur
memoStringMemo algemeen
memo_lineStringMemo regel
nominal_priceDecimalNominale prijs
operatorStringOperator verkoop eenheid
order_acknowledgment_idInt32Orderbevestigingsnummer
order_dateDateDatum order
order_discountDecimalOrder korting
originInt32Herkomst (voorraad,inkoop,productie)
our_refStringOnze referentie
packing_note_dateDateDatum pakbon
partial_deliveries_allowedBooleanDeellevering toegestaan
part_of_countryStringLandsdeel
payment_condition_idInt32Betalingsconditie
periodical_invoiceInt32Periode factuur
picklist_byInt32User picklist
pick_list_dateDateDatum picklist
picklist_header_idStringPicklist
picklist_line_idInt32Picklist regel
planning_dateDateDatum planning
postage_priceDecimalPorto prijs
postal_application_order_numberStringBestelnummer postapplicatie
production_orderStringProductieorder
productionorder_subInt32Productieorder schrap
profit_margin_headerDecimalWinstmarge header
profit_margin_lineDecimalWinstmarge regel
purchase_order_idStringInkooporder
purchase_order_line_idInt32Inkooporder regel
relation_idInt32Relatie nummer debiteur
revisionStringRevisie
route_idInt32Route
royalty_priceDecimalRoyalty
sale_group_idInt32Omzetgroep
salesman_idInt32Verkoper
sales_order_header_delivery_date_confirmedDateBevestigde leverdatum
sales_order_header_delivery_date_confirmed_onDateLeverdatum bevestigd op
sales_order_header_is_confirmedBooleanBevestigd ja/nee
sales_order_header_shift_reasonStringReden verschuiving
sales_order_line_delivery_date_confirmedDateBevestigde leverdatum
sales_order_line_delivery_date_confirmed_onDateLeverdatum bevestigd op
sales_order_line_is_confirmedBooleanBevestigd ja/nee
sales_order_line_shift_reasonStringReden verschuiving
sales_order_type_idInt32Verkooporder soort
sales_price_excl_vatDecimalVerkoopprijs bruto

Despite its name, the gross price per unit (before discount).

sales_price_foreign_currency_excl_vatDecimalVerkoopprijs bruto VV
sales_price_foreign_currency_incl_vatDecimalVerkoopprijs netto VV

Despite its name, the net price per unit in the foreign currency, without VAT.

sales_price_with_vatDecimalVerkoopprijs netto

Despite its name, the net price per unit (after discount), without VAT.

sales_quotation_header_idStringVerkoopofferte
sales_quotation_line_idInt32Verkoopofferte regel
sales_unitInt32Verkoop eenheid
sequenceInt32Volgorde
shipping_type_code_idInt32Vervoerwijze code: Intrastat vervoerwijzecode
statistical_system_code_idInt32Stelsel-code: Intrastat statistisch stelsel code
statistic_numberStringStatistieknummer: Statistieknumer
statistics_valueDecimalStatistische waarde intrastat-aangifte
term_ordersBooleanIn termijnen factureren (ja/nee)
trademark_idInt32Handelsmerk id
transaction_code_idInt32Transactie code intrastat
transport_daysInt32Transportdagen
value_tillDecimalWaarde
vat_categoryStringBTW rubriek
vat_codeInt32BTW code
vat_numberStringBTW-nummer
warehouse_address_idInt32Magazijnadres
warehouse_aisle_idInt32Magazijn
warehouse_shelf_idInt32Magazijn locatie
warranty_period_idInt32Garantie termijn
weight_tillDecimalGewicht
your_refStringUw referentie

Relations

Read a related row or list in the same request with $expand, and give it its own $select; a list also needs a $top.

NavigationEntity set
AdministrationAdministrationsone
ArticleArticlesone
ArticleMarketableStatusArticleMarketableStatusesone
CountryCodeCountryCodesone
CreditorCreditorsone
DeliveryNoteAddressRelationAddressesone
DeliveryNoteContactPersonRelationContactPeopleone
DeliveryNoteHeaderDeliveryNoteHeadersone
DeliveryConditionDeliveryConditionsone
HistoricProductionOrderHeaderHistoricProductionOrderHeadersone
IntrastatGoodsCodeIntrastatGoodsCodesone
IntrastatGoodsFlowIntrastatGoodsFlowsone
IntrastatReportPeriodIntrastatReportPeriodsone
IntrastatStatisticsSchemeIntrastatStatisticSchemesone
IntrastatTrafficAreaIntrastatTrafficAreasone
IntrastatTransactionIntrastatTransactionsone
IntrastatTransportModeIntrastatTransportModesone
InvoiceAddressRelationAddressesone
InvoiceContactPersonRelationContactPeopleone
InvoiceDebtorDebtorsone
InvoiceRelationRelationsone
LanguageCodeLanguageCodesone
MainCustomerRelationRelationsone
OrderConfirmationLayoutOrderConfirmationLayoutsone
PaymentTermPaymentConditionsone
PicklistHeaderPickListHeadersone
RelationRelationsone
RevenueGroupRevenueGroupsone
SalesDeliveryNoteLayoutSalesDeliveryNoteLayoutsone
SalesInvoiceHeaderSalesInvoiceHeadersone
SalesInvoiceLayoutSalesInvoiceLayoutsone
SalesInvoiceLineSalesInvoiceLinesone
SalesmanSalesmenone
SalesOrderHeaderSalesOrderHeadersone
SalesOrderLineSalesOrderLinesone
SalesOrderTypeSalesOrderTypesone
ShippingMethodShippingMethodsone
VatCodeVatCodesone
WarehouseAddressWarehouseAddressesone
WarehouseAisleWarehouseAislesone
WarehouseShelfWarehouseShelfsone
WarrantyPeriodWarrantyPeriodsone
Wingman