The Create Customer API allows a new customer to be created and their information saved when they place an order. Their basic account and contact information is assigned on this initial creation, and custom data can be added when applicable.
Note that the request body and parameter schemas outlined in this guide are the exact same as in the previous version of OMS, as the Unified Commerce platform supports backwards compatibility for this API. The only change to this request is the format of the base endpoint, as shown in the below table. Remember to provide the x-vol-tenant key for authentication in the headers.
Production URL | https://{tenantId}-translation.mozu.com/api/v2/customer |
Sandbox URL | https://{tenantId}-translation.sandbox.mozu.com/api/v2/customer |
Supported Formats | JSON |
HTTP Method | POST |
Example
In this example, the customer details includes these particular properties:
- Customer named TEST CUSTOMER
- Being set up with the email “test@shopatron.com” and the password “password”
Required Parameters
These parameters are necessary for the Create Customer API to return a successful response:
Parameter | Type | Description |
firstName | string | The first name of the customer. The minimum length is 1 and the maximum length is 300. |
lastName | string | The last name of the customer. The minimum length is 1 and the maximum length is 300. |
string | The email address of the customer. The minimum length is 1 and the maximum length is 250. | |
phone1 | string | The phone number of the customer. The minimum length is 1 and the maximum length is 20. |
password | string | A unique password for the customer. The minimum length is 5 and the maximum length is 48. |
Optional Parameters
This additional information can also be provided during customer creation:
Parameter | Type | Description |
phone2 | string | A secondary phone number for the customer. The maximum length is 20. |
customData | array | A set of custom data for the customer. |
The Full Request
This is the complete request that will create a new customer.
{ "firstName":"TEST", "lastName":"CUSTOMER", "email":"test@shopatron.com", "phone1":"0000000000", "password":"password" }
The Full Response
This is the full response returned by the API, detailing the information about the newly created customer.
{ "customerID": "000000", "firstName": "TEST", "lastName": "CUSTOMER", "email": "test@shopatron.com", "password": "*****", "phone1": "0000000000", "active": "ACTIVE", "accountCreated": "2007-11-20T02:50:15+00:00" }