Skip to main content
Version: 8.6.x

accounts

Entry Point: /accounts/{scope}

The accounts resource provides access to the details of an organizational account. Using the resource you can retrieve account attribute values. You can also retrieve the accounts’s purchases through this resource.

Read Account List​

Retrieve a list of accounts that the signed in user is associated to.

Workflow​

  1. Start with root
  2. GET the link with rel: defaultprofile
  3. GET the link with rel: accounts
  4. Render the response

Read Account​

Retrieve read and write attributes on an account.

Workflow​

  1. Start with root
  2. GET the link with rel: defaultprofile
  3. GET the link with rel: accounts
  4. GET the link with rel: element
  5. Render the response

Response​

Type: accounts.account​

NameDescriptionType
account-business-nameThe account’s business name.string
account-business-numberThe account’s business number.string
account-faxThe account’s fax number.string
account-phoneThe account’s phone number.string
account-tax-exemption-idThe account’s tax exemption ID.string

Sample​

{
"self": {
"type": "accounts.account",
"uri": "/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy="
},
"messages": [],
"links": [
{
"rel": "attributes",
"type": "accounts.account-attributes",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/attributes"
},
{
"rel": "status",
"type": "accounts.account-status",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/status"
},
{
"rel": "associates",
"type": "accounts.associates",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates"
},
{
"rel": "childaccounts",
"type": "accounts.child-accounts",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/childaccounts"
},
{
"rel": "identifier",
"type": "accounts.shared-account-id",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/identifier"
},
{
"rel": "addresses",
"type": "addresses.account-addresses",
"href": "https://cortex.elasticpath.com/cortex/addresses/mobee/accounts/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy="
},
{
"rel": "paymentinstruments",
"type": "paymentinstruments.account-payment-instruments",
"href": "https://cortex.elasticpath.com/cortex/paymentinstruments/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy="
},
{
"rel": "paymentmethods",
"type": "paymentmethods.account-payment-methods",
"href": "https://cortex.elasticpath.com/cortex/paymentmethods/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy="
},
{
"rel": "purchases",
"type": "purchases.account-purchases",
"href": "https://cortex.elasticpath.com/cortex/purchases/mobee/accounts/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy="
}
],
"account-business-name": "Some Business Account",
"account-business-number": null,
"account-fax": null,
"account-phone": null,
"account-tax-exemption-id": null
}

Update Account​

Update attributes on the account.

Workflow​

  1. Start with account
  2. Edit the account object with new details
  3. Update account using a PUT request

Read Identifier on Account​

Retrieve the shared ID of the account.

Workflow​

  1. Start with account
  2. GET the link with rel: identifier
  3. Render the response

Response​

Type: accounts.shared-account-id​

NameDescriptionType
shared-account-idThe account’s shared identifier.string

Sample​

{
"self": {
"type": "accounts.shared-account-id",
"uri": "/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/identifier",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/identifier"
},
"messages": [],
"links": [
{
"rel": "account",
"type": "accounts.account",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy="
}
],
"shared-id": "accounttest1@elasticpath.com"
}

Read Status on Account​

Retrieve the status of the account. Possible status values are ACTIVE, DISABLED, and SUSPENDED.

Workflow​

  1. Start with root
  2. GET the link with rel: defaultprofile
  3. GET the link with rel: accounts
  4. GET the link with rel: status
  5. Render the response

Response​

Type: accounts.account-status​

NameDescriptionType
statusAccount statusstring

Sample​

{
"self": {
"type": "accounts.account-status",
"uri": "/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/status",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/status"
},
"messages": [],
"links": [
{
"rel": "account",
"type": "accounts.account",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy="
}
],
"status": "ACTIVE"
}

Read Attributes from Account​

Retrieve a list of read-only attributes for the account.

Workflow​

  1. Start with account
  2. GET the link with rel: attributes
  3. Render the response

Response​

Sample​

{
"self": {
"type": "accounts.account-attributes",
"uri": "/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/attributes",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/attributes"
},
"messages": [],
"links": [
{
"rel": "account",
"type": "accounts.account",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy="
}
],
"TEST_ATTRIBUTE": "read only attribute"
}

Read Associates from Account​

Retrieve a list of buyers associated to the account.

Workflow​

  1. Start with account
  2. GET the link with rel: associates
  3. Render the response

Read Associate from Account​

Retrieve an associate record for an account.

Workflow​

  1. Start with account
  2. GET the link with rel: associates
  3. GET the link with rel: element
  4. Render the response

Response​

Type: accounts.associate​

NameDescriptionType
roleThe Elastic Path role assigned to the buyer for this account.string

Sample​

{
"self": {
"type": "accounts.associate",
"uri": "/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates/ovzwk4tumvzxiz3vnfsa=",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates/ovzwk4tumvzxiz3vnfsa="
},
"messages": [],
"links": [
{
"rel": "associatedetails",
"type": "accounts.associatedetails",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates/ovzwk4tumvzxiz3vnfsa=/details"
},
{
"rel": "associates",
"type": "accounts.associates",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates"
}
],
"role": "BUYER_ADMIN"
}

Read Logged in Associate from Account​

Retrieve the associate record for an account corresponding to the logged in user.

Workflow​

  1. Start with account
  2. GET the link with rel: associates
  3. GET the link with rel: myself
  4. Render the response

Response​

Type: accounts.associate​

NameDescriptionType
roleThe Elastic Path role assigned to the buyer for this account.string

Sample​

{
"self": {
"type": "accounts.associate",
"uri": "/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates/ovzwk4tumvzxiz3vnfsa=",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates/ovzwk4tumvzxiz3vnfsa="
},
"messages": [],
"links": [
{
"rel": "associatedetails",
"type": "accounts.associatedetails",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates/ovzwk4tumvzxiz3vnfsa=/details"
},
{
"rel": "associates",
"type": "accounts.associates",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates"
}
],
"role": "BUYER_ADMIN"
}

Read Associate Details from Account​

Retrieve the name and email address for the associated buyer.

Workflow​

  1. Start with account
  2. GET the link with rel: associates
  3. GET the link with rel: element
  4. GET the link with rel: associatedetails
  5. Render the response

Response​

Type: accounts.associate​

NameDescriptionType
emailThe buyer’s email address.string
first-nameThe buyer’s first name.string
last-nameThe buyer’s last name.string

Sample​

{
"self": {
"type": "accounts.associatedetails",
"uri": "/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates/ovzwk4tumvzxiz3vnfsa=/details",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates/ovzwk4tumvzxiz3vnfsa=/details"
},
"messages": [],
"links": [
{
"rel": "associate",
"type": "accounts.associate",
"href": "https://cortex.elasticpath.com/cortex/accounts/mobee/guydembtgy4tollcmyzdmljugbrwkljzmy2tgllfmqytsmztg43dgolfmy=/associates/ovzwk4tumvzxiz3vnfsa="
}
],
"email": "usertest@elasticpath.com",
"first-name": "test",
"last-name": "user"
}

Add Association to Account​

Associate a registered shopper to the account.

Workflow​

  1. Start with account
  2. GET the link with rel: associates
  3. GET the link with rel: addassociateform
  4. Fill out the form
  5. POST the form using the link with rel: addassociateaction

Request Fields​

Type: accounts.add-associate-form​

NameDescriptionType
emailThe shopper’s email address.string
roleThe role that the shopper should have for the account.string

Update Association on Account​

Update the role on the buyer’s account association.

Workflow​

  1. Start with account
  2. GET the link with rel: associates
  3. GET the link with rel: element
  4. Edit the associate object with new details
  5. Update associate using a PUT request

Delete Association from Account​

Delete the buyer’s account association. This does not delete the buyer’s profile, it just removes their association to the account.

Workflow​

  1. Start with account
  2. GET the link with rel: associates
  3. GET the link with rel: element
  4. DELETE associate

Read Child Accounts from Account​

Retrieve a list of child accounts for the current account.

Workflow​

  1. Start with account
  2. GET the link with rel: childaccounts
  3. Render the response

Read Child Account from Account​

Retrieve a child account.

Workflow​

  1. Start with account
  2. GET the link with rel: childaccounts
  3. GET the link with rel: element
  4. Refer to account

Read Addresses from Account​

Retrieve a list of addresses for the shopper.

Workflow​

  1. Start with account
  2. GET the link with rel: addresses
  3. Refer to addresses

Read Payment Methods From Account​

Retrieve a list of payment methods for the account.

Workflow​

  1. Start with account
  2. GET the link with rel: paymentmethods
  3. Refer to paymentmethods

Read Payment Instruments from Account​

Retrieve a list of payment instruments for the account.

Workflow​

  1. Start with account
  2. GET the link with rel: paymentinstruments
  3. Refer to paymentinstruments

Read Purchases from Account​

Retrieve a list of purchases for the account.

Workflow​

  1. Start with account
  2. GET the link with rel: purchases
  3. Refer to purchases

Read Buyer Roles​

Retrieve a list of available buyer roles.

Workflow​

  1. Start with root
  2. GET the link with rel: references
  3. GET the link with rel: buyerroles
  4. Render the response

Response​

Sample​


{
"self": {
"type": "accounts.account-buyer-roles",
"uri": "/accounts/mobee/buyerroles",
"href": "http://10.11.12.227:8080/cortex/accounts/mobee/buyerroles"
},
"messages": [],
"links": [],
"roles": [
"SINGLE_SESSION_BUYER", "LIMITED_CATALOG_BROWSER", "CATALOG_BROWSER", "BUYER", "BUYER_ADMIN"
]
}