Which purchase is meant for which sales order: one row per pair of a purchase status row and a sales status row, with the quantity. The links follow the status rows, but not on every action: after an approval or an order instruction a link stays on the finished purchase row, and some sales actions drop links. So a link that exists is a real link, but a missing one doesn't prove there never was one.

Label in Fledge: Verkooporder koppeling met inkooporder

URLhttps://odata-api.fledge.nl/v2-8/SalesPurchaseOrderLinks
Keyadministration_idpurchase_order_header_idpurchase_order_line_idpurchase_order_line_status_idsales_order_header_idsales_order_line_idsales_order_line_status_id
AdministrationRows belong to one administration: always filter on administration_id.
OperationsGET listGET onePOSTPATCHDELETE
Read licensesBASISBASISAPPURENPC
Write licensesVERKOOPINKOOP
ScopesFLEDGE_PORTALFLEDGE_TERMINAL

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/SalesPurchaseOrderLinks" \
  --data-urlencode '$filter=administration_id eq 1' \
  --data-urlencode '$select=purchase_order_header_id,purchase_order_line_id,purchase_order_line_status_id,sales_order_header_id,sales_order_line_id,sales_order_line_status_id,quantity' \
  --data-urlencode '$top=50' \
  -H "Authorization: Bearer $TOKEN"
const url = new URL('https://odata-api.fledge.nl/v2-8/SalesPurchaseOrderLinks');
url.searchParams.set('$filter', 'administration_id eq 1');
url.searchParams.set('$select', 'purchase_order_header_id,purchase_order_line_id,purchase_order_line_status_id,sales_order_header_id,sales_order_line_id,sales_order_line_status_id,quantity');
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/SalesPurchaseOrderLinks" + "?" + string.Join("&",
    "$filter=" + Uri.EscapeDataString("administration_id eq 1"),
    "$select=" + Uri.EscapeDataString("purchase_order_header_id,purchase_order_line_id,purchase_order_line_status_id,sales_order_header_id,sales_order_line_id,sales_order_line_status_id,quantity"),
    "$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/SalesPurchaseOrderLinks(administration_id=1,purchase_order_header_id='{purchase_order_header_id}',purchase_order_line_id={purchase_order_line_id},purchase_order_line_status_id={purchase_order_line_status_id},sales_order_header_id='{sales_order_header_id}',sales_order_line_id={sales_order_line_id},sales_order_line_status_id={sales_order_line_status_id})

Fields

FieldTypeDescription
administration_idkeyInt32Administratienummer
purchase_order_header_idkeyStringOrdernummer
purchase_order_line_idkeyInt32Regelnummer
purchase_order_line_status_idkeyInt32Volgnummer

The purchase status row; it can be a finished one.

sales_order_line_idkeyInt32Regelnummer
sales_order_header_idkeyStringVerkoopordernummer
sales_order_line_status_idkeyInt32Volgnummer

The sales status row (SalesOrderLineStatuses).

quantityDecimalAantal

The quantity of the purchase meant for the sales line.

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
PurchaseOrderHeaderPurchaseOrderHeadersone
PurchaseOrderLinePurchaseOrderLinesone
PurchaseOrderLineStatusPurchaseOrderLineStatusesone
SalesOrderHeadersSalesOrderHeadersone
SalesOrderLinesSalesOrderLinesone
SalesOrderLineStatusesSalesOrderLineStatusesone
Wingman