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
- UpdateApprovalFlows
An Associate can update Approval Flows.
- CreateApprovalRules
An Associate can create Approval Rules.
- UpdateApprovalRules
An Associate can update Approval Rules.
- AddChildUnits
An Associate can create a child Business Unit.
- UpdateAssociates
An Associate can manage other Associates.
- UpdateBusinessUnitDetails
An Associate can edit Business Unit details.
- UpdateParentUnit
- An 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. - CreateMyCarts
An Associate can create their own B2B Carts.
- CreateOthersCarts
An Associate can create B2B Carts that belong to other Associates.
- DeleteMyCarts
An Associate can delete their own B2B Carts.
- DeleteOthersCarts
An Associate can delete B2B Carts that belong to other Associates.
- UpdateMyCarts
An Associate can update their own B2B Carts.
- UpdateOthersCarts
An Associate can update B2B Carts that belong to other Associates.
- ViewMyCarts
An Associate can view their own B2B Carts.
- ViewOthersCarts
An Associate can view B2B Carts that belong to other Associates.
- CreateMyOrdersFromMyCarts
An Associate can create Orders from their own B2B Carts.
- CreateMyOrdersFromMyQuotes
An Associate can create Orders from their own B2B Quotes.
- CreateOrdersFromOthersCarts
An Associate can create Orders from B2B Carts that belong to other Associates.
- CreateOrdersFromOthersQuotes
An Associate can create Orders from B2B Quotes that belong to other Associates.
- UpdateMyOrders
An Associate can update their own B2B Orders.
- UpdateOthersOrders
An Associate can update B2B Orders that belong to other Associates.
- ViewMyOrders
An Associate can view their own B2B Orders.
- ViewOthersOrders
An Associate can view B2B Orders that belong to other Associates.
- AcceptMyQuotes
An Associate can accept their own B2B Quotes.
- AcceptOthersQuotes
An Associate can accept B2B Quotes that belong to other Associates.
- DeclineMyQuotes
An Associate can decline their own B2B Quotes.
- DeclineOthersQuotes
An Associate can decline B2B Quotes that belong to other Associates.
- ReassignMyQuotes
An Associate can reassign their own B2B Quotes to a different Associate.
- ReassignOthersQuotes
An Associate can reassign B2B Quotes that belong to other Associates.
- RenegotiateMyQuotes
An Associate can renegotiate their own B2B Quotes.
- RenegotiateOthersQuotes
An Associate can renegotiate B2B Quotes that belong to other Associates.
- ViewMyQuotes
An Associate can view their own B2B Quotes.
- ViewOthersQuotes
An Associate can view B2B Quotes that belong to other Associates.
- CreateMyQuoteRequestsFromMyCarts
An Associate can create their own Quote Requests from their own B2B Carts.
- CreateQuoteRequestsFromOthersCarts
An Associate can create Quote Requests from B2B Carts that belong to other Associates.
- UpdateMyQuoteRequests
An Associate can update their own B2B Quote Requests.
- UpdateOthersQuoteRequests
An Associate can update B2B Quote Requests of other Associates.
- ViewMyQuoteRequests
An Associate can view their own B2B Quote Requests.
- ViewOthersQuoteRequests
An Associate can view B2B Quote Requests that belong to other Associates.
- CreateMyShoppingLists
An Associate can create their own B2B Shopping Lists.
- CreateOthersShoppingLists
An Associate can create B2B Shopping Lists that belong to other Associates.
- DeleteMyShoppingLists
An Associate can delete their own B2B Shopping Lists.
- DeleteOthersShoppingLists
An Associate can delete B2B Shopping Lists that belong to other Associates.
- UpdateMyShoppingLists
An Associate can update their own B2B Shopping Lists.
- UpdateOthersShoppingLists
An Associate can update B2B Shopping Lists that belong to other Associates.
- ViewMyShoppingLists
An Associate can view their own B2B Shopping Lists.
- ViewOthersShoppingLists
An 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
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 withTotal=false.
When the results are filtered with a Query Predicate, total is subject to a limit. |
resultsArray of AssociateRole | AssociateRoles matching the query. |
AssociateRoleReference
idString | Unique identifier of the referenced AssociateRole. |
typeId | associate-roleType of referenced resource. |
obj | Contains the representation of the expanded AssociateRole. Only present in responses to requests with Reference Expansion for AssociateRole. |
AssociateRoleKeyReference
keyString | Unique and immutable key of the referenced AssociateRole. |
typeId | associate-roleType of referenced resource. |
AssociateRoleResourceIdentifier
id or key is required. If both are set, an InvalidJsonInput error is returned.idString | Unique identifier of the referenced AssociateRole. Required if key is absent. |
keyString | Unique key of the referenced AssociateRole. Required if id is absent. |
typeId | associate-roleType of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource. |
Get AssociateRole
Get AssociateRole by ID
view_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString | key of the Project. |
idString | id of the AssociateRole. |
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 | key of the Project. |
keyString | key of the AssociateRole. |
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 | key of the Project. |
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: 20Minimum: 0Maximum: 500 |
offsetInt | Number of elements skipped. Default: 0Maximum: 10000 |
withTotalBoolean | Controls the calculation of the total number of query results. Set to false to improve query performance when the total is not needed.Default: true |
var.<varName>String | Predicate parameter values. The parameter can be passed multiple times. |
AssociateRolePagedQueryResponse
asapplication/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
id. Returns a 200 status if the AssociateRole exists, or a 404 status otherwise.view_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString | key of the Project. |
idString | id of the AssociateRole. |
curl --head https://api.{region}.commercetools.com/{projectKey}/associate-roles/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" Check if AssociateRole exists by Key
key. Returns a 200 status if the AssociateRole exists, or a 404 status otherwise.view_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString | key of the Project. |
keyString | key of the AssociateRole. |
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
200 status if any AssociateRole match the query predicate, or a 404 status otherwise.view_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString | key of the Project. |
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
manage_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString | key of the Project. |
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 | key of the Project. |
idString | id of the AssociateRole. |
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 | key of the Project. |
keyString | key of the AssociateRole. |
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
actionString | "addPermission" |
permission | Permission to be added to the AssociateRole. |
{
"action": "addPermission",
"permission": "ViewMyCarts"
}Change BuyerAssignable
buyerAssignable value of an AssociateRole generates an AssociateRoleBuyerAssignableChanged Message.actionString | "changeBuyerAssignable" |
buyerAssignableBoolean | The new value of the buyerAssignable field of the AssociateRole. |
{
"action": "changeBuyerAssignable",
"buyerAssignable": false
}Remove Permission
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 value is absent or null, this field will be removed if it exists.
Trying to remove a field that does not exist will fail with an InvalidOperationError error.
If value is provided, it is set for the field defined by name. |
{
"action": "setCustomField",
"name": "ExemplaryStringTypeField",
"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": {
"exemplaryStringTypeField": "TextString"
}
}Set Name
actionString | "setName" |
nameString | New name to set.
If name is absent or null, the existing name, if any, will be removed. |
{
"action": "setName",
"name": "regional-manager"
}Set Permissions
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 | key of the Project. |
idString | id of the AssociateRole. |
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
manage_associate_roles:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString | key of the Project. |
keyString | key of the AssociateRole. |
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"]
}