Representations
AssociateRole
id String | Unique identifier of the AssociateRole. |
version Int | Current version of the AssociateRole. |
key String | User-defined unique and immutable identifier of the AssociateRole. MinLength:2 MaxLength: 256 Pattern: ^[A-Za-z0-9_-]+$ |
buyerAssignable Boolean | 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 |
name String | Name of the AssociateRole. |
permissions Array of Permission | List of Permissions for the AssociateRole. |
custom | Custom Fields for the AssociateRole. |
createdAt DateTime | Date and time (UTC) the AssociateRole was initially created. |
createdBy BETA | IDs and references that created the AssociateRole. |
lastModifiedAt DateTime | Date and time (UTC) the AssociateRole was last updated. |
lastModifiedBy BETA | IDs and references that last modified the AssociateRole. |
AssociateRoleDraft
key String | User-defined unique and immutable identifier for the AssociateRole. MinLength:2 MaxLength: 256 Pattern: ^[A-Za-z0-9_-]+$ |
name String | Name of the AssociateRole. |
buyerAssignable Boolean | Whether the AssociateRole can be assigned to an Associate by a buyer. Default: true |
permissions Array 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
AddChildUnits
permission 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
limit Int | Number of requested results. |
offset Int | Number of elements skipped. |
count Int | Actual number of results returned. |
total Int | 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. |
results Array of AssociateRole | AssociateRoles matching the query. |
AssociateRoleReference
id String | Unique identifier of the referenced AssociateRole. |
typeId | associate-role Type of referenced resource. |
obj | Contains the representation of the expanded AssociateRole. Only present in responses to requests with Reference Expansion for AssociateRole. |
AssociateRoleKeyReference
key String | Unique and immutable key of the referenced AssociateRole. |
typeId | associate-role Type of referenced resource. |
AssociateRoleResourceIdentifier
id
or key
is required. If both are set, an InvalidJsonInput error is returned.id String | Unique identifier of the referenced AssociateRole. Required if key is absent. |
key String | Unique key of the referenced AssociateRole. Required if id is absent. |
typeId | associate-role Type 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}
region String | Region in which the Project is hosted. |
projectKey String | key of the Project. |
id String | id of the AssociateRole. |
expand | The parameter can be passed multiple times. |
application/json
curl --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}
region String | Region in which the Project is hosted. |
projectKey String | key of the Project. |
key String | key of the AssociateRole. |
expand | The parameter can be passed multiple times. |
application/json
curl --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}
region String | Region in which the Project is hosted. |
projectKey String | 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. |
limit Int | Number of results requested. Default: 20 Minimum: 0 Maximum: 500 |
offset Int | Number of elements skipped. Default: 0 Maximum: 10000 |
withTotal Boolean | 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/json
curl --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 OK
status if the AssociateRole exists or a 404 Not Found
otherwise.view_associate_roles:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String | key of the Project. |
id String | 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 OK
status if the AssociateRole exists or a 404 Not Found
otherwise.view_associate_roles:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String | key of the Project. |
key String | 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 OK
status if any AssociateRole match the query predicate, or a 404 Not Found
otherwise.view_associate_roles:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String | 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}
region String | Region in which the Project is hosted. |
projectKey String | key of the Project. |
expand | The parameter can be passed multiple times. |
application/json
application/json
curl 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}
region String | Region in which the Project is hosted. |
projectKey String | key of the Project. |
id String | id of the AssociateRole. |
expand | The parameter can be passed multiple times. |
application/json
version Int | 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. |
actions Array of AssociateRoleUpdateAction | Update actions to be performed on the AssociateRole. |
application/json
curl 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}
region String | Region in which the Project is hosted. |
projectKey String | key of the Project. |
key String | key of the AssociateRole. |
expand | The parameter can be passed multiple times. |
application/json
version Int | 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. |
actions Array of AssociateRoleUpdateAction | Update actions to be performed on the AssociateRole. |
application/json
curl 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
action String | "addPermission" |
permission | Permission to be added to the AssociateRole. |
{
"action": "addPermission",
"permission": "ViewMyCarts"
}
Change BuyerAssignable
buyerAssignable
value of an AssociateRole generates an AssociateRoleBuyerAssignableChanged Message.action String | "changeBuyerAssignable" |
buyerAssignable Boolean | The new value of the buyerAssignable field of the AssociateRole. |
{
"action": "changeBuyerAssignable",
"buyerAssignable": false
}
Remove Permission
action String | "removePermission" |
permission | Permission to be removed from the AssociateRole. |
{
"action": "removePermission",
"permission": "ViewMyCarts"
}
Set CustomField
action String | "setCustomField" |
name String | 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": "ExamplaryStringTypeField",
"value": "TextString"
}
Set Custom Type
action String | "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
action String | "setName" |
name String | 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
action String | "setPermissions" |
permissions Array 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}
region String | Region in which the Project is hosted. |
projectKey String | key of the Project. |
id String | id of the AssociateRole. |
version Int | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/json
curl -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}
region String | Region in which the Project is hosted. |
projectKey String | key of the Project. |
key String | key of the AssociateRole. |
version Int | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/json
curl -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"]
}