createPartner
Requires at least one of the permissions customers:customer:create or suppliers:supplier:create.
Creates a customer or supplier in your organization. The permission needed follows the roles the new partner carries: customers create for a customer, suppliers create for a supplier.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation CreatePartner($createPartnerInput: CreatePartnerInput!) {
createPartner(createPartnerInput: $createPartnerInput) {
id
code
registrationNumber
name
displayName
legalName
addresses {
id
postalCode
contactName
type
createdAt
city
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CreatePartner($createPartnerInput: CreatePartnerInput!) {\n createPartner(createPartnerInput: $createPartnerInput) {\n id\n code\n registrationNumber\n name\n displayName\n legalName\n addresses {\n id\n postalCode\n contactName\n type\n createdAt\n city\n }\n }\n}",
"variables": {
"createPartnerInput": {
"addresses": [
{
"city": "string",
"country": "string",
"isActive": true,
"isDefault": true,
"postalCode": "string",
"priority": "BILLING",
"state": "string",
"street1": "string",
"type": "BILLING"
}
],
"contacts": [
{
"isActive": true,
"isDefault": true,
"priority": "EMERGENCY",
"type": "ACCOUNTING",
"value": "string"
}
],
"name": "string",
"paymentTerms": "string",
"roles": [
"CUSTOMER"
],
"tags": [
"string"
]
}
}
}
EOF
Variables:
{
"createPartnerInput": {
"addresses": [
{
"city": "string",
"country": "string",
"isActive": true,
"isDefault": true,
"postalCode": "string",
"priority": "BILLING",
"state": "string",
"street1": "string",
"type": "BILLING"
}
],
"contacts": [
{
"isActive": true,
"isDefault": true,
"priority": "EMERGENCY",
"type": "ACCOUNTING",
"value": "string"
}
],
"name": "string",
"paymentTerms": "string",
"roles": [
"CUSTOMER"
],
"tags": [
"string"
]
}
}
Response:
{
"data": {
"createPartner": {
"id": "id",
"code": "string",
"registrationNumber": "string",
"name": "string",
"displayName": "string",
"legalName": "string",
"addresses": [
{
"id": "id",
"postalCode": "string",
"contactName": "string",
"type": "string",
"createdAt": "2025-01-15T00:00:00Z",
"city": "string"
}
]
}
}
}
createPartner(
createPartnerInput: CreatePartnerInput!
): Partner!
Arguments
createPartner.createPartnerInput ● CreatePartnerInput! non-null input
The partner to create, including its roles.
Type
Partner object
A partner: the one master record for customers and vendors, with its roles, addresses, contacts and account details.