You are viewing a section of Superface that will be deprecated in Q4 2023. Until then, you can continue to use it as you have before but we recommend that you migrate to our latest version soon. For more details visit superface.ai/docs/migrate.
customer-management/create-customer
customer-management/create-customer@0.0.0
Creates a new customer with the provided information.
CreateCustomer
Input
customer
Result
The new customer object.
Structure details
Input (object)
customer
required
object
first_name
required
The customer's first name.
string
last_name
required
The customer's last name.
string
email
required
The customer's email address.
string
phone
required
The customer's phone number.
string
verified_email
required
Whether the customer has verified their email address.
boolean
addresses
required
A list of the customer's addresses.
list
address1
required
The first line of the address.
string
city
required
The city of the address.
string
province
required
The province or state of the address.
string
phone
required
The phone number associated with the address.
string
zip
required
The postal or zip code of the address.
string
last_name
required
The last name of the person associated with the address.
string
first_name
required
The first name of the person associated with the address.
string
country
required
The country of the address.
string
password
required
The customer's password.
string
password_confirmation
required
The confirmation of the customer's password.
string
send_email_welcome
required
Whether to send a welcome email to the customer.
boolean
Example
Copied!
Result (object)
customer
optional
The new customer object.
object
id
required
The customer's ID.
number
email
required
The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.
string
created_at
required
The date and time (ISO 8601 format) when the customer was created.
string
updated_at
required
The date and time (ISO 8601 format) when the customer information was last updated.
string
first_name
required
string
last_name
required
string
orders_count
required
number
state
required
string
total_spent
required
The total amount of money that the customer has spent across their order history.
string
last_order_id
required
number
note
optional
A note about the customer.
string
verified_email
required
Whether the customer has verified their email address.
boolean
multipass_identifier
optional
A unique identifier for the customer that's used with Multipass login.
string
tax_exempt
required
Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout.
boolean
tags
required
Tags that the shop owner has attached to the customer, formatted as a string of comma-separated values. A customer can have up to 250 tags. Each tag can have up to 255 characters.
string
last_order_name
required
The name of the customer's last order. This is directly related to the name field on the Order resource.
string
currency
required
The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order. Defaults to the shop currency. Returns the shop currency for test orders.
string
phone
required
The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error.
string
addresses
required
list
id
required
number
customer_id
required
number
first_name
optional
string
last_name
optional
string
company
optional
string
address1
required
string
address2
optional
string
city
required
string
province
required
string
country
required
string
zip
required
string
phone
required
string
name
required
string
province_code
required
string
country_code
required
string
country_name
required
string
default
required
boolean
tax_exemptions
optional
list
email_marketing_consent
required
The marketing consent information when the customer consented to receiving marketing material by email. The email property is required to create a customer with email consent information and to update a customer for email consent that doesn't have an email recorded. The customer must have a unique email address associated to the record. The email marketing consent has the following properties:
object
state
required
string
opt_in_level
optional
string
consent_updated_at
required
string
sms_marketing_consent
required
The marketing consent information when the customer consented to receiving marketing material by SMS. The phone property is required to create a customer with SMS consent information and to perform an SMS update on a customer that doesn't have a phone number recorded. The customer must have a unique phone number associated to the record. The SMS marketing consent has the following properties: