Associate Roles
This feature is part of Composable Commerce for B2B and will be subject to additional terms and pricing.
Associate Roles give Associates controlled access to Business Units, Carts, Orders, Quotes, and Quote Requests.
Associate Roles provide a way to group granular Permissions and assign them to Associates within a Business Unit.
Representations
AssociateRole
idString | Unique identifier of the AssociateRole. |
versionInt | Current version of the AssociateRole. |
keyString | User-defined unique and immutable identifier of the AssociateRole. MinLength:2MaxLength: 256Pattern: ^[A-Za-z0-9_-]+$ |
buyerAssignableBoolean | Whether the AssociateRole can be assigned to an Associate by a buyer. If false, the AssociateRole can only be assigned using the general endpoint. Default:true |
nameString | Name of the AssociateRole. |
permissionsArray of Permission | List of Permissions for the AssociateRole. |
custom | Custom Fields for the AssociateRole. |
createdAt | Date and time (UTC) the AssociateRole was initially created. |
createdByBETA | IDs and references that created the AssociateRole. |
lastModifiedAt | Date and time (UTC) the AssociateRole was last updated. |
lastModifiedByBETA | IDs and references that last modified the AssociateRole. |
AssociateRoleDraft
keyString | User-defined unique and immutable identifier for the AssociateRole. MinLength:2MaxLength: 256Pattern: ^[A-Za-z0-9_-]+$ |
nameString | Name of the AssociateRole. |
buyerAssignableBoolean | Whether the AssociateRole can be assigned to an Associate by a buyer. Default:true |
permissionsArray of Permission | List of Permissions for the AssociateRole. |
custom | Custom Fields for the AssociateRole. |
Permission
Permissions grant granular access to Approval Rules, Approval Flows, Business Units, Carts, Orders, Quotes, Quote Requests, and Shopping Lists.
UpdateApprovalFlowsAn Associate can update Approval Flows.
CreateApprovalRulesAn Associate can create Approval Rules.
UpdateApprovalRulesAn Associate can update Approval Rules.
AddChildUnitsAn Associate can create a child Business Unit.
UpdateAssociatesAn Associate can manage other Associates.
UpdateBusinessUnitDetailsAn Associate can edit Business Unit details.
UpdateParentUnitAn Associate can assign a Business Unit to be the parent unit. Additionally, the Associate requires the
AddChildUnitspermission in the new parent to perform the assignment.CreateMyCartsAn Associate can create their own B2B Carts.
CreateOthersCartsAn Associate can create B2B Carts that belong to other Associates.
DeleteMyCartsAn Associate can delete their own B2B Carts.
DeleteOthersCartsAn Associate can delete B2B Carts that belong to other Associates.
UpdateMyCartsAn Associate can update their own B2B Carts.
UpdateOthersCartsAn Associate can update B2B Carts that belong to other Associates.
ViewMyCartsAn Associate can view their own B2B Carts.
ViewOthersCartsAn Associate can view B2B Carts that belong to other Associates.
CreateMyOrdersFromMyCartsAn Associate can create Orders from their own B2B Carts.
CreateMyOrdersFromMyQuotesAn Associate can create Orders from their own B2B Quotes.
CreateOrdersFromOthersCartsAn Associate can create Orders from B2B Carts that belong to other Associates.
CreateOrdersFromOthersQuotesAn Associate can create Orders from B2B Quotes that belong to other Associates.
UpdateMyOrdersAn Associate can update their own B2B Orders.
UpdateOthersOrdersAn Associate can update B2B Orders that belong to other Associates.
ViewMyOrdersAn Associate can view their own B2B Orders.
ViewOthersOrdersAn Associate can view B2B Orders that belong to other Associates.
AcceptMyQuotesAn Associate can accept their own B2B Quotes.
AcceptOthersQuotesAn Associate can accept B2B Quotes that belong to other Associates.
DeclineMyQuotesAn Associate can decline their own B2B Quotes.
DeclineOthersQuotesAn Associate can decline B2B Quotes that belong to other Associates.
ReassignMyQuotesAn Associate can reassign their own B2B Quotes to a different Associate.
ReassignOthersQuotesAn Associate can reassign B2B Quotes that belong to other Associates.
RenegotiateMyQuotesAn Associate can renegotiate their own B2B Quotes.
RenegotiateOthersQuotesAn Associate can renegotiate B2B Quotes that belong to other Associates.
ViewMyQuotesAn Associate can view their own B2B Quotes.
ViewOthersQuotesAn Associate can view B2B Quotes that belong to other Associates.
CreateMyQuoteRequestsFromMyCartsAn Associate can create their own Quote Requests from their own B2B Carts.
CreateQuoteRequestsFromOthersCartsAn Associate can create Quote Requests from B2B Carts that belong to other Associates.
UpdateMyQuoteRequestsAn Associate can update their own B2B Quote Requests.
UpdateOthersQuoteRequestsAn Associate can update B2B Quote Requests of other Associates.
ViewMyQuoteRequestsAn Associate can view their own B2B Quote Requests.
ViewOthersQuoteRequestsAn Associate can view B2B Quote Requests that belong to other Associates.
CreateMyShoppingListsAn Associate can create their own B2B Shopping Lists.
CreateOthersShoppingListsAn Associate can create B2B Shopping Lists that belong to other Associates.
DeleteMyShoppingListsAn Associate can delete their own B2B Shopping Lists.
DeleteOthersShoppingListsAn Associate can delete B2B Shopping Lists that belong to other Associates.
UpdateMyShoppingListsAn Associate can update their own B2B Shopping Lists.
UpdateOthersShoppingListsAn Associate can update B2B Shopping Lists that belong to other Associates.
ViewMyShoppingListsAn Associate can view their own B2B Shopping Lists.
ViewOthersShoppingListsAn Associate can view B2B Shopping Lists that belong to other Associates.
Approval Flow Permissions
Approval Rule Permissions
Business Unit Permissions
Cart Permissions
Order Permissions
Quote Permissions
Quote Request Permissions
Shopping List Permissions
AssociateRolePagedQueryResponse
PagedQueryResult with results containing an array of AssociateRole.
limitInt | Number of requested results. |
offsetInt | Number of elements skipped. |
countInt | Actual number of results returned. |
totalInt | Total number of results matching the query.
This number is an estimation that is not strongly consistent.
This field is returned by default.
For improved performance, calculating this field can be deactivated by using the query parameter |
resultsArray of AssociateRole | AssociateRoles matching the query. |
AssociateRoleReference
Reference to an AssociateRole.
idString | Unique identifier of the referenced AssociateRole. |
typeId | "associate-role"References an AssociateRole. |
obj | Contains the representation of the expanded AssociateRole. Only present in responses to requests with Reference Expansion for AssociateRole. |
AssociateRoleKeyReference
KeyReference to an AssociateRole.
keyString | Unique and immutable key of the referenced AssociateRole. |
typeId | "associate-role"References an AssociateRole. |
AssociateRoleResourceIdentifier
ResourceIdentifier of an AssociateRole. Either id or key is required. If both are set, an InvalidJsonInput error is returned.
idString | Unique identifier of the referenced AssociateRole. Required if |
keyString | Unique key of the referenced AssociateRole. Required if |
typeId | "associate-role"References an AssociateRole. |
Get AssociateRole
Get AssociateRole by ID
view_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
expand | The parameter can be passed multiple times. |
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/associate-roles/{id} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc","version": 5,"createdAt": "2022-04-19T15:36:17.510Z","lastModifiedAt": "2022-04-20T15:41:55.816Z","name": "Regional Manager","key": "regional-manager","buyerAssignable": true,"permissions": ["UpdateOthersCarts","UpdateMyQuoteRequests","UpdateOthersOrders","ViewOthersCarts","ViewOthersOrders","ViewOthersQuoteRequests"]}
Get AssociateRole by Key
view_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
expand | The parameter can be passed multiple times. |
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/associate-roles/key={key} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc","version": 5,"createdAt": "2022-04-19T15:36:17.510Z","lastModifiedAt": "2022-04-20T15:41:55.816Z","name": "Regional Manager","key": "regional-manager","buyerAssignable": true,"permissions": ["UpdateOthersCarts","UpdateMyQuoteRequests","UpdateOthersOrders","ViewOthersCarts","ViewOthersOrders","ViewOthersQuoteRequests"]}
Query AssociateRoles
view_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
where | The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limitInt | Number of results requested. Default: 20 |
offsetInt | Number of elements skipped. Default: 0 |
withTotalBoolean | Controls the calculation of the total number of query results. Set to Default: true |
var.<varName>String | Predicate parameter values. The parameter can be passed multiple times. |
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/associate-roles -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"limit": 20,"offset": 0,"count": 1,"total": 1,"results": [{"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc","version": 5,"createdAt": "2022-04-19T15:36:17.510Z","lastModifiedAt": "2022-04-20T15:41:55.816Z","name": "Regional Manager","key": "regional-manager","buyerAssignable": true,"permissions": ["UpdateOthersCarts","UpdateMyQuoteRequests","UpdateOthersOrders","ViewOthersCarts","ViewOthersOrders","ViewOthersQuoteRequests"]}]}
Check if AssociateRole exists
Check if AssociateRole exists by ID
Checks if an AssociateRole exists for a given id. Returns a 200 OK status if the AssociateRole exists or a 404 Not Found otherwise.
view_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/associate-roles/{id} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if AssociateRole exists by Key
Checks if an AssociateRole exists for a given key. Returns a 200 OK status if the AssociateRole exists or a 404 Not Found otherwise.
view_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/associate-roles/key={key} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if AssociateRole exists by Query Predicate
Checks if an AssociateRole exists for a given Query Predicate. Returns a 200 OK status if any AssociateRole match the Query Predicate or a 404 Not Found otherwise.
view_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
where | The parameter can be passed multiple times. |
curl --head https://api.{region}.commercetools.com/{projectKey}/associate-roles -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
Create AssociateRole
Creating a Associate Role generates the AssociateRoleCreated Message.
manage_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
expand | The parameter can be passed multiple times. |
application/jsonapplication/jsoncurl https://api.{region}.commercetools.com/{projectKey}/associate-roles -i \--header "Authorization: Bearer ${BEARER_TOKEN}" \--header 'Content-Type: application/json' \--data-binary @- << DATA{"key" : "regional-manager","permissions" : [ "ViewMyCarts", "UpdateMyCarts" ]}DATA
{"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc","version": 5,"createdAt": "2022-04-19T15:36:17.510Z","lastModifiedAt": "2022-04-20T15:41:55.816Z","name": "Regional Manager","key": "regional-manager","buyerAssignable": true,"permissions": ["UpdateOthersCarts","UpdateMyQuoteRequests","UpdateOthersOrders","ViewOthersCarts","ViewOthersOrders","ViewOthersQuoteRequests"]}
Update AssociateRole
Update AssociateRole by ID
manage_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
expand | The parameter can be passed multiple times. |
application/jsonversionInt | Expected version of the AssociateRole on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actionsArray of AssociateRoleUpdateAction | Update actions to be performed on the AssociateRole. |
application/jsoncurl https://api.{region}.commercetools.com/{projectKey}/associate-roles/{id} -i \--header "Authorization: Bearer ${BEARER_TOKEN}" \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 3,"actions" : [ {"action" : "setName","name" : "regional-manager"} ]}DATA
{"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc","version": 5,"createdAt": "2022-04-19T15:36:17.510Z","lastModifiedAt": "2022-04-20T15:41:55.816Z","name": "Regional Manager","key": "regional-manager","buyerAssignable": true,"permissions": ["UpdateOthersCarts","UpdateMyQuoteRequests","UpdateOthersOrders","ViewOthersCarts","ViewOthersOrders","ViewOthersQuoteRequests"]}
Update AssociateRole by Key
manage_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
expand | The parameter can be passed multiple times. |
application/jsonversionInt | Expected version of the AssociateRole on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actionsArray of AssociateRoleUpdateAction | Update actions to be performed on the AssociateRole. |
application/jsoncurl https://api.{region}.commercetools.com/{projectKey}/associate-roles/key={key} -i \--header "Authorization: Bearer ${BEARER_TOKEN}" \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 3,"actions" : [ {"action" : "setName","name" : "regional-manager"} ]}DATA
{"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc","version": 5,"createdAt": "2022-04-19T15:36:17.510Z","lastModifiedAt": "2022-04-20T15:41:55.816Z","name": "Regional Manager","key": "regional-manager","buyerAssignable": true,"permissions": ["UpdateOthersCarts","UpdateMyQuoteRequests","UpdateOthersOrders","ViewOthersCarts","ViewOthersOrders","ViewOthersQuoteRequests"]}
Update actions
Add Permission
Adding a Permission to an AssociateRole generates an AssociateRolePermissionAdded Message.
actionString | "addPermission" |
permission | Permission to be added to the AssociateRole. |
{"action": "addPermission","permission": "ViewMyCarts"}
Change BuyerAssignable
Changing the buyerAssignable value of an AssociateRole generates an AssociateRoleBuyerAssignableChanged Message.
actionString | "changeBuyerAssignable" |
buyerAssignableBoolean | The new value of the |
{"action": "changeBuyerAssignable","buyerAssignable": false}
Remove Permission
Removing a Permission from an AssociateRole generates an AssociateRolePermissionRemoved Message.
actionString | "removePermission" |
permission | Permission to be removed from the AssociateRole. |
{"action": "removePermission","permission": "ViewMyCarts"}
Set CustomField
actionString | "setCustomField" |
nameString | Name of the Custom Field. |
value | If |
{"action": "setCustomField","name": "ExamplaryStringTypeField","value": "TextString"}
Set Custom Type
actionString | "setCustomType" |
type | Defines the Type that extends the AssociateRole with Custom Fields. If absent, any existing Type and Custom Fields are removed from the AssociateRole. |
fields | Sets the Custom Fields for the AssociateRole. |
{"action": "setCustomType","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"examplaryStringTypeField": "TextString"}}
Set Name
Updating the name of an AssociateRole generates an AssociateRoleNameSet Message.
actionString | "setName" |
nameString | New name to set.
If |
{"action": "setName","name": "regional-manager"}
Set Permissions
Updating the Permissions on an AssociateRole generates an AssociateRolePermissionsSet Message.
actionString | "setPermissions" |
permissionsArray of Permission | Overrides the current list of Permissions for the AssociateRole. |
{"action": "setPermissions","permissions": ["ViewMyCarts", "ViewOthersCarts"]}
Delete AssociateRole
Delete AssociateRole by ID
manage_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
versionInt | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/jsoncurl -X DELETE https://api.{region}.commercetools.com/{projectKey}/associate-roles/{id}?version={version} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc","version": 5,"createdAt": "2022-04-19T15:36:17.510Z","lastModifiedAt": "2022-04-20T15:41:55.816Z","name": "Regional Manager","key": "regional-manager","buyerAssignable": true,"permissions": ["UpdateOthersCarts","UpdateMyQuoteRequests","UpdateOthersOrders","ViewOthersCarts","ViewOthersOrders","ViewOthersQuoteRequests"]}
Delete AssociateRole by Key
Deleting an AssociateRole generates the AssociateRoleDeleted Message. An AssociateRole can only be deleted if it is not assigned to any Associates.
manage_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
versionInt | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/jsoncurl -X DELETE https://api.{region}.commercetools.com/{projectKey}/associate-roles/key={key}?version={version} -i \--header "Authorization: Bearer ${BEARER_TOKEN}"
{"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc","version": 5,"createdAt": "2022-04-19T15:36:17.510Z","lastModifiedAt": "2022-04-20T15:41:55.816Z","name": "Regional Manager","key": "regional-manager","buyerAssignable": true,"permissions": ["UpdateOthersCarts","UpdateMyQuoteRequests","UpdateOthersOrders","ViewOthersCarts","ViewOthersOrders","ViewOthersQuoteRequests"]}