MutacjaBetaMutation.receivePaint
Receives paint 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 paint card do not change. 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 paint after the receipt.
| Wymagany zakres | warehouse:write |
|---|---|
| Dostępne od | Prynt 0.28.0 |
| Stabilność | Beta (co to znaczy) |
| Ponawianie | Wysyłaj nagłówek Idempotency-Key, żeby ponowienie nie wykonało zapisu drugi raz. Zapisy i idempotencja |
Argumenty
| Nazwa | Typ | Opis |
|---|---|---|
idwymagane | ID! | Identifier of the paint. |
inputwymagane | ReceivePaintInput! | The grams received. |
Zwraca
Przykład
mutation ReceivePaint($id: ID!, $input: ReceivePaintInput!) { receivePaint(id: $id, input: $input) { id quantityGrams }}{ "id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b02", "input": { "quantityToAdd": 2500, "unitPrice": 52.3, "priceUnit": "kg", "supplierId": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b06", "documentNumber": "WZ 77/2026" }}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 ReceivePaint($id: ID!, $input: ReceivePaintInput!) {\n receivePaint(id: $id, input: $input) {\n id\n quantityGrams\n }\n}", "variables": { "id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b02", "input": { "quantityToAdd": 2500, "unitPrice": 52.3, "priceUnit": "kg", "supplierId": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b06", "documentNumber": "WZ 77/2026" } }}JSON{ "data": { "receivePaint": { "id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b02", "quantityGrams": 4849.5 } }}