Profiles
Entry Point: /profiles/{scope}/default
The profiles resource provides access to the currently logged in customer and their details. Using the resource you can retrieve and update a customer’s first name, last name, username, addresses. You can also retrieve the customer’s purchases and paymentmethods through this resource.
Read Default Profile
Retrieve the customer’s default profile. Retrieves the customer’s first name, last name, username, addresses, and link to the customer’s payment methods.
Workflow
- Start with root
GETthe link with rel: defaultprofile- Render the response
Response
Type: profiles.profile
| Name | Description | Type |
|---|---|---|
given-name | The customer’s first name. | string |
family-name | The customer’s last name. | string |
company | The customer’s company name. | string |
business-number | The customer’s company business number. | string |
tax-exemption-id | The customer’s tax exemption ID. | string |
date-of-birth | The customer’s date of birth. | date |
phone | The customer’s phone number. | string |
fax | The customer’s fax number. | string |
preferred-currency | The customer’s preferred currency. | string |
preferred-locale | The customer’s preferred locale. | string |
html-email | Indicates whether the customer prefers emails in HTML format. | boolean |
notification | Indicates whether the customer opts-in to marketing emails. | boolean |
Sample
{
"self": {
"type": "profiles.profile",
"uri": "/profiles/mobee/mntggztemq4gmljqmjrweljugrrgcljymy3ggljvgvtdqzjygq3demrsmm=",
"href": "https://cortex.elasticpath.com/cortex/profiles/mobee/mntggztemq4gmljqmjrweljugrrgcljymy3ggljvgvtdqzjygq3demrsmm="
},
"messages": [],
"links": [
{
"rel": "addresses",
"type": "addresses.addresses",
"href": "https://cortex.elasticpath.com/cortex/addresses/mobee"
},
{
"rel": "data-policies",
"type": "datapolicies.data-policies",
"href": "https://cortex.elasticpath.com/cortex/datapolicies/mobee"
},
{
"rel": "emails",
"type": "emails.emails",
"href": "https://cortex.elasticpath.com/cortex/emails/mobee"
},
{
"rel": "attributes",
"type": "profiles.attributes",
"href": "https://cortex.elasticpath.com/cortex/profiles/mobee/mntggztemq4gmljqmjrweljugrrgcljymy3ggljvgvtdqzjygq3demrsmm=/attributes"
},
{
"rel": "purchases",
"type": "purchases.purchases",
"href": "https://cortex.elasticpath.com/cortex/purchases/mobee"
},
{
"rel": "wishlists",
"type": "wishlists.wishlists",
"href": "https://cortex.elasticpath.com/cortex/wishlists/mobee"
}
],
"business-number": null,
"company": null,
"date-of-birth": null,
"family-name": null,
"fax": null,
"given-name": null,
"html-email": null,
"notification": null,
"phone": null,
"preferred-currency": null,
"preferred-locale": null,
"tax-exemption-id": null
}
Update Profile
Update attributes on the profile.
Workflow
- Start with profile
- Edit the profile object with new details
- Update profile using a
PUTrequest
Read Attributes From Profile
Retrieves a list of read-only attributes for the logged in customer.
Workflow
- Start with profile
GETthe link with rel: attributes- Render the response
Response
Sample
{
"self": {
"type": "profiles.attributes",
"uri": "/profiles/mobee/mntggztemq4gmljqmjrweljugrrgcljymy3ggljvgvtdqzjygq3demrsmm=/attributes",
"href": "https://cortex.elasticpath.com/cortex/profiles/mobee/mntggztemq4gmljqmjrweljugrrgcljymy3ggljvgvtdqzjygq3demrsmm=/attributes"
},
"messages": [],
"links": [],
"TEST_ATTRIBUTE": "read only attribute"
}
Read Addresses From Profile
Retrieves a list of addresses for the shopper.
Workflow
Read Payment Methods From Profile
Retrieves a list of payment methods for the signed-in shopper.
Workflow
- Start with profile
GETthe link with rel: paymentmethods- Refer to paymentmethods
Read Payment Instruments From Profile
Retrieves a list of payment instruments for the signed-in shopper.
Workflow
- Start with profile
GETthe link with rel: paymentinstruments- Refer to paymentinstruments
Read Purchases From Profile
Retrieves a list of purchases for the logged in customer.
Workflow
Read Accounts From Profile
Retrieves a list of accounts that the logged in customer is associated to.
Workflow
Transition Public User to Registered User
Merges shopping cart details from a single-session user to the currently logged-in registered user. This functionality is only enabled if using Trusted Header Authentication.
Workflow
- Start with profile
GETthe link with rel: mergefrompublicform- Fill out the form
POSTthe form using the link with rel: mergeaction
Request Fields
Type: mergeprofiles.merge-form
| Name | Description | Type |
|---|---|---|
public-user-id | The public profile user id. | String |
- The way that
public-user-idis interpreted depends on the value of theCOMMERCE/SYSTEM/CUSTOMER/identifiersetting, as described in Trusted Header Authentication. - A response of 400 Bad Request will be returned if a required field is not present or the value is empty.
- A response of 404 Not Found will be returned if there is no public customer with the passed user id.