Przejdź do głównej zawartości

purchaseInvoices

Dla: Programista

ZapytanieBetaQuery.purchaseInvoices

Purchase invoices (from suppliers), one page at a time, with the total count. Filter by supplier, number or date; with updatedFrom and the UPDATED_AT sort, fetch only invoices recorded or changed since your last sync. Without a sort: the latest invoice date first.

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

Argumenty

NazwaTypOpis
filterPurchaseInvoiceFilterInput

Conditions the invoices must meet; without it every invoice is listed.

paginationPaginationInput

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

sortPurchaseInvoiceSortInput

Order of the list; without it the latest invoice date first.

Zwraca

PurchaseInvoicesResult!

Przykład

Zapytanie
query PurchaseInvoices($from: DateTime) {
purchaseInvoices(
filter: { updatedFrom: $from }
sort: { field: UPDATED_AT, direction: ASC }
pagination: { page: 1, pageSize: 50 }
) {
items {
id
invoiceNumber
invoiceDate
supplierId
currency
amountNet
amountGross
updatedAt
}
pageInfo {
hasNextPage
}
}
}
Zmienne
{
"from": "2026-10-01T00:00:00.000Z"
}
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 PurchaseInvoices($from: DateTime) {\n purchaseInvoices(\n filter: { updatedFrom: $from }\n sort: { field: UPDATED_AT, direction: ASC }\n pagination: { page: 1, pageSize: 50 }\n ) {\n items {\n id\n invoiceNumber\n invoiceDate\n supplierId\n currency\n amountNet\n amountGross\n updatedAt\n }\n pageInfo {\n hasNextPage\n }\n }\n}",
"variables": {
"from": "2026-10-01T00:00:00.000Z"
}
}
JSON
Odpowiedź
{
"data": {
"purchaseInvoices": {
"items": [
{
"id": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f01",
"invoiceNumber": "FS/2026/10/0331",
"invoiceDate": "2026-10-02T00:00:00.000Z",
"supplierId": "6b2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e02",
"currency": "PLN",
"amountNet": 2220,
"amountGross": 2730.6,
"updatedAt": "2026-10-02T13:20:00.000Z"
}
],
"pageInfo": {
"hasNextPage": false
}
}
}
}