Enhanced permissions management for companies
The new Associate Roles API provides B2B customers with the flexibility to define and manage the permissions of their Associates. The feature allows the configuration of granular permissions that provide controlled access to Business Units, Carts, Orders, Quotes, and Quote Requests. Additionally, roles can be inherited from a parent Business Unit by its children.
This feature replaces the less flexible AssociateRole enum with Buyer
and Admin
values. This type alongside the roles
field on Associate and AssociateDraft is now deprecated and will be completely removed on 02 August 2023.
In addition to the Associate Roles API, a new set of associate
endpoints can be used to validate that an Associate has sufficient permissions on a given resource. These endpoints are available for Business Units, Carts, Orders, Quotes, and Quote Requests and perform permission evaluation checks based on an associateId
.
These features are part of Composable Commerce for B2B and will be subject to additional terms and pricing.
Changes:
- [API] Added Associate Roles API.
- [API] Added Associate Carts, Associate Orders, Associate Quote Requests, Associate Quotes, and Associate BusinessUnit endpoints.
- [API] Added BusinessUnitAssociateMode, AssociateRoleInheritanceMode, AssociateRoleAssignment, and AssociateRoleAssignmentDraft, InheritedAssociate, and InheritedAssociateRoleAssignment types to BusinessUnit.
- [API] Added
inheritedAssociates
andassociateMode
fields to BusinessUnit. - [API] Added
associateMode
fields to BusinessUnitDraft. - [API] Added
associateRoleAssignments
field to Associate and AssociateDraft. - [API] Added
associateRoleAssignments
to MyBusinessUnitAssociateDraft. - [API] Deprecated AssociateRole enum with
Admin
andBuyer
values. - [API] Deprecated
roles
andinheritedAssociates
field on Associate and AssociateDraft. - [API] Added Associate Role Messages.
- [API] Added BusinessUnitAssociateModeChanged Message.
- [API] Added
myBusinessUnitAssociateRoleOnCreation
to BusinessUnitConfiguration in Project settings. - [GraphQL API] Added the following types to the GraphQL schema:
AddAssociateRolePermission
,AsAssociate
,AsAssociateArgument
,AssociateInheritanceMode
,AssociateRole
,AssociateRoleAssignment
,AssociateRoleAssignmentDraft
,AssociateRoleBuyerAssignableChanged
,AssociateRoleCreated
,AssociateRoleDeleted
,AssociateRoleDraft
,AssociateRoleNameSet
,AssociateRolePermissionAdded
,AssociateRolePermissionRemoved
,AssociateRolePermissionsSet
,AssociateRoleQueryResult
,AssociateRoleUpdateAction
,BusinessUnitAssociateMode
,BusinessUnitAssociateModeChanged
,ChangeAssociateRoleBuyerAssignable
,ChangeBusinessUnitAssociateMode
,InheritedAssociate
,InheritedAssociateRoleAssignment
,Permission
,RemoveAssociateRolePermission
,SetAssociateRoleCustomField
,SetAssociateRoleCustomType
,SetAssociateRoleName
,SetAssociateRolePermissions
,SetProjectSettingsMyBusinessUnitAssociateRoleOnCreation
. - [GraphQL API] Changed the
BusinessUnitDraft
type:- Input field
associateMode
was added toBusinessUnitDraft
type
- Input field
- [GraphQL API] Changed the
BusinessUnit
type:- Added the
inheritedAssociates
field to theBusinessUnit
type. - Added the
associateMode
field to theBusinessUnit
type.
- Added the
- [GraphQL API] Changed the
Associate
type:- Added the
associateRoleAssignments
field to theAssociate
type. - Field
roles
was deprecated inAssociate
type
- Added the
- [GraphQL API] Changed the
AssociateDraft
type:- Input field
associateRoleAssignments
was added toAssociateDraft
type - Input field
roles
was deprecated inAssociateDraft
type
- Input field
- [GraphQL API] Changed the
BusinessUnitConfiguration
type:- Added the
myBusinessUnitAssociateRoleOnCreation
field to theBusinessUnitConfiguration
type. - Added the
myBusinessUnitAssociateRoleOnCreationRef
field to theBusinessUnitConfiguration
type.
- Added the
- [GraphQL API]
SimpleAssociateRole
type was deprecated - [GraphQL API] Changed the
Query
type:- Added the
asAssociate
field to theQuery
type. - Added the
associateRole
field to theQuery
type. - Added the
associateRoles
field to theQuery
type.
- Added the
- [GraphQL API] Changed the
Mutation
type:- Argument
asAssociate
was added toMutation.updateBusinessUnit
field - Added the
updateAssociateRole
field to theMutation
type. - Argument
asAssociate
was added toMutation.createOrderFromCart
field - Argument
asAssociate
was added toMutation.deleteCart
field - Argument
asAssociate
was added toMutation.createBusinessUnit
field - Argument
asAssociate
was added toMutation.updateQuoteRequest
field - Argument
asAssociate
was added toMutation.createOrderFromQuote
field - Argument
asAssociate
was added toMutation.createCart
field - Argument
asAssociate
was added toMutation.updateOrder
field - Added the
deleteAssociateRole
field to theMutation
type. - Argument
asAssociate
was added toMutation.updateQuote
field - Argument
asAssociate
was added toMutation.createQuoteRequest
field - Added the
createAssociateRole
field to theMutation
type. - Argument
asAssociate
was added toMutation.updateCart
field
- Argument
- [GraphQL API] Changed the
ProjectSettingsUpdateAction
type:- Input field
setMyBusinessUnitAssociateRoleOnCreation
was added toProjectSettingsUpdateAction
type
- Input field
- [GraphQL API] Changed the
BusinessUnitUpdateAction
type:- Input field
changeAssociateMode
was added toBusinessUnitUpdateAction
type
- Input field
The following changes were introduced in terms of GraphQL SDL:
extend type Query {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"asAssociate(businessUnitKey: KeyReferenceInput!, associateId: String!): AsAssociate!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"associateRole("Queries with specified ID"id: String,"Queries with specified key"key: String): AssociateRole"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"associateRoles(where: String, sort: [String!], limit: Int, offset: Int): AssociateRoleQueryResult!}extend type BusinessUnit {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"associateMode: BusinessUnitAssociateMode"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"inheritedAssociates: [InheritedAssociate!]}extend type Associate {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"associateRoleAssignments: [AssociateRoleAssignment!]}extend type Mutation {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"createAssociateRole(draft: AssociateRoleDraft!): AssociateRole"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"deleteAssociateRole(version: Long!, personalDataErasure: Boolean = false,"Queries with specified ID"id: String,"Queries with specified key"key: String): AssociateRole"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"updateAssociateRole(version: Long!, actions: [AssociateRoleUpdateAction!]!,"Queries with specified ID"id: String,"Queries with specified key"key: String): AssociateRole}extend type BusinessUnitConfiguration {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"myBusinessUnitAssociateRoleOnCreation: AssociateRole"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"myBusinessUnitAssociateRoleOnCreationRef: KeyReference}extend input BusinessUnitDraft {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"associateMode: BusinessUnitAssociateMode}extend input AssociateDraft {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"associateRoleAssignments: [AssociateRoleAssignmentDraft!]}extend input ProjectSettingsUpdateAction {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"setMyBusinessUnitAssociateRoleOnCreation: SetProjectSettingsMyBusinessUnitAssociateRoleOnCreation}extend input BusinessUnitUpdateAction {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"changeAssociateMode: ChangeBusinessUnitAssociateMode}input AddAssociateRolePermission {permission: Permission!}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"type AsAssociate implements CartQueryInterface & OrderQueryInterface & QuoteQueryInterface & QuoteRequestQueryInterface {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"cart(id: String!): Cart"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"carts(where: String, sort: [String!], limit: Int, offset: Int): CartQueryResult!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"order("Queries with specified ID"id: String, orderNumber: String): Order"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"orders(where: String, sort: [String!], limit: Int, offset: Int): OrderQueryResult!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"quoteRequest("Queries with specified ID"id: String,"Queries with specified key"key: String): QuoteRequest"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"quoteRequests(where: String, sort: [String!], limit: Int, offset: Int): QuoteRequestQueryResult!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"quote("Queries with specified ID"id: String,"Queries with specified key"key: String): Quote"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"quotes(where: String, sort: [String!], limit: Int, offset: Int): QuoteQueryResult!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"businessUnit("Queries with specified ID"id: String,"Queries with specified key"key: String): BusinessUnit"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"businessUnits(where: String, sort: [String!], limit: Int, offset: Int): BusinessUnitQueryResult!}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"input AsAssociateArgument {businessUnitKey: KeyReferenceInput!associateId: String!}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"enum AssociateInheritanceMode {DisabledEnabled}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"type AssociateRole implements Versioned {key: String!buyerAssignable: Boolean!name: Stringpermissions: [Permission!]!custom: CustomFieldsTypeid: String!version: Long!createdAt: DateTime!lastModifiedAt: DateTime!createdBy: InitiatorlastModifiedBy: Initiator}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"type AssociateRoleAssignment {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"associateRoleRef: KeyReference"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"associateRole: AssociateRole!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"inheritance: AssociateInheritanceMode}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"input AssociateRoleAssignmentDraft {associateRole: ResourceIdentifierInput!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"inheritance: AssociateInheritanceMode}type AssociateRoleBuyerAssignableChanged implements MessagePayload {buyerAssignable: Boolean!type: String!}type AssociateRoleCreated implements MessagePayload {associateRole: AssociateRole!type: String!}type AssociateRoleDeleted implements MessagePayload {type: String!}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"input AssociateRoleDraft {key: String!name: StringbuyerAssignable: Boolean!permissions: [Permission!]custom: CustomFieldsDraft}type AssociateRoleNameSet implements MessagePayload {name: Stringtype: String!}type AssociateRolePermissionAdded implements MessagePayload {permission: Permission!type: String!}type AssociateRolePermissionRemoved implements MessagePayload {permission: Permission!type: String!}type AssociateRolePermissionsSet implements MessagePayload {permissions: [Permission!]type: String!}type AssociateRoleQueryResult {offset: Int!count: Int!total: Long!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"exists: Boolean!results: [AssociateRole!]!}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"input AssociateRoleUpdateAction {addPermission: AddAssociateRolePermissionchangeBuyerAssignable: ChangeAssociateRoleBuyerAssignableremovePermission: RemoveAssociateRolePermissionsetCustomField: SetAssociateRoleCustomFieldsetCustomType: SetAssociateRoleCustomTypesetName: SetAssociateRoleNamesetPermissions: SetAssociateRolePermissions}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"enum BusinessUnitAssociateMode {ExplicitExplicitAndFromParent}type BusinessUnitAssociateModeChanged implements MessagePayload {associateMode: BusinessUnitAssociateMode!oldAssociateMode: BusinessUnitAssociateModetype: String!}input ChangeAssociateRoleBuyerAssignable {buyerAssignable: Boolean!}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"input ChangeBusinessUnitAssociateMode {associateMode: BusinessUnitAssociateMode!}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"type InheritedAssociate {associateRoleAssignments: [InheritedAssociateRoleAssignment!]!customerRef: Referencecustomer: Customer}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"type InheritedAssociateRoleAssignment {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"associateRoleRef: KeyReference!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"associateRole: AssociateRole!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"sourceRef: KeyReference!"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"source: BusinessUnit!}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"enum Permission {CreateMyOrdersFromMyQuotesCreateMyQuoteRequestsFromMyCartsCreateMyCartsCreateOrdersFromOthersCartsDeclineOthersQuotesUpdateMyCartsViewOthersQuotesRenegotiateMyQuotesUpdateParentUnitCreateOthersCartsUpdateBusinessUnitDetailsAcceptMyQuotesRenegotiateOthersQuotesUpdateOthersCartsDeleteOthersCartsDeclineMyQuotesViewMyCartsAddChildUnitsDeleteMyCartsUpdateAssociatesAcceptOthersQuotesViewOthersOrdersViewOthersCartsUpdateMyQuoteRequestsCreateQuoteRequestsFromOthersCartsViewMyQuotesViewMyQuoteRequestsCreateMyOrdersFromMyCartsUpdateOthersOrdersUpdateMyOrdersViewOthersQuoteRequestsCreateOrdersFromOthersQuotesViewMyOrdersUpdateOthersQuoteRequests}input RemoveAssociateRolePermission {permission: Permission!}input SetAssociateRoleCustomField {name: String!value: String}input SetAssociateRoleCustomType {fields: [CustomFieldInput!]type: ResourceIdentifierInputtypeKey: StringtypeId: String}input SetAssociateRoleName {name: String}input SetAssociateRolePermissions {permissions: [Permission!]}"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"input SetProjectSettingsMyBusinessUnitAssociateRoleOnCreation {associateRole: ResourceIdentifierInput}