MutacjaBetaMutation.addAdditionalCost
Adds an additional cost (for example design work) to an order or to one of its products. Refused for an archived order.
| 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 |
|---|---|---|
inputwymagane | AddAdditionalCostInput! | The cost and the order or product it is charged on. |
Zwraca
Przykład
mutation AddCost($input: AddAdditionalCostInput!) { addAdditionalCost(input: $input) { id orderId productId name category isClientVisible }}{ "input": { "orderId": "4b0d2a63-8e5f-4c9b-8f32-6d7e8f9a0b12", "name": "Ekspresowa realizacja", "category": "RUSH_FEE", "amount": 80 }}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 AddCost($input: AddAdditionalCostInput!) {\n addAdditionalCost(input: $input) {\n id\n orderId\n productId\n name\n category\n isClientVisible\n }\n}", "variables": { "input": { "orderId": "4b0d2a63-8e5f-4c9b-8f32-6d7e8f9a0b12", "name": "Ekspresowa realizacja", "category": "RUSH_FEE", "amount": 80 } }}JSON{ "data": { "addAdditionalCost": { "id": "d07c93b4-6f81-4ca3-9ecf-4a5b6c7d8e96", "orderId": "4b0d2a63-8e5f-4c9b-8f32-6d7e8f9a0b12", "productId": null, "name": "Ekspresowa realizacja", "category": "RUSH_FEE", "isClientVisible": true } }}