My Account

As the name suggests, My account section is a core section of any ecommerce storefront. On this page, we shall dive into the different supported functions for the user within My Account.

Profile Properties

The user's profile is maintained within the platform along with their address book, wishlist, order history, security details.

Properties

  • Name
    username
    Type
    string
    Description

    Unique identifier for the contact.

  • Name
    firstName
    Type
    string
    Description

    The username for the contact.

  • Name
    lastName
    Type
    string
    Description

    The phone number for the contact.

  • Name
    email
    Type
    string
    Description

    The avatar image URL for the contact.

  • Name
    title
    Type
    string
    Description

    The contact display name in the contact list. By default, this is just the username.

  • Name
    telephone
    Type
    string
    Description

    Unique identifier for the conversation associated with the contact.

  • Name
    mobile
    Type
    timestamp
    Description

    Timestamp of when the contact was last active on the platform.

  • Name
    gender
    Type
    timestamp
    Description

    Timestamp of when the contact was created.

  • Name
    password
    Type
    string
    Description

    Unique identifier for the contact.

  • Name
    nickName
    Type
    string
    Description

    The username for the contact.

  • Name
    birthDate
    Type
    string
    Description

    The phone number for the contact.

  • Name
    newsLetterSubscribed
    Type
    string
    Description

    The avatar image URL for the contact.

  • Name
    userSourceType
    Type
    string
    Description

    The contact display name in the contact list. By default, this is just the username.

  • Name
    referralType
    Type
    string
    Description

    Unique identifier for the conversation associated with the contact.

  • Name
    userReferrer
    Type
    timestamp
    Description

    Timestamp of when the contact was last active on the platform.

  • Name
    companyName
    Type
    timestamp
    Description

    Timestamp of when the contact was created.

  • Name
    notifyByEmail
    Type
    timestamp
    Description

    Timestamp of when the contact was created.

  • Name
    notifyBySMS
    Type
    timestamp
    Description

    Timestamp of when the contact was created.

  • Name
    notifyByPost
    Type
    timestamp
    Description

    Timestamp of when the contact was created.

  • Name
    notifyByWhatsapp
    Type
    timestamp
    Description

    Timestamp of when the contact was created.

  • Name
    registrationSource
    Type
    timestamp
    Description

    Timestamp of when the contact was created.

Register

As the name suggests, this functionality allows the user to register on the website using their mobile or email as the unique username.

Developers - API Operations

OperationEndpointResponse
Register/api/v2/commerce/customer/createConfirmation of the user's registration or relevant error message.

Update Profile

Registered users can view and update their basic profile on the storefront.

The following API operation is called for profile update:

OperationEndpointResponse
Update Profile/api/v2/commerce/customer/{id}/updateIt updates the customer information like first name, last name, mobile number. {id} is the user's id for which profile update is executed.

Authentication

The registered user can login to the website using their email or their mobile number. If the OTP (one time password) capability is enabled, then a password is generated and sent across to the user for login to the website. Once they login, the following data is loaded for them:

  1. Profile
  2. Wishlist
  3. Order History
  4. Current Basket

Developers - API Operations

OperationEndpointResponse
Authenticate User/api/v2/commerce/customer/authenticateReturns the user information along with the newsletter, notification preferences.

Forgot Password

The registered user can retrieve password by using forgot password option, if exists then a unique link is sent to the user using which the following workflow is triggered before the user can change teh password.

  1. Email sent with token to the user
  2. Token Validation is done to ensure that the token is not already used or expired
  3. Set the password

Developers - API Operations

OperationEndpointResponse
Forgot Password request/api/v2/commerce/customer/password/forgot?email=<<user_email>>Forgot password token.
Validate Token/api/v2/commerce/customer/validate-token?token=<<token>>Validate the token before allowing them to change the password.
Reset Password/api/v2/commerce/customer/password/resetUpdate the password.

Change Password

Registered users can update their password on the storefront.

The following API operation is called to change passwords:

OperationEndpointResponse
Change Password/api/v2/commerce/customer/password/changeChange the password for the existing customer. Parameters passed are user id, old password, new password.

Wishlist

The storefront users can add or remove items from their wishlist.

Add Item(s) to Wishlist

The following API operation is called to add items(s) to wishlist:

OperationEndpointResponse
Add to Wishlist/api/v2/commerce/customer/:id/wishlist/:productId/add/:saveForLaterAdd an item to the wish list. There is a system default wish list called ‘saveForLater’. If you want to add the item to that list, you just need to pass the flag as true. :id is the user's id for which the add to wishlist is executed, :productid is the unique identifier of the product being added to the wishlist, :saveForLater is a boolean flag signifying that the product should be added to system wish list ‘save for later’.

Remove from Wishlist

The following API operation is called to remove an item from wishlist:

OperationEndpointResponse
Remove from Wishlist/api/v2/commerce/customer/:id/wishlist/:productId/remove/:saveForLaterRemoves an item from the user’s wish list. :id is the user's id, :productid is the unique identifier of the product being removed from the wishlist, :saveForLater is a boolean flag signifying that the product should be removed from the ‘save for later’ wishlist.

Retrieve User's Wishlist

The following API operation is called for retrieving the user's wishlist:

OperationEndpointResponse
Get User Wishlist/api/v2/commerce/customer/:id/wishlist?saveForLater=trueGet the list of the products in wishlist. :id is the user's id, saveForLater = true denotes that items from the ‘save for later’ wishlist should be retrieved.

Address Book

Users on the storefront can create and manage their addresses.

Add Address

The following API operation is called for adding an address:

OperationEndpointResponse
Add Address/api/v2/commerce/address/createCreates the address for the user. It input contains customer id, first name, last name, address line fields, city, state, country, postal code, mobile number, phone number, label, isDefaultDelivery denotes the address to be set up as shipping address, isDefaultBilling denotes the address to be set up as billing address.

Update Address

The following API operation is called for updating an address:

OperationEndpointResponse
Update Address/api/v2/commerce/address/{id}/updateUpdate user's address.

Parameters passed as input are:

  • AddressId: Id of address which you want to update
  • firstName: first name of the user
  • lastName: last name of the user
  • Address1: Address line1
  • City: city detail
  • PostCode
  • Country
  • CountryCode
  • UserId
  • PhoneNo

Fetch All Addresses

The following API operation is called for adding an address:

OperationEndpointResponse
Get User Addresses/api/v2/commerce/address/{customerId} where customerId is the user's idGet complete customer address book.

Delete Address

The following API operation is called for deleting user's address identified by address id:

OperationEndpointResponse
Delete Address/api/v2/commerce/address/{customerId}/{id}/delete, where {customerId} is the user's id and {id} is the address id that need to be deletedDelete address of the user identified by address id.

Set Default Address

The following API operation is called to set the user's default address:

OperationEndpointResponse
Set Default Address/api/v2/commerce/address/{customerId}/{id}/setdefault where {customerId} is the user's id for whom the address is to be updated, {id} is the address id, type: 1 for standard orders, 2 for subscription orders, isDefaultBilling denotes the address to be set up as billing address, isDefaultDelivery denotes the address to be set up as shipping addressUser can set up different addresses as defaults for billing and shipping.

Remove Default Address

The following API operation is called to remove the user's default address:

OperationEndpointResponse
Remove Default Address/api/v2/commerce/address/{customerId}/removedefault where {customerId} is the user's id for whom the address is to be updatedRemove the default address for the user.

Order History

The users on storefront can view the list of placed orders with details like delivery address, order date, order total, estimated time of delivery, order item details.

Order List

The following API operation is called to fetch the user's order list:

OperationEndpointResponse
Get order list/api/v2/commerce/customer/{id}/orders where {id} is the user's id for which orders are fetchedGives the list of orders for the user.

Parameters passed as input are:

  • HasMembership: flag passed as false
  • Pagesize: 20
  • PageNumber: 1

Order Details

The following API operation is called to fetch the user's order list:

OperationEndpointResponse
Get Order Details/api/v2/commerce/customer/{id}/orders/{orderId} where {id} is the user's id for which order detail is fetched, {orderId} id of the orderGives you the order details of specific order for the user.

Returns and Cancellation

The registered user on store can initiate a request for return or cancellation of an order at any point of time.

The primary differences between return and cancel are as follows:

  • Cancellation of order is valid until the user has recevied it.
  • Return of order or order item(s) is valid once the order has been dispatched and recevied by the user.

Return / Cancel Workflow

  • The user can go to my account section to view all the orders and, depending upon the current status of the order, the user sees the option to cancel or return.
  • Once the user clicks on ‘cancel’ or ‘return’, a form is displayed which also allows the user to select options for each line item:
    • ‘reason for return / cancel’ – faulty, wrong size, etc. These options can be set specifically for every business.
    • ‘required action’ – replacement item or refund. These options are configurable at a domain level for each business.
  • The user is required to fill in the return form and submit it. An RMA no. is generated by the system and the return confirmation screen is displayed to the user.

The following are the API operations called during Cancel/Return process:

OperationEndpointResponse
List of all cancel reasons/api/v2/content/masterdata/2050List of cancel reasons with details like display text, display value.
List of all return reasons/api/v2/content/masterdata/29List of return reasons with details like display text, display value.
List of Returns for a user/api/v2/commerce/customer/:id/returns where :id is the user idList of returns for a specific user.
Details of a Return/api/v2/commerce/customer/:id/returns/:returnId where :id is the user id, :returnId is the RMA id for which the return details are fetchedReturn detail along with its status.
Get Order details for creating a new Return/api/v2/commerce/return/:orderIdOrder details along with the master list of ‘ReturnReason’ and ‘RequiredAction’.
Create new Return/api/v2/commerce/return/createReturns (RMA) no. & Id if successfully created.
Update Return/api/v2/commerce/return/:id/updateReturns true or false depending upon successful update.