Salesforce Commerce My Profile API
The Salesforce Commerce My Profile API allows you to retrieve and update buyer account details. This API works by identifying the buyer's user ID within the logged-in context to either fetch or modify their account information.
The My Profile API supports both GET and PATCH requests. Use the GET request to view buyer profile details, such as phone number, email address, first name, last name, or username.
To update profile information, such as phone number, email address, first name, or last name, make a PATCH request. When you update your email address, a verification process starts. The API sends a confirmation email to your old address. Until you verify the new email, the Profile page GET API still shows the old one. Once confirmed, the GET API displays the updated email.
Let's explore a basic scenario for utilizing the My Profile API's supported methods.
First, let’s consider a scenario where a buyer wants to view their profile details, including phone number, email address, first name, last name, or user name. In this case, a GET request to the Commerce Webstore My Profile API can be used to retrieve these details.
Second, if the buyer decides to update their profile information—such as phone number, email address, first name, and last name—a PATCH request to the Commerce Webstore My Profile API can be used.
Here’s a list of Commerce My Profile resources:
Resource | Supported HTTP Methods | Description |
---|---|---|
/commerce/webstores/{webstoreId}/myprofile | GET, PATCH | Retrieve or update the buyer’s account details. This API works by identifying the buyer's user ID within the logged-in context to either fetch or modify their account information. |