انتقل إلى المحتوى الرئيسي

Register

A register API is an endpoint that allows users to create an account in a system by submitting their personal details, such as phone, email, and password. This API typically validates the input data, checks if the phone or email already exists in the system, and creates a new user account if all the requirements are met.

  • Endpoint: api/customer/auth/signup

  • Http Method: POST

The API response typically includes a success message or an error message if the registration fails. The register API is commonly used in web applications to allow users to create an account and access restricted features or content.

  • Request Body:

Here is an example request body for registering a new user:

KeyTypeRequiredDescription
namestringYesThe first name of the customer.
last_namestringYesThe last name of the customer.
emailstringYesThe email address of the customer.
phonestringYesThe phone number of the customer.
passwordstringYesThe password of the customer.
birthdatestringYesThe birthdays of the customer.
referedstringNoThe referral information of the customer. This parameter is not required and can be omitted if the customer does not have a referral.
{
"name": "Test",
"last_name": "Documentation",
"email": "doc@supercommerce.io",
"phone": "01111111111",
"password": "12345678",
"birthdate": "2000-02-01",
"refered": ""
}

After successful register, the API will respond with the user's authentication token in the 'data' field.

  • Success Response:
Customer Resource

You can check more details about Customer Resource.

200 OK: If the register API is successful
{
"code": 200,
"data": {
"id": 1153383,
"name": "Test",
"last_name": "Documentation",
"email": "doc2@supercommerce.io",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..",
//...
}
}
معلومات

Check the following section to learn more about the Register API Reference