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
| URL | https://odata-api.fledge.nl/v2-8/SalesPurchaseOrderLinks |
|---|---|
| Key | administration_idpurchase_order_header_idpurchase_order_line_idpurchase_order_line_status_idsales_order_header_idsales_order_line_idsales_order_line_status_id |
| Administration | Rows belong to one administration: always filter on administration_id. |
| Operations | GET listGET onePOSTPATCHDELETE |
| Read licenses | BASISBASISAPPURENPC |
| Write licenses | VERKOOPINKOOP |
| Scopes | FLEDGE_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
| Field | Type | Description |
|---|---|---|
administration_idkey | Int32 | Administratienummer |
purchase_order_header_idkey | String | Ordernummer |
purchase_order_line_idkey | Int32 | Regelnummer |
purchase_order_line_status_idkey | Int32 | Volgnummer The purchase status row; it can be a finished one. |
sales_order_line_idkey | Int32 | Regelnummer |
sales_order_header_idkey | String | Verkoopordernummer |
sales_order_line_status_idkey | Int32 | Volgnummer The sales status row (SalesOrderLineStatuses). |
quantity | Decimal | Aantal 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.
| Navigation | Entity set | |
|---|---|---|
Administration | Administrations | one |
PurchaseOrderHeader | PurchaseOrderHeaders | one |
PurchaseOrderLine | PurchaseOrderLines | one |
PurchaseOrderLineStatus | PurchaseOrderLineStatuses | one |
SalesOrderHeaders | SalesOrderHeaders | one |
SalesOrderLines | SalesOrderLines | one |
SalesOrderLineStatuses | SalesOrderLineStatuses | one |