MutacjaBetaMutation.createSupplier
Adds a supplier. Not idempotent: look the supplier up first (e.g. by nip or code), and retry with Idempotency-Key.
| 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 |
|---|---|---|
inputwymagane | CreateSupplierInput! | The new supplier. |
Zwraca
Przykład
mutation CreateSupplier($input: CreateSupplierInput!) { createSupplier(input: $input) { id name code isActive }}{ "input": { "name": "Folie-Pol sp. z o.o.", "code": "FP", "nip": "1234563218", "phone": "+48 12 345 67 89" }}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 CreateSupplier($input: CreateSupplierInput!) {\n createSupplier(input: $input) {\n id\n name\n code\n isActive\n }\n}", "variables": { "input": { "name": "Folie-Pol sp. z o.o.", "code": "FP", "nip": "1234563218", "email": "[email protected]", "phone": "+48 12 345 67 89" } }}JSON{ "data": { "createSupplier": { "id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b14", "name": "Folie-Pol sp. z o.o.", "code": "FP", "isActive": true } }}