Przejdź do głównej zawartości

vatRates

Dla: Programista

ZapytanieBetaQuery.vatRates

VAT rates the print shop uses on products and invoices, in its display order. A small list that rarely changes: read it whole with includeInactive: true and keep it — older records still use rates the print shop no longer offers.

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

Argumenty

NazwaTypOpis
includeInactiveBoolean!

True: also the rates the print shop no longer offers (isActive false). Default false: only the rates offered now — use true for a copy that interprets older records.

Domyślnie: false

Zwraca

[VatRate!]!

Przykład

Zapytanie
query VatRates {
vatRates(includeInactive: true) {
id
name
rate
isDefault
isActive
}
}
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 VatRates {\n vatRates(includeInactive: true) {\n id\n name\n rate\n isDefault\n isActive\n }\n}"
}
JSON
Odpowiedź
{
"data": {
"vatRates": [
{
"id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c01",
"name": "23%",
"rate": 0.23,
"isDefault": true,
"isActive": true
},
{
"id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c02",
"name": "8%",
"rate": 0.08,
"isDefault": false,
"isActive": true
},
{
"id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c03",
"name": "5%",
"rate": 0.05,
"isDefault": false,
"isActive": true
},
{
"id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c04",
"name": "7%",
"rate": 0.07,
"isDefault": false,
"isActive": false
}
]
}
}