Skip to main content

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:

mutation ConvertCustomerToVendor($id: ID!, $vendorData: ConvertToVendorInput!) {
convertCustomerToVendor(id: $id, vendorData: $vendorData) {
id
code
registrationNumber
name
customerTierName
displayName
addresses {
id
postalCode
contactName
type
createdAt
addressLine1
}
}
}

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.