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
| URL | https://odata-api.fledge.nl/v2-8/HistoricSalesOrders |
|---|---|
| Key | administration_idhistoric_sales_order_idsales_order_header_idsales_order_line_id |
| Administration | Rows belong to one administration: always filter on administration_id. |
| Operations | GET listGET onePOSTPATCHDELETE |
| Read licenses | BASIS |
| Write licenses | VERKOOPBEHEER |
| Scopes | FLEDGE_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
| Field | Type | Description |
|---|---|---|
administration_idkey | Int32 | Administratienummer |
historic_sales_order_idkey | Int32 | Volgnummer |
sales_order_header_idkey | String | Order nummer |
sales_order_line_idkey | Int32 | Order regel nummer |
actual_state_id | Int32 | Courantstatus |
agent_id | Int32 | Agent |
invoice_quantity | Decimal | Aantal factuur The quantity invoiced. |
amount_of_packaging_slip | Decimal | Aantal 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_ordered | Decimal | Aantal besteld The quantity ordered, not an amount of money. |
article_group_id | Int32 | Artikelgroep |
article_id | String | Artikel |
based_upon_er | Boolean | Op basis van VC/NC |
benchmark | Decimal | Maatstaf intrastat-aangifte |
confirmation_date_1 | Date | Datum bevestiging |
confirmation_date_2 | Date | Datum bevestiging |
container | Boolean | Vervoer via container ja/nee (intrastat-aangifte) |
cost | Decimal | Kostprijs |
cost_system | Int32 | Kostprijs systeem |
country_id | Int32 | Landnummer |
created_by | Int32 | User aanmaak |
creation_date | Date | Datum aanmaak |
creditor_id | Int32 | Leverancier |
currency_id | Int32 | Valutacode |
currency_unit | Int32 | Valuta eenheid |
debtor_company_name | String | Bedrijfsnaam debiteur |
debtor_group_id | Int32 | Debiteurgroep |
debtor_id | Int32 | Debiteur |
deed_of_assignment | Boolean | Akte van cessie (j/n) |
delivery_address_id | Int32 | Aflever adres |
delivery_by | Int32 | User pakbon |
delivery_condition_id | Int32 | Leveringsconditie |
delivery_country_id | Int32 | Landcode aflever adres |
delivery_method_id | Int32 | Verzendmethode |
delivery_note_header_id | String | Pakbon |
delivery_note_layout_id | Int32 | Pakbon layout |
delivery_note_line_id | Int32 | Pakbon regel |
delivery_note_memo | String | Memo pakbon |
delivery_note_weight | Decimal | Gewicht |
delivery_person_id | Int32 | Aflever persoon |
description_1 | String | Omschrijving |
description_2 | String | Omschrijving |
description_3 | String | Omschrijving |
destination_address_id | Int32 | Land bestemming: Land van bestemming (intrastat-aangifte) The destination country for the Intrastat declaration (CountryCodes), not an address. |
discount | Decimal | Korting |
district_id | Int32 | Rayon |
drawing_number | String | Tekeningnummer |
exchange_rate | Decimal | Koers |
factor | Decimal | Factor verkoop eenheid |
financial_year | Int32 | Boekjaar |
flow_of_goods_code_id | Int32 | Intrastat goederenstroomcode |
function | Int32 | Functie van de regel |
has_vat | Boolean | BTW berekenen |
header_description | String | Omschrijving order: Omschrijving verkooporderheader |
historical_user | Int32 | User historie |
history_date | Date | Datum historie |
import_origin | Int32 | Order herkomst |
in_intrastat_declaration | Boolean | Intrastat verwerkt: In intrastat-aangifte verwerkt Processed in an Intrastat declaration. |
intrastat_code | String | Intrastat nummer An IntrastatItems code, not a goods code. |
intrastat_goods_code_id | String | Intrastat goederencode The goods code (IntrastatGoodsCodes). |
intrastat_intra_community_delivery_id | Int32 | Soort 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_date | Date | Datum intrastat: Datum goederenverplaatsing intrastat The date the goods moved, for the Intrastat declaration. |
intrastat_report_period_id | Int32 | Volgnummer The Intrastat reporting period the row was declared in; 0 or empty when not declared. |
intrastat_traffic_area_id | Int32 | Verkeersgebied code: Verkeersgebiedcode |
intrastat_weight | Decimal | Gewicht voor intrastat-aangifte |
invoice | String | Factuur The invoice number. |
invoice_address_country_id | Int32 | Landcode fact. adres: Landcode factuur adres |
invoice_address_id | Int32 | Factuur adres |
invoice_date | Date | Datum factuur The date of the invoice. |
invoiced_by | Int32 | User factuur |
invoice_debtor_id | Int32 | Factuur debiteur: Factuurdebiteur |
invoice_layout_id | Int32 | Factuur layout |
invoice_line | Int32 | Factuur regel |
invoice_memo | String | Memo factuur |
invoice_person_id | Int32 | Factuur persoon |
invoice_relation_id | Int32 | Relatie factuur debiteur: Relatie nummer factuur debiteur |
invoice_run_id | Int32 | Factuur run |
invoice_value | Decimal | Factuurwaarde intrastat-aangifte The invoice value for the Intrastat declaration, not the invoiced amount. |
iso_code | String | Landscode |
language_code | Int32 | Taalcode |
line_reference | String | Referentie verkooporderregel |
main_customer_relation_id | Int32 | Relatie hoofd debiteur: Relatie nummer hoofd debiteur |
main_debtor_id | Int32 | Hoofddebiteur |
memo | String | Memo algemeen |
memo_line | String | Memo regel |
nominal_price | Decimal | Nominale prijs |
operator | String | Operator verkoop eenheid |
order_acknowledgment_id | Int32 | Orderbevestigingsnummer |
order_date | Date | Datum order |
order_discount | Decimal | Order korting |
origin | Int32 | Herkomst (voorraad,inkoop,productie) |
our_ref | String | Onze referentie |
packing_note_date | Date | Datum pakbon |
partial_deliveries_allowed | Boolean | Deellevering toegestaan |
part_of_country | String | Landsdeel |
payment_condition_id | Int32 | Betalingsconditie |
periodical_invoice | Int32 | Periode factuur |
picklist_by | Int32 | User picklist |
pick_list_date | Date | Datum picklist |
picklist_header_id | String | Picklist |
picklist_line_id | Int32 | Picklist regel |
planning_date | Date | Datum planning |
postage_price | Decimal | Porto prijs |
postal_application_order_number | String | Bestelnummer postapplicatie |
production_order | String | Productieorder |
productionorder_sub | Int32 | Productieorder schrap |
profit_margin_header | Decimal | Winstmarge header |
profit_margin_line | Decimal | Winstmarge regel |
purchase_order_id | String | Inkooporder |
purchase_order_line_id | Int32 | Inkooporder regel |
relation_id | Int32 | Relatie nummer debiteur |
revision | String | Revisie |
route_id | Int32 | Route |
royalty_price | Decimal | Royalty |
sale_group_id | Int32 | Omzetgroep |
salesman_id | Int32 | Verkoper |
sales_order_header_delivery_date_confirmed | Date | Bevestigde leverdatum |
sales_order_header_delivery_date_confirmed_on | Date | Leverdatum bevestigd op |
sales_order_header_is_confirmed | Boolean | Bevestigd ja/nee |
sales_order_header_shift_reason | String | Reden verschuiving |
sales_order_line_delivery_date_confirmed | Date | Bevestigde leverdatum |
sales_order_line_delivery_date_confirmed_on | Date | Leverdatum bevestigd op |
sales_order_line_is_confirmed | Boolean | Bevestigd ja/nee |
sales_order_line_shift_reason | String | Reden verschuiving |
sales_order_type_id | Int32 | Verkooporder soort |
sales_price_excl_vat | Decimal | Verkoopprijs bruto Despite its name, the gross price per unit (before discount). |
sales_price_foreign_currency_excl_vat | Decimal | Verkoopprijs bruto VV |
sales_price_foreign_currency_incl_vat | Decimal | Verkoopprijs netto VV Despite its name, the net price per unit in the foreign currency, without VAT. |
sales_price_with_vat | Decimal | Verkoopprijs netto Despite its name, the net price per unit (after discount), without VAT. |
sales_quotation_header_id | String | Verkoopofferte |
sales_quotation_line_id | Int32 | Verkoopofferte regel |
sales_unit | Int32 | Verkoop eenheid |
sequence | Int32 | Volgorde |
shipping_type_code_id | Int32 | Vervoerwijze code: Intrastat vervoerwijzecode |
statistical_system_code_id | Int32 | Stelsel-code: Intrastat statistisch stelsel code |
statistic_number | String | Statistieknummer: Statistieknumer |
statistics_value | Decimal | Statistische waarde intrastat-aangifte |
term_orders | Boolean | In termijnen factureren (ja/nee) |
trademark_id | Int32 | Handelsmerk id |
transaction_code_id | Int32 | Transactie code intrastat |
transport_days | Int32 | Transportdagen |
value_till | Decimal | Waarde |
vat_category | String | BTW rubriek |
vat_code | Int32 | BTW code |
vat_number | String | BTW-nummer |
warehouse_address_id | Int32 | Magazijnadres |
warehouse_aisle_id | Int32 | Magazijn |
warehouse_shelf_id | Int32 | Magazijn locatie |
warranty_period_id | Int32 | Garantie termijn |
weight_till | Decimal | Gewicht |
your_ref | String | Uw 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.
| Navigation | Entity set | |
|---|---|---|
Administration | Administrations | one |
Article | Articles | one |
ArticleMarketableStatus | ArticleMarketableStatuses | one |
CountryCode | CountryCodes | one |
Creditor | Creditors | one |
DeliveryNoteAddress | RelationAddresses | one |
DeliveryNoteContactPerson | RelationContactPeople | one |
DeliveryNoteHeader | DeliveryNoteHeaders | one |
DeliveryCondition | DeliveryConditions | one |
HistoricProductionOrderHeader | HistoricProductionOrderHeaders | one |
IntrastatGoodsCode | IntrastatGoodsCodes | one |
IntrastatGoodsFlow | IntrastatGoodsFlows | one |
IntrastatReportPeriod | IntrastatReportPeriods | one |
IntrastatStatisticsScheme | IntrastatStatisticSchemes | one |
IntrastatTrafficArea | IntrastatTrafficAreas | one |
IntrastatTransaction | IntrastatTransactions | one |
IntrastatTransportMode | IntrastatTransportModes | one |
InvoiceAddress | RelationAddresses | one |
InvoiceContactPerson | RelationContactPeople | one |
InvoiceDebtor | Debtors | one |
InvoiceRelation | Relations | one |
LanguageCode | LanguageCodes | one |
MainCustomerRelation | Relations | one |
OrderConfirmationLayout | OrderConfirmationLayouts | one |
PaymentTerm | PaymentConditions | one |
PicklistHeader | PickListHeaders | one |
Relation | Relations | one |
RevenueGroup | RevenueGroups | one |
SalesDeliveryNoteLayout | SalesDeliveryNoteLayouts | one |
SalesInvoiceHeader | SalesInvoiceHeaders | one |
SalesInvoiceLayout | SalesInvoiceLayouts | one |
SalesInvoiceLine | SalesInvoiceLines | one |
Salesman | Salesmen | one |
SalesOrderHeader | SalesOrderHeaders | one |
SalesOrderLine | SalesOrderLines | one |
SalesOrderType | SalesOrderTypes | one |
ShippingMethod | ShippingMethods | one |
VatCode | VatCodes | one |
WarehouseAddress | WarehouseAddresses | one |
WarehouseAisle | WarehouseAisles | one |
WarehouseShelf | WarehouseShelfs | one |
WarrantyPeriod | WarrantyPeriods | one |