Przejdź do głównej zawartości

withdrawPaper

Dla: Programista

MutacjaBetaMutation.withdrawPaper

Issues paper from stock (production, waste, a correction, a return to the supplier): books a movement and lowers the stock by the sheets taken. Refused when it takes more than the stock (STOCK_INSUFFICIENT) and for a paper kept for pricing only (Paper.isStock false, PAPER_PRICING_ONLY). Issued for an order, it fulfils the order's reservations of this paper. Not idempotent: retry with Idempotency-Key. Answers with the paper after the issue.

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.

inputwymaganeWithdrawPaperInput!

The sheets taken and what for.

Zwraca

Paper!

Przykład

Mutacja
mutation IssuePaper($id: ID!, $input: WithdrawPaperInput!) {
withdrawPaper(id: $id, input: $input) {
id
quantitySheets
updatedAt
}
}
Zmienne
{
"id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b01",
"input": {
"quantity": 1200,
"withdrawalType": "PRODUCTION",
"orderId": "9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
"notes": "Druk okładek"
}
}
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 IssuePaper($id: ID!, $input: WithdrawPaperInput!) {\n withdrawPaper(id: $id, input: $input) {\n id\n quantitySheets\n updatedAt\n }\n}",
"variables": {
"id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b01",
"input": {
"quantity": 1200,
"withdrawalType": "PRODUCTION",
"orderId": "9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
"notes": "Druk okładek"
}
}
}
JSON
Odpowiedź
{
"data": {
"withdrawPaper": {
"id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b01",
"quantitySheets": 800,
"updatedAt": "2026-10-05T07:41:12.004Z"
}
}
}