Customers Mutations

See the Queries page for a presentation of this resource.

CreateCustomer

Creates a new customer record.

Parameters:

ParameterTypeDescription
inputCustomerInput!All customer data.

Example Query:

mutation CreateCustomer($input: CustomerInput!) {
  CreateCustomer(input: $input) {
    id
    label
    email
    active
  }
}

UpdateCustomer

Updates an existing customer record.

Parameters:

ParameterTypeDescription
idInt!ID of the customer.
inputCustomerInput!Updated fields.

DeleteCustomer

Deletes a single customer.

Parameters:

ParameterTypeDescription
idID!Customer ID.

DeleteCustomers

Deletes multiple customers.

Parameters:

ParameterTypeDescription
ids[ID!]!List of customer IDs.

DisableCustomer

Deactivates a single customer (hidden from active lists).

Parameters:

ParameterTypeDescription
idID!Customer ID.

DisableCustomers

Deactivates multiple customers.

Parameters:

ParameterTypeDescription
ids[ID!]!List of customer IDs.

EnableCustomer

Re-activates a single customer.

Parameters:

ParameterTypeDescription
idID!Customer ID.

EnableCustomers

Re-activates multiple customers.

Parameters:

ParameterTypeDescription
ids[ID!]!List of customer IDs.

DuplicateCustomer

Creates a copy of an existing customer.


ConvertCustomerType

Changes the type of a single customer (Entreprise or Particulier).

Parameters:

ParameterTypeDescription
idID!Customer ID.
customer_typecustomerType!New type: company or individual.

ConvertCustomersType

Changes the type of multiple customers at once.

Parameters:

ParameterTypeDescription
ids[ID!]!List of customer IDs.
customer_typecustomerType!New type: company or individual.

GenerateCustomerNumber

Generates the next available sequence number for a new customer.


CreateCustomerAddresses

Adds one or several addresses to a customer. Each AddressInput must reference the customer through addressable_id; the addressable_type is automatically forced to Customer.

ParameterTypeDescription
input[AddressInput]!List of addresses to add.

Example Query:

mutation CreateCustomerAddresses($input: [AddressInput!]!) {
  CreateCustomerAddresses(input: $input) {
    id
    label
    country
    address_1
    postal_code
    city
    type
    default
  }
}

Example Variables:

{
  "input": [
    {
      "label": "Paris Office",
      "addressable_id": 123,
      "country": "FR",
      "address_1": "10 Rivoli Street",
      "postal_code": "75001",
      "city": "Paris",
      "type": "billing",
      "default": true
    },
    {
      "label": "Lyon Warehouse",
      "addressable_id": 123,
      "country": "FR",
      "address_1": "25 Foch Avenue",
      "postal_code": "69006",
      "city": "Lyon",
      "type": "shipping"
    }
  ]
}

UpdateCustomerAddress

Updates an existing address linked to a customer. The resolver validates that the linked entity is a customer before updating.

ParameterTypeDescription
idID!ID of the address to update.
inputAddressInput!Updated fields.

Example Query:

mutation UpdateCustomerAddress($id: ID!, $input: AddressInput!) {
  UpdateCustomerAddress(id: $id, input: $input) {
    id
    label
    country
    address_1
    postal_code
    city
    type
    default
  }
}

Example Variables:

{
  "id": 501,
  "input": {
    "label": "Paris HQ",
    "address_1": "12 Rivoli Street",
    "postal_code": "75001",
    "city": "Paris"
  }
}

DeleteCustomerAddress

Deletes an address linked to a customer.

ParameterTypeDescription
idID!ID of the address to delete.

Example Query:

mutation DeleteCustomerAddress($id: ID!) {
  DeleteCustomerAddress(id: $id)
}

Example Variables:

{
  "id": 501
}

Input Data Types

CustomerInput

FieldTypeDescription
idIntID for updates.
labelStringCustomer name or company name.
first_nameStringPrimary contact first name.
last_nameStringPrimary contact last name.
emailStringPrimary email address.
addressesCustomerAddressInputInitial addresses list.
customer_numberStringReference number.
customer_typeCustomerTypeIndividual or Company.
websiteStringWebsite URL.
phoneStringPhone number.
statusStringLifecycle status.
notesStringPublic notes.
private_messageStringPrivate internal notes.
currencyCurrencyInputPreferred currency.
location_idIntPrimary location ID.
locationLocationInputLocation details.
price_level_idIntPrice level ID.
price_levelPriceLevelInputPrice level data.
account_representative_idIntRep ID.
account_representativeAccountRepresentativeInputRep data.
tax_numberStringVAT/Tax ID.
company_registration_numberStringRegistration ID.
payment_information_idIntPayment details link ID.
payment_informationPaymentInformationInputPayment details.
discountFloatDefault discount %.
minimum_order_amountFloatMinimum order value.
term_of_payment_daysIntPayment term days.
term_of_payment_typeTermModelTerm calculation logic.
credit_limitFloatMaximum allowed credit.
location_idIntDefault location ID.
locationLocationInputDefault location data.
languageStringPreferred language code.
tax_typeTaxType"exclusive" or "inclusive".
tax_codes[TaxCodeInput]List of applied tax codes.
customer_tags[CustomerTagInput]Segmentation labels.
files[FileInput]Attachments.
order_templatePdfTemplateInputDefault Order PDF design.
shipping_order_templatePdfTemplateInputDefault Shipping PDF design.
invoice_templatePdfTemplateInputDefault Invoice PDF design.
product_return_templatePdfTemplateInputDefault Return PDF design.
credit_note_templatePdfTemplateInputDefault Credit Note PDF design.
refund_templatePdfTemplateInputDefault Refund PDF design.
picking_list_templatePdfTemplateInputDefault Picking PDF design.
estimate_templatePdfTemplateInputDefault Estimate PDF design.
custom_fields[EntityCustomFieldInput]Custom fields for this entity.

CustomerAddressInput

FieldTypeDescription
data[AddressInput]Array of initial addresses.

Enums

CustomerType

Value
company
individual

TermModel

ValueDescription
netDue after X days from document date.
eomDue at End of Month after X days.
eom_firstDue at End of Month (first day focus).

TaxType

ValueDescription
exclusiveTax calculated on top of the net price.
inclusiveTax included in the displayed price.