create_customer
Create a new customer record by providing a unique email or phone. Optionally add addresses, tags, and email marketing consent. Returns the customer ID for use in orders.
Instructions
Create a new customer record. At minimum, supply email or phone (one is required for the customer to be reachable; both is fine). Email and phone must each be unique across the store — duplicates trigger validation errors. Optionally seed addresses (the first becomes the default shipping address), apply tags for segmentation, and set email-marketing consent. Default consent is NOT_SUBSCRIBED — only set SUBSCRIBED when you have documented opt-in (legal requirement in many jurisdictions). Returns the new customer's GID for use as customerId in create_order, create_draft_order, etc.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | Customer email. At minimum email or phone is required for the customer to be useful. Must be unique across the store. | ||
| firstName | No | ||
| lastName | No | ||
| phone | No | Phone in E.164 format (+15551234567). Must be unique across the store. | |
| tags | No | Tags to apply to the new customer for segmentation/automation. Used by smart collections, marketing automations, and Flow triggers. | |
| note | No | Internal staff-only note about the customer. | |
| addresses | No | Initial address(es). The first becomes the default shipping address; the rest are additional saved addresses. Customers can be created without addresses. | |
| emailMarketingConsent | No | Email marketing consent state. Set marketingState=SUBSCRIBED only with documented customer opt-in. NOT_SUBSCRIBED is the default and the safe choice when in doubt. |