Przejdź do głównej zawartości

purchaseOrders

Dla: Programista

ZapytanieBetaQuery.purchaseOrders

Purchase orders to suppliers, one page at a time, with the total count. Filter and sort them; with updatedFrom and the UPDATED_AT sort, fetch only orders changed since your last sync; with externalRef, find the order you gave that reference.

Wymagany zakreswarehouse:read
Dostępne odPrynt 0.28.0
StabilnośćBeta (co to znaczy)

Argumenty

NazwaTypOpis
filterPurchaseOrderFilterInput

Conditions the purchase orders must meet; without it every purchase order is listed.

paginationPaginationInput

Page of the list to return; without it the first page at the default size.

sortPurchaseOrderSortInput

Order of the list; without it latest ordered first.

Zwraca

PurchaseOrdersResult!

Przykład

Zapytanie
query PurchaseOrderByRef($ref: String!) {
purchaseOrders(filter: { externalRef: $ref }) {
totalCount
items {
id
code
status
externalRef
supplier {
name
}
}
}
}
Zmienne
{
"ref": "SUP-2026-0042"
}
Wywołanie (curl)
curl -sS https://twoja-drukarnia.prynt.pl/api/v1/graphql \
-H "Authorization: Bearer $PRYNT_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"query": "query PurchaseOrderByRef($ref: String!) {\n purchaseOrders(filter: { externalRef: $ref }) {\n totalCount\n items {\n id\n code\n status\n externalRef\n supplier {\n name\n }\n }\n }\n}",
"variables": {
"ref": "SUP-2026-0042"
}
}
JSON
Odpowiedź
{
"data": {
"purchaseOrders": {
"totalCount": 1,
"items": [
{
"id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b07",
"code": "PO-240",
"status": "SENT",
"externalRef": "SUP-2026-0042",
"supplier": {
"name": "Papyrus Polska"
}
}
]
}
}
}