createCustomer
Method to create a customer
This method sends a POST request to the createCustomer endpoint of the Vue Storefront API Middleware. In turn, it receives data from the createCustomer endpoint exposed by the BigCommerce API
Signature
declare function createCustomer$1(
props: CreateCustomerParameters,
options?: MethodOptions
): Promise<User>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | CreateCustomerParameters | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
options | Optional | MethodOptions |
Returns
Returns a response with the User object.
Referenced Types
Examples
Registering a new customer account.
import { sdk } from '~/sdk.config.ts';
const createCustomerResponse = await sdk.bigcommerce.createCustomer({
{
"email": "email@account.com",
"first_name": "test",
"last_name": "test",
"password": "y0u1pa55w$rd",
"accepts_product_review_abandoned_cart_emails": true,
"custom_fields": []
}
});