XM

Create Local User

Path:

POST https://{baseurl}/api-commerceIdentity/user/local

Signup, being the starting point in a user's shopping experience, is considered a major tipping point in e-commerce. We offer a light-weight onboarding experience and collects only minimal information from your shoppers such as email (which serves as the username), full name, and password. In response, the user details are retrieved along with the system generated user ID (represented as _Id), which is required for subsequent calls (specially customer-context calls).

From the store perspective, you will benefit from the key customer details. This will help you in your personalisation efforts to provide a unified shopping experience.

Headers

Content-Type : application/json

x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Parameters

Type : requestBody

Name : The email, name, and password.

Required: true

Sample Request

{
"user": {
"name": {
"first": "John",
"middle": "A",
"last": "Smith"
},
"phone": [{
"number": "123456789",
"countryCode": "+1",
"extension": "1234",
"kind": "mobile"
}],
"email": "[email protected]",
"extra": {
"dob": "03-19-1993"
}
},
"provider": {
"username": "[email protected]",
"password": "ExamplePassword123!"
}
}

Sample Response

HTTP Code: 200 Message: OK

Description: You will see this message when the user is successfully onboarded. In response, the user details are retrieved along with JWT tokens (access and refresh).

{
"_id": "5e97947d3cb8553c0e43d87f",
"userId": 90,
"roles": [
{
"id": "5de1646f8c6352091d944f1c"
}
],
"name": {
"first": "John",
"middle": "A",
"last": "Smith"
},
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlOTc5NDdkM2NiODU1M2MwZTQzZDg3ZiIsInJvbGVzIjpbeyJpZCI6IjVkZTE2NDZmOGM2MzUyMDkxZDk0NGYxYyJ9XSwiaWF0IjoxNTg2OTkyMjUzLCJleHAiOjE1ODY5OTQwNTN9.RQpIQQF6ccw03Pe1O5FtT8L-5qSGmJ-GZqfqpsmt0XA6ttEg7xDIVRsFH4hePlSIlJ_1ybIJgZgMH-D1NEzfwA",
"refreshToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlOTc5NDdkM2NiODU1M2MwZTQzZDg3ZiIsImlhdCI6MTU4Njk5MjI1MywiZXhwIjoxNTkwODgwMjUzfQ.TbYzrtTT3hq1SMewFy1YPGeC-GqBv1J2zFPXSHFL28doNq1WnyPSNg1A8z_jFvLCQEtIaUKSNfqqlagykC9sPw"
}

HTTP Code: 406 Message: Not Acceptable

Description: You will see this message when the email address provided already exists.

Sample:

{
"code": "USER_EXISTS",
"message": "User with given email/username already exists."
}

Changelog

*Last updated - July 2020