MutacjaBetaMutation.updateOrder
Changes an order: its fields, status, contact, delivery addresses or billing details. Products are added and changed with createProduct and updateProduct. Order.updatedAt moves only when something really changed: the same values sent again leave it as it was.
| Wymagany zakres | orders: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 order to change. |
inputwymagane | UpdateOrderInput! | What to change: fields left out keep their values. An explicit null is refused unless the field says otherwise. |
Zwraca
Przykład
mutation UpdateOrder($id: ID!, $input: UpdateOrderInput!) { updateOrder(id: $id, input: $input) { id status paymentStatus completionDate updatedAt }}{ "id": "4b0d2a63-8e5f-4c9b-8f32-6d7e8f9a0b12", "input": { "paymentStatus": "PAID", "completionDate": "2026-10-20" }}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 UpdateOrder($id: ID!, $input: UpdateOrderInput!) {\n updateOrder(id: $id, input: $input) {\n id\n status\n paymentStatus\n completionDate\n updatedAt\n }\n}", "variables": { "id": "4b0d2a63-8e5f-4c9b-8f32-6d7e8f9a0b12", "input": { "paymentStatus": "PAID", "completionDate": "2026-10-20" } }}JSON{ "data": { "updateOrder": { "id": "4b0d2a63-8e5f-4c9b-8f32-6d7e8f9a0b12", "status": "CREATED", "paymentStatus": "PAID", "completionDate": "2026-10-20T00:00:00.000Z", "updatedAt": "2026-10-05T09:41:15.027Z" } }}