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.

Input
customer
Result
The new customer object.

Structure details

Input (object)

customer
first_name
The customer's first name.
last_name
The customer's last name.
email
The customer's email address.
phone
The customer's phone number.
verified_email
Whether the customer has verified their email address.
addresses
A list of the customer's addresses.
address1
The first line of the address.
city
The city of the address.
province
The province or state of the address.
phone
The phone number associated with the address.
zip
The postal or zip code of the address.
last_name
The last name of the person associated with the address.
first_name
The first name of the person associated with the address.
country
The country of the address.
password
The customer's password.
password_confirmation
The confirmation of the customer's password.
send_email_welcome
Whether to send a welcome email to the customer.

Example

Result (object)

customer
The new customer object.
id
The customer's ID.
email
The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.
created_at
The date and time (ISO 8601 format) when the customer was created.
updated_at
The date and time (ISO 8601 format) when the customer information was last updated.
first_name
last_name
orders_count
state
total_spent
The total amount of money that the customer has spent across their order history.
last_order_id
note
A note about the customer.
verified_email
Whether the customer has verified their email address.
multipass_identifier
A unique identifier for the customer that's used with Multipass login.
tax_exempt
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.
tags
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.
last_order_name
The name of the customer's last order. This is directly related to the name field on the Order resource.
currency
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.
phone
The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error.
addresses
id
customer_id
first_name
last_name
company
address1
address2
city
province
country
zip
phone
name
province_code
country_code
country_name
default
tax_exemptions
email_marketing_consent
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:
state
opt_in_level
consent_updated_at
sms_marketing_consent
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:
state
opt_in_level
consent_updated_at
consent_collected_from
admin_graphql_api_id
default_address
The default address for the customer.
id
customer_id
first_name
last_name
company
address1
address2
city
province
country
zip
phone
name
province_code
country_code
country_name
default

Example