Create Customer
Create Customer Mutation
Creates a new customer entity in the system.
Arguments
input
CreateCustomerInput!
Input data for creating the customer
Return Type
Customer - The created customer object.
Input Fields
CreateCustomerInput:
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 emailphone- Contact phone numberaddress- Customer address objectcustomerType- Type of customer (individual, business, etc.)creditLimit- Maximum credit allowedpaymentTerms- Payment terms (NET15, NET30, etc.)loyaltyNumber- Customer loyalty program numbertaxId- Tax identification number (for business customers)preferredLanguage- Customer's preferred languagemarketingOptIn- Marketing communication consent
Notes
The
datafield is completely flexible for custom attributesUse
dataTypeSlugto 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?
