MutacjaBetaMutation.createClientAddress
Adds an address to a client. With isDefault, it becomes the default address of its type and the previous default one stops being it.
| Wymagany zakres | clients: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 |
|---|---|---|
clientIdwymagane | ID! | Identifier of the client. |
inputwymagane | ClientAddressInput! | The new address. |
Zwraca
Przykład
mutation CreateClientAddress($clientId: ID!, $input: ClientAddressInput!) { createClientAddress(clientId: $clientId, input: $input) { id type name zip city isDefault }}{ "clientId": "6c2e4a1b-7d3f-4e5a-9b8c-0d1e2f3a4b5c", "input": { "type": "DELIVERY", "name": "Magazyn Pruszków", "street": "Składowa", "buildingNumber": "3", "zip": "05-800", "city": "Pruszków", "country": "Polska", "opensAt": "07:00", "closesAt": "15:00", "isDefault": true }}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 CreateClientAddress($clientId: ID!, $input: ClientAddressInput!) {\n createClientAddress(clientId: $clientId, input: $input) {\n id\n type\n name\n zip\n city\n isDefault\n }\n}", "variables": { "clientId": "6c2e4a1b-7d3f-4e5a-9b8c-0d1e2f3a4b5c", "input": { "type": "DELIVERY", "name": "Magazyn Pruszków", "street": "Składowa", "buildingNumber": "3", "zip": "05-800", "city": "Pruszków", "country": "Polska", "opensAt": "07:00", "closesAt": "15:00", "isDefault": true } }}JSON{ "data": { "createClientAddress": { "id": "9f5b7d4e-0a6c-4b8d-8e1f-3a4b5c6d7e8f", "type": "DELIVERY", "name": "Magazyn Pruszków", "zip": "05-800", "city": "Pruszków", "isDefault": true } }}