Skip to main content
POST
This endpoint creates a new customer and can optionally create associated accounts in integrated systems like Stripe.

Request Body

string
required
Customer’s email address. Must be unique and valid format.Example: customer@example.com
string
required
Customer’s first name. Must be 1-50 characters.Example: John
string
required
Customer’s last name. Must be 1-50 characters.Example: Doe
string
Customer’s phone number in E.164 format (recommended) or local format.Examples: +1-555-123-4567, (555) 123-4567
string
Customer’s date of birth in ISO 8601 format (YYYY-MM-DD).Example: 1990-05-15
object
Customer’s primary address information.
Whether the customer has consented to marketing communications.
string
default:"bronze"
Customer tier for loyalty programs. Options: bronze, silver, gold, platinum
string
How the customer found your business.Options: organic, paid_search, social_media, referral, email, direct, other
string
Existing Stripe customer ID if you’re syncing with an external Stripe account.Note: If not provided and Stripe integration is enabled, a new Stripe customer will be created automatically.
string
Internal notes about the customer (not visible to customer).Max length: 1000 characters
array
Array of tags for customer segmentation and organization.Example: ["vip", "wholesale", "early-adopter"]
object
Additional custom fields as key-value pairs. Keys must be alphanumeric with underscores.Example:
object
Customer communication preferences.

Response

string
Unique identifier for the created customerExample: cust_1NXWPnCo6bFb1KQto6C8OWvE
string
Customer’s email address
string
Customer’s first name
string
Customer’s last name
string
Customer’s full name (computed field)
string
Customer’s phone number
string
Customer’s date of birth
object
Customer’s address information
string
Customer’s loyalty tier
Marketing consent status
string
Associated Stripe customer ID (if Stripe integration is enabled)
string
ISO 8601 timestamp when the customer was created
string
ISO 8601 timestamp when the customer was last updated
string
Customer status: active, inactive, suspended
number
Customer’s lifetime value (computed from order history)
integer
Total number of orders placed by this customer
array
Array of customer tags
object
Custom field key-value pairs
object
Customer communication preferences

Additional Features

Idempotency

Use the Idempotency-Key header to safely retry customer creation requests:

Stripe Integration

When Stripe integration is enabled:
  • A Stripe customer is automatically created if stripe_customer_id is not provided
  • Customer data is synced between StateSet and Stripe
  • Payment methods can be attached to the Stripe customer

Webhook Events

Creating a customer triggers these webhook events:
  • customer.created - Fired when customer is successfully created
  • customer.stripe_synced - Fired when Stripe customer is created (if integration enabled)

Validation Rules

Rate Limiting

Customer creation is subject to rate limits:
  • Standard: 100 customers/minute
  • Enterprise: 1000 customers/minute
Consider using batch import for large datasets.