XPM

Create Local User

Path:

POST /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 collect only minimal information from users 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, which is required for subsequent calls.

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

Headers

Content-Type : application/json

x-site-context : {"site":"abcde.com"}

Consumes

  • application/json

Produces

  • application/json

Parameters

Type: body

Name: 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": "johnsmith@fabric.inc",
"extra": {
"dob": "03-19-1993"
}
},
"provider": {
"username": "johnsmith@fabric.inc",
"password": "ExamplePassword123!"
}
}

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).

Sample:

{
"_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