Create Customer

Create Customer Mutation

Creates a new customer entity in the system.

Arguments

Name
Type
Description

input

CreateCustomerInput!

Input data for creating the customer

Return Type

Customer - The created customer object.

Input Fields

CreateCustomerInput:

Field
Type
Description

dataTypeID

UUID

Optional data type ID

dataTypeSlug

String

Optional data type slug

data

Map

Custom data for the customer

Usage Example

mutation {
  createCustomer(
    input: {
      dataTypeSlug: "retail_customer",
      data: {
        "name": "John Smith",
        "email": "[email protected]",
        "phone": "+1-555-0123",
        "address": {
          "street": "123 Main Street",
          "city": "New York",
          "state": "NY",
          "zip": "10001",
          "country": "USA"
        },
        "customerType": "individual",
        "preferredLanguage": "en",
        "marketingOptIn": true,
        "loyaltyNumber": "CUST-12345",
        "creditLimit": 5000.00,
        "paymentTerms": "NET15"
      }
    }
  ) {
    id
    dataTypeSlug
    data
    createdAt
  }
}

Common Data Fields

While the data field is flexible, common customer attributes include:

  • name - Customer name (individual or company)

  • email - Primary contact email

  • phone - Contact phone number

  • address - Customer address object

  • customerType - Type of customer (individual, business, etc.)

  • creditLimit - Maximum credit allowed

  • paymentTerms - Payment terms (NET15, NET30, etc.)

  • loyaltyNumber - Customer loyalty program number

  • taxId - Tax identification number (for business customers)

  • preferredLanguage - Customer's preferred language

  • marketingOptIn - Marketing communication consent

Notes

  • The data field is completely flexible for custom attributes

  • Use dataTypeSlug to categorize customers (retail, wholesale, VIP, etc.)

  • Customer email addresses should be unique within your system

  • Consider setting up customer-specific pricing rules after creation

Last updated

Was this helpful?