Skip to main content

Create Customer Action

The Create Customer action creates a new customer in your CaptainBook system. Use this to automatically create customer records from external systems, webhooks, or other workflow triggers.

Jerome Bajou avatar
Written by Jerome Bajou
Updated over a week ago

Overview

The Create Customer action creates a new customer in your CaptainBook system. Use this to automatically create customer records from external systems, webhooks, or other workflow triggers.


Configuration

Name (Required)

The customer's name. Must be at least 3 characters. Supports variables.

Optional Fields

Contact Information

  • email - Primary email address (validated)

  • secondary_email - Secondary email address (validated)

  • phone - Phone number (validated)

  • country - Country code (CCA2 or CCA3 format)

Address

  • address - Street address

  • city - City

  • region - State/region

  • zip_code - Postal code

Preferences

  • locales - Preferred languages (array or comma-separated string)

Custom Attributes

  • extra_attributes - Array of key-value pairs for custom customer attributes


Output

Returns the created customer object in the workflow context with all customer details:

  • Contact information (name, email, phone)

  • Address information

  • Preferences and locales

  • Custom attributes

Accessing Customer Data

After this action, you can access:

{customer.id} 
{customer.name}
{customer.email}
{customer.phone}
{customer.country}

Examples

1. Basic Customer Creation

Name: John Doe 
Email: [email protected]
Phone: +1234567890

2. Customer with Address

Name: Jane Smith 
Email: [email protected]
Address: 123 Main St
City: New York
Region: NY
Zip Code: 10001
Country: US

3. Customer with Preferences

Name: Maria Garcia 
Email: [email protected]
Locales: en,es

4. Customer with Custom Attributes

Name: Test Customer 
Email: [email protected]
Extra Attributes:
- key: source
value: webhook
- key: campaign
value: summer2024

Validation

The action validates:

  • Name must be at least 3 characters

  • Email format (RFC and DNS validation)

  • Phone number format (international)

  • Country code (must be valid CCA2 or CCA3)


Best Practices

  1. Validate input - Ensure required fields are present

  2. Check duplicates - Consider checking for existing customers before creating

  3. Handle errors - Set up error notifications for validation failures

  4. Use variables - Leverage workflow context variables for dynamic data

  5. Set origin - Customer is automatically marked as created by the workflow


Related Documentation

Did this answer your question?