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. Profile
  • 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. Profile

Update contact

This endpoint is used to update a customer's contact information. The profile contains information such as the customer's phone, country_code, and email.

Payload authenticated#

UpdateContactPayload
phone
string 
optional
Customer mobile.
country_code
string 
optional
Customer code of country.
Default:
SA
email
string 
optional
Customer email.

Response#

Success
Error
profile.updateContact.success
success
boolean 
success
required
Response flag
status
enum<number> 
status
required
Allowed values:
200201202
data
object 
data
optional
Response data.
first_name
string 
first_name
required
Customer first name
last_name
string 
last_name
required
Customer last name
phone
object 
phone
required
Customer phone number
email
string 
email
required
Customer email
avatar
string 
avatar
required
Customer avatar
gender
gender
optional
Customer gender
birthday
string 
birthday
required
Customer date of birth
verification
object 
optional
The verification details

Usage#

To update the contact informtion for the customer, the developer may call the methos updateContact() along with the customer's new information as below.

Verification#

An additional endpoint is required to be used here for handling the verification process. This is to ensure the user's confirmation of the changes. It functions similarly to the login verification endpoint. 
The verification status will change if the profile's phone, country code, or email are modified. It takes the values pending and success as inputs. The pending state implies that the user must confirm the modifications by an OTP code issued to his phone or email. The success status indicates that the profile update was completed successfully and that the user does not need to take any additional action.
This endpoint sends the entered access code to the backend and waits for a response. If an affirmative response is received, the profile is updated. If the verification process doesn't work, the customer is told to send the right access code again.
💡 Tip:
The profile verify endpoint has been implemented in the Verify Web Component, , and It's all setup to save developer's time and effort.
An additional endpoint is required to be used here for handling the verification process. This is to ensure the user's confirmation of the changes. It functions similarly to the login verification endpoint. 
This endpoint sends the entered access code to the backend and waits for a response. If an affirmative response is received, the profile is updated. If the verification process doesn't work, the customer is told to send the right access code again.
The salla.profile.verify() passes the customer access code to the backend in order to proceed with the verification process. In the case of using the phone number method to receive the access code, this method will pass the received access code along with the customer's phone number and the country code.

With web componenet#

in case the user change the phone/email a OTP required to complete the changes, you can take advancige of salla-verify-modal to hanlde the OTP verifation
💡 Tip:
The profile verify endpoint has been implemented in the Verify Web Component, , and It's all setup to save developer's time and effort.

Without web componenet#

Events#

This endpoint may trigger two events, which are the onVerificationCodeSentand onUpdateContactsFailed events.

onVerificationCodeSent#

This event may happen will be triggered when the verification process fails and the backend sends error codes. In other words, the received response status is not 200.

onUpdateContactsFailed#

This event is triggered when updating the contact information for the customer is not completed and an error has occurred.
Modified at 2025-03-04 12:54:02
Previous
Update profile
Next
Product