convertCustomerToVendor
Requires the permissions customers:customer:update and suppliers:supplier:create.
Adds the supplier role and a vendor account to a customer. Refused if the customer is already a vendor. Needs the customers update and suppliers create permissions.
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 ConvertCustomerToVendor($id: ID!, $vendorData: ConvertToVendorInput!) {
convertCustomerToVendor(id: $id, vendorData: $vendorData) {
id
code
registrationNumber
name
customerTierName
displayName
addresses {
id
postalCode
contactName
type
createdAt
addressLine1
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ConvertCustomerToVendor($id: ID!, $vendorData: ConvertToVendorInput!) {\n convertCustomerToVendor(id: $id, vendorData: $vendorData) {\n id\n code\n registrationNumber\n name\n customerTierName\n displayName\n addresses {\n id\n postalCode\n contactName\n type\n createdAt\n addressLine1\n }\n }\n}",
"variables": {
"id": "id",
"vendorData": {}
}
}
EOF
Variables:
{
"id": "id",
"vendorData": {}
}
Response:
{
"data": {
"convertCustomerToVendor": {
"id": "id",
"code": "string",
"registrationNumber": "string",
"name": "string",
"customerTierName": "string",
"displayName": "string",
"addresses": [
{
"id": "id",
"postalCode": "string",
"contactName": "string",
"type": "string",
"createdAt": "2025-01-15T00:00:00Z",
"addressLine1": "string"
}
]
}
}
}
convertCustomerToVendor(
id: ID!
vendorData: ConvertToVendorInput!
): Customer!
Arguments
convertCustomerToVendor.id ● ID! non-null scalar
The ID of the customer.
convertCustomerToVendor.vendorData ● ConvertToVendorInput! non-null input
The vendor account details. Payment terms fall back to the organization's default when left out.
Type
Customer object
A customer: a partner with the customer role.