Salla Docs
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Auth
  • Overview
  • Languages
  • Notify
  • Event
  • Storage
  • Configuration
  • Forms
  • Helpers
  • Auth
    • Login
    • Logout
    • Verify
    • Resend
    • Register
    • Refresh
  • Cart
    • Latest
    • Details
    • Quick Add
    • Add Item
    • Delete Item
    • Delete Image
    • Add Coupon
    • Remove Coupon
    • Get Upload Image
    • Get Quick Order Settings
    • Create Quick Order
    • Order Status
    • Get Current Cart Id
    • Price Quote
  • Wishlist
    • Add
    • Remove
    • Toggle
  • Loyalty
    • Get Program
    • Exchange
    • Reset
  • Comment
    • Add Comment
    • Fetch
    • Get Page Comments
    • Get Product Comments
  • Profile
    • Update profile
    • Update contact
  • Product
    • Get price
    • Product availability
    • Categories
    • Offer details
    • Search products
    • Get Gift Details
    • Add Gift To Cart
    • Upload Gift Image
    • Get Product Details
    • Fetch
    • Fetch Options
    • Size Guides
  • Order
    • Create cart from order
    • Cancel
    • Send invoice
    • Show order
  • Booking
    • Add
  • Rating
    • Order
    • Store
    • Products
    • Shipping
  • Currency
    • Change
    • List
  • Component
    • Reviews
    • Menus
  1. Auth

Register

The customer registration endpoint creates a customer account in the merchant's store. A registration request must provide the customer main information such as first name, email, phone, and more. Additionally, the login verification type should be stored in verfied_by field, so that later the verification code will be sent to that verification type.
TIP
The register endpoint has been implemented in the Login Web Component, and It's all setup to save developer's time and effort.

Payload#

RegisterPayload
first_name
string 
RegisterPayload.first_name
required
Customer first name
last_name
string 
RegisterPayload.last_name
required
Customer last name
phone
string 
RegisterPayload.phone
required
Customer phone number
country_code
string 
RegisterPayload.country_code
required
Customer country code
Default:
SA
country_key
string 
RegisterPayload.country_key
required
Customer country key
Default:
+966
verified_by
enum<string> 
RegisterPayload.verified_by
required
Verfication method to where the access code is sent
Allowed values:
emailphone
Default:
phone
email
string 
RegisterPayload.email
optional
Customer email
code
number 
RegisterPayload.code
required
Customer access code

Response#

Success
Error
auth.register.success
success
boolean 
success
required
Response flag
status
enum<number> 
status
required
Allowed values:
200201202
data
object 
data
optional
Response data.
case
enum<string> 
required
Rather than using a null-test to check if the access token has been set, the case value may be checked. When there is no token returned, its value will be new_customer. This indicates that the user is a new customer and must go through the registration process. On the other hand, its value will be authenticated when a token is returned. This indicates that the user has been authorized and is ready to log in.
Allowed values:
new_customerauthenticated
redirect_url
string 
required
The destination page URL that will be used when the user is granted authorization.
token
string 
required
Users are authenticated using Access Tokens, which are short-lived tokens.
verification
object 
required
The access verification type and status.

Usage#

The register() creates a new customer account. A registration request must provide a user with the following information: first_name, last_name, email, phone, country_code, and country_key. Additionally, the login verification type should be stored in verfied_by, so that later the verification code will be sent to that verification type.

Events#

This endpoint may trigger two events, the onRegistered and onCodeNotReSent events.

onRegistered#

This event is triggered when the customer registration process is done without having any errors coming back from the backend.

onRegistrationFailed#

This event will be triggered when the register process is not completed, and an error has occurred.
Modified at 2025-03-04 12:54:02
Previous
Resend
Next
Refresh