MutacjaBetaMutation.withdrawPaint
Issues paint from stock (production, waste, a correction, a return to the supplier): books a movement and lowers the stock by the grams taken. Refused when it takes more than the stock (STOCK_INSUFFICIENT). Not idempotent: retry with Idempotency-Key. Answers with the paint after the issue.
| 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 | WithdrawPaintInput! | The grams taken and what for. |
Zwraca
Przykład
mutation IssuePaint($id: ID!, $input: WithdrawPaintInput!) { withdrawPaint(id: $id, input: $input) { id quantityGrams }}{ "id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b02", "input": { "quantity": 500, "withdrawalType": "PRODUCTION", "orderId": "9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d" }}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 IssuePaint($id: ID!, $input: WithdrawPaintInput!) {\n withdrawPaint(id: $id, input: $input) {\n id\n quantityGrams\n }\n}", "variables": { "id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b02", "input": { "quantity": 500, "withdrawalType": "PRODUCTION", "orderId": "9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d" } }}JSON{ "data": { "withdrawPaint": { "id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b02", "quantityGrams": 2349.5 } }}