Przejdź do głównej zawartości

createClient

Dla: Programista

MutacjaBetaMutation.createClient

Adds a client — with its headquarters address and, for a person, a self contact — and, from an integration, the integration's own reference (externalRef). The print shop completes the commercial terms (credit limit, discount, payment term and method, invoicing billing entity, currency) and any block in Prynt.

Wymagany zakresclients:write
Dostępne odPrynt 0.28.0
StabilnośćBeta (co to znaczy)
PonawianieWysyłaj nagłówek Idempotency-Key, żeby ponowienie nie wykonało zapisu drugi raz. Zapisy i idempotencja

Argumenty

NazwaTypOpis
inputwymaganeCreateClientInput!

The new client.

Zwraca

Client!

Przykład

Mutacja
mutation CreateClient($input: CreateClientInput!) {
createClient(input: $input) {
id
externalRef
displayName
addresses {
type
zip
city
}
updatedAt
}
}
Zmienne
{
"input": {
"type": "COMPANY",
"legalName": "Wydawnictwo Lipowe sp. z o.o.",
"taxIdentificationNumber": "5213000001",
"email": "[email protected]",
"phone": "+48221002030",
"street": "Lipowa",
"buildingNumber": "7",
"zip": "00950",
"city": "Warszawa",
"country": "Polska",
"externalRef": "crm-1042"
}
}
Wywołanie (curl)
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 CreateClient($input: CreateClientInput!) {\n createClient(input: $input) {\n id\n externalRef\n displayName\n addresses {\n type\n zip\n city\n }\n updatedAt\n }\n}",
"variables": {
"input": {
"type": "COMPANY",
"legalName": "Wydawnictwo Lipowe sp. z o.o.",
"taxIdentificationNumber": "5213000001",
"email": "[email protected]",
"phone": "+48221002030",
"street": "Lipowa",
"buildingNumber": "7",
"zip": "00950",
"city": "Warszawa",
"country": "Polska",
"externalRef": "crm-1042"
}
}
}
JSON
Odpowiedź
{
"data": {
"createClient": {
"id": "6c2e4a1b-7d3f-4e5a-9b8c-0d1e2f3a4b5c",
"externalRef": "crm-1042",
"displayName": "Wydawnictwo Lipowe sp. z o.o.",
"addresses": [
{
"type": "HEADQUARTERS",
"zip": "00-950",
"city": "Warszawa"
}
],
"updatedAt": "2026-10-05T08:12:40.511Z"
}
}
}