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
- Start with root
GET
the link with rel: defaultprofileGET
the link with rel: accounts- Render the response
Read Account
Retrieve read and write attributes on an account.
Workflow
- Start with root
GET
the link with rel: defaultprofileGET
the link with rel: accountsGET
the link with rel: element- Render the response
Response
accounts.account
Type: Name | Description | Type |
---|---|---|
account-business-name | The account’s business name. | string |
account-business-number | The account’s business number. | string |
account-fax | The account’s fax number. | string |
account-phone | The account’s phone number. | string |
account-tax-exemption-id | The 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
- Start with account
- Edit the account object with new details
- Update account using a
PUT
request
Read Identifier on Account
Retrieve the shared ID of the account.
Workflow
- Start with account
GET
the link with rel: identifier- Render the response
Response
accounts.shared-account-id
Type: Name | Description | Type |
---|---|---|
shared-account-id | The 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
- Start with root
GET
the link with rel: defaultprofileGET
the link with rel: accountsGET
the link with rel: status- Render the response
Response
accounts.account-status
Type: Name | Description | Type |
---|---|---|
status | Account status | string |
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
- Start with account
GET
the link with rel: attributes- 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
- Start with account
GET
the link with rel: associates- Render the response
Read Associate from Account
Retrieve an associate record for an account.
Workflow
- Start with account
GET
the link with rel: associatesGET
the link with rel: element- Render the response
Response
accounts.associate
Type: Name | Description | Type |
---|---|---|
role | The 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
- Start with account
GET
the link with rel: associatesGET
the link with rel: myself- Render the response
Response
accounts.associate
Type: Name | Description | Type |
---|---|---|
role | The 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
- Start with account
GET
the link with rel: associatesGET
the link with rel: elementGET
the link with rel: associatedetails- Render the response
Response
accounts.associate
Type: Name | Description | Type |
---|---|---|
email | The buyer’s email address. | string |
first-name | The buyer’s first name. | string |
last-name | The 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
- Start with account
GET
the link with rel: associatesGET
the link with rel: addassociateform- Fill out the form
POST
the form using the link with rel: addassociateaction
Request Fields
accounts.add-associate-form
Type: Name | Description | Type |
---|---|---|
email | The shopper’s email address. | string |
role | The role that the shopper should have for the account. | string |
Update Association on Account
Update the role on the buyer’s account association.
Workflow
- Start with account
GET
the link with rel: associatesGET
the link with rel: element- Edit the associate object with new details
- 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
- Start with account
GET
the link with rel: associatesGET
the link with rel: elementDELETE
associate
Read Child Accounts from Account
Retrieve a list of child accounts for the current account.
Workflow
- Start with account
GET
the link with rel: childaccounts- Render the response
Read Child Account from Account
Retrieve a child account.
Workflow
- Start with account
GET
the link with rel: childaccountsGET
the link with rel: element- Refer to account
Read Addresses from Account
Retrieve a list of addresses for the shopper.
Workflow
Read Payment Methods From Account
Retrieve a list of payment methods for the account.
Workflow
- Start with account
GET
the link with rel: paymentmethods- Refer to paymentmethods
Read Payment Instruments from Account
Retrieve a list of payment instruments for the account.
Workflow
- Start with account
GET
the link with rel: paymentinstruments- Refer to paymentinstruments
Read Purchases from Account
Retrieve a list of purchases for the account.
Workflow
Read Buyer Roles
Retrieve a list of available buyer roles.
Workflow
- Start with root
GET
the link with rel: referencesGET
the link with rel: buyerroles- 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"
]
}