Przejdź do głównej zawartości

receivePaper

Dla: Programista

MutacjaBetaMutation.receivePaper

Receives paper into stock outside purchase orders (for a delivery ordered in Prynt use receivePurchaseOrder): books a movement — with the price, supplier and delivery document given, kept on it as they were — and raises the stock. The price, currency and supplier on the paper card do not change. Refused for a paper kept for pricing only (Paper.isStock false, PAPER_PRICING_ONLY): the print shop does not track its stock. Not idempotent: retry with Idempotency-Key (one key per receipt written, not per delivery document: one document often holds several lines of one material). Answers with the paper after the receipt.

Wymagany zakreswarehouse:write
Dostępne odPrynt 0.28.0
StabilnośćBeta (co to znaczy)
PonawianieWysyłaj nagłówek Idempotency-Key, żeby ponowienie nie wykonało zapisu drugi raz. Zapisy i idempotencja

Argumenty

NazwaTypOpis
idwymaganeID!

Identifier of the paper.

inputwymaganeReceivePaperInput!

The sheets received.

Zwraca

Paper!

Przykład

Mutacja
mutation ReceivePaper($id: ID!, $input: ReceivePaperInput!) {
receivePaper(id: $id, input: $input) {
id
quantitySheets
}
}
Zmienne
{
"id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b01",
"input": {
"quantityToAdd": 5000,
"unitPrice": 0.42,
"priceUnit": "ark.",
"currency": "PLN",
"supplierId": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b06",
"deliveredAt": "2026-10-24T00:00:00.000Z",
"documentNumber": "WZ 412/2026",
"notes": "2 palety"
}
}
Wywołanie (curl)
IDEMPOTENCY_KEY=$(uuidgen) # ponawiaj z tym samym kluczem
curl -sS https://twoja-drukarnia.prynt.pl/api/v1/graphql \
-H "Authorization: Bearer $PRYNT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
--data-binary @- <<'JSON'
{
"query": "mutation ReceivePaper($id: ID!, $input: ReceivePaperInput!) {\n receivePaper(id: $id, input: $input) {\n id\n quantitySheets\n }\n}",
"variables": {
"id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b01",
"input": {
"quantityToAdd": 5000,
"unitPrice": 0.42,
"priceUnit": "ark.",
"currency": "PLN",
"supplierId": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b06",
"deliveredAt": "2026-10-24T00:00:00.000Z",
"documentNumber": "WZ 412/2026",
"notes": "2 palety"
}
}
}
JSON
Odpowiedź
{
"data": {
"receivePaper": {
"id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b01",
"quantitySheets": 5800
}
}
}