> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/mutations/createcustomer.md).

# 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

```graphql
mutation {
  createCustomer(
    input: {
      dataTypeSlug: "retail_customer",
      data: {
        "name": "John Smith",
        "email": "john.smith@example.com",
        "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
  }
}
```

```graphql
mutation {
  # Create a business customer
  createCustomer(
    input: {
      dataTypeSlug: "business_customer",
      data: {
        "companyName": "Tech Solutions Inc.",
        "contactName": "Jane Doe",
        "email": "jane.doe@techsolutions.com",
        "phone": "+1-555-0456",
        "taxId": "12-3456789",
        "address": {
          "street": "456 Business Ave",
          "city": "San Francisco",
          "state": "CA",
          "zip": "94105",
          "country": "USA"
        },
        "accountManager": "Alice Johnson",
        "contractNumber": "CONT-2024-001",
        "creditLimit": 50000.00,
        "paymentTerms": "NET30",
        "industryType": "technology"
      }
    }
  ) {
    id
    data
  }
}
```

## 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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/mutations/createcustomer.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
