Skip to content

Commit 9695138

Browse files
committed
Updated API from documentation release
1 parent 722f268 commit 9695138

File tree

9 files changed

+151
-2
lines changed

9 files changed

+151
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"action": "setUnitType",
3+
"unitType": "Division",
4+
"parentUnit": {
5+
"typeId": "business-unit",
6+
"key": "commercetools"
7+
}
8+
}

api-specs/api/types/business-unit/updates/BusinessUnitChangeParentUnitAction.raml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ displayName: BusinessUnitChangeParentUnitAction
55
discriminatorValue: changeParentUnit
66
example: !include ../../../examples/BusinessUnit/BusinessUnitChangeParentUnitAction.json
77
description: |
8-
Changing the parent of a [Business Unit](ctp:api:type:BusinessUnit) generates a [BusinessUnitParentChanged](ctp:api:type:BusinessUnitParentChangedMessage) Message.
8+
This action generates a [BusinessUnitParentChanged](ctp:api:type:BusinessUnitParentChangedMessage) Message.
99
properties:
1010
parentUnit:
1111
type: BusinessUnitResourceIdentifier
1212
description: |
13-
New parent unit of the [Business Unit](ctp:api:type:BusinessUnit). The new parent unit must have the same top-level unit as the old parent unit.
13+
New parent unit of the [Business Unit](ctp:api:type:BusinessUnit).
14+
It must be associated with the same Stores, as the old parent unit.
15+
16+
The Business Unit `inheritedAssociates` and `inheritedStores` field values will be [eventually consistent](/../api/general-concepts#eventual-consistency).
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#%RAML 1.0 DataType
2+
(package): BusinessUnit
3+
type: BusinessUnitUpdateAction
4+
(beta): true
5+
displayName: BusinessUnitSetUnitTypeAction
6+
discriminatorValue: setUnitType
7+
example: !include ../../../examples/BusinessUnit/BusinessUnitSetUnitType.json
8+
description: |
9+
This action generates a [BusinessUnitTypeSet](ctp:api:type:BusinessUnitTypeSetMessage) Message.
10+
properties:
11+
unitType:
12+
type: BusinessUnitType
13+
description: |
14+
New type of the [Business Unit](ctp:api:type:BusinessUnit).
15+
16+
If `unitType="Company"`, the Business Unit `storeMode`, `associateMode`, and `approvalRuleMode` field values must be `Explicit`.
17+
parentUnit?:
18+
type: BusinessUnitResourceIdentifier
19+
description: |
20+
New parent unit for the [Business Unit](ctp:api:type:BusinessUnit), if `unitType="Division"`.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#%RAML 1.0 DataType
2+
(package): Message
3+
type: Message
4+
(beta): true
5+
displayName: BusinessUnitTopLevelUnitSetMessage
6+
discriminatorValue: BusinessUnitTopLevelUnitSet
7+
description: |
8+
Generated when a [Business Unit](ctp:api:type:BusinessUnit) `topLevelUnit` is modified due to a hierarchy change after a successful [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) or [Change Parent Unit](ctp:api:type:BusinessUnitChangeParentUnitAction) update action.
9+
properties:
10+
topLevelUnit:
11+
type: BusinessUnitKeyReference
12+
description: |
13+
Top-level unit of the [Business Unit](ctp:api:type:BusinessUnit) after the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) or [Change Parent Unit](ctp:api:type:BusinessUnitChangeParentUnitAction) update action.
14+
oldTopLevelUnit:
15+
type: BusinessUnitKeyReference
16+
description: |
17+
Top-level unit of the [Business Unit](ctp:api:type:BusinessUnit) before the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) or [Change Parent Unit](ctp:api:type:BusinessUnitChangeParentUnitAction) update action.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#%RAML 1.0 DataType
2+
(package): Message
3+
type: Message
4+
(beta): true
5+
displayName: BusinessUnitTypeSetMessage
6+
discriminatorValue: BusinessUnitTypeSet
7+
description: |
8+
Generated after a successful [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action.
9+
properties:
10+
parentUnit?:
11+
type: BusinessUnitKeyReference
12+
description: |
13+
Parent unit of the [Business Unit](ctp:api:type:BusinessUnit) after the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action.
14+
oldParentUnit?:
15+
type: BusinessUnitKeyReference
16+
description: |
17+
Parent unit of the [Business Unit](ctp:api:type:BusinessUnit) before the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action.
18+
unitType:
19+
type: BusinessUnitType
20+
description: |
21+
Type of the [Business Unit](ctp:api:type:BusinessUnit) after the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action.
22+
oldUnitType:
23+
type: BusinessUnitType
24+
description: |
25+
Type of the [Business Unit](ctp:api:type:BusinessUnit) before the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#%RAML 1.0 DataType
2+
(package): Message
3+
type: MessagePayload
4+
(beta): true
5+
displayName: BusinessUnitTopLevelUnitSetMessagePayload
6+
discriminatorValue: BusinessUnitTopLevelUnitSet
7+
description: |
8+
Generated when a [Business Unit](ctp:api:type:BusinessUnit) `topLevelUnit` is modified due to a hierarchy change after a successful [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) or [Change Parent Unit](ctp:api:type:BusinessUnitChangeParentUnitAction) update action.
9+
properties:
10+
topLevelUnit:
11+
type: BusinessUnitKeyReference
12+
description: |
13+
Top-level unit of the [Business Unit](ctp:api:type:BusinessUnit) after the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) or [Change Parent Unit](ctp:api:type:BusinessUnitChangeParentUnitAction) update action.
14+
oldTopLevelUnit:
15+
type: BusinessUnitKeyReference
16+
description: |
17+
Top-level unit of the [Business Unit](ctp:api:type:BusinessUnit) before the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) or [Change Parent Unit](ctp:api:type:BusinessUnitChangeParentUnitAction) update action.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#%RAML 1.0 DataType
2+
(package): Message
3+
type: MessagePayload
4+
(beta): true
5+
displayName: BusinessUnitTypeSetMessagePayload
6+
discriminatorValue: BusinessUnitTypeSet
7+
description: |
8+
Generated after a successful [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action.
9+
properties:
10+
parentUnit?:
11+
type: BusinessUnitKeyReference
12+
description: |
13+
Parent unit of the [Business Unit](ctp:api:type:BusinessUnit) after the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action.
14+
oldParentUnit?:
15+
type: BusinessUnitKeyReference
16+
description: |
17+
Parent unit of the [Business Unit](ctp:api:type:BusinessUnit) before the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action.
18+
unitType:
19+
type: BusinessUnitType
20+
description: |
21+
Type of the [Business Unit](ctp:api:type:BusinessUnit) after the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action.
22+
oldUnitType:
23+
type: BusinessUnitType
24+
description: |
25+
Type of the [Business Unit](ctp:api:type:BusinessUnit) before the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action.

api-specs/api/types/types.raml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ BusinessUnitSetDefaultBillingAddressAction: !include business-unit/updates/Busin
131131
BusinessUnitSetDefaultShippingAddressAction: !include business-unit/updates/BusinessUnitSetDefaultShippingAddressAction.raml
132132
BusinessUnitSetStoreModeAction: !include business-unit/updates/BusinessUnitSetStoreModeAction.raml
133133
BusinessUnitSetStoresAction: !include business-unit/updates/BusinessUnitSetStoresAction.raml
134+
BusinessUnitSetUnitTypeAction: !include business-unit/updates/BusinessUnitSetUnitTypeAction.raml
134135
CartDiscount: !include cart-discount/CartDiscount.raml
135136
CartDiscountCustomLineItemsTarget: !include cart-discount/CartDiscountCustomLineItemsTarget.raml
136137
CartDiscountDraft: !include cart-discount/CartDiscountDraft.raml
@@ -912,6 +913,8 @@ BusinessUnitStoreAddedMessage: !include message/BusinessUnitStoreAddedMessage.ra
912913
BusinessUnitStoreModeChangedMessage: !include message/BusinessUnitStoreModeChangedMessage.raml
913914
BusinessUnitStoreRemovedMessage: !include message/BusinessUnitStoreRemovedMessage.raml
914915
BusinessUnitStoresSetMessage: !include message/BusinessUnitStoresSetMessage.raml
916+
BusinessUnitTopLevelUnitSetMessage: !include message/BusinessUnitTopLevelUnitSetMessage.raml
917+
BusinessUnitTypeSetMessage: !include message/BusinessUnitTypeSetMessage.raml
915918
CartDiscountCreatedMessage: !include message/CartDiscountCreatedMessage.raml
916919
CartDiscountDeletedMessage: !include message/CartDiscountDeletedMessage.raml
917920
CartDiscountStoreAddedMessage: !include message/CartDiscountStoreAddedMessage.raml
@@ -1184,6 +1187,8 @@ BusinessUnitStoreAddedMessagePayload: !include message/payload/BusinessUnitStore
11841187
BusinessUnitStoreModeChangedMessagePayload: !include message/payload/BusinessUnitStoreModeChangedMessagePayload.raml
11851188
BusinessUnitStoreRemovedMessagePayload: !include message/payload/BusinessUnitStoreRemovedMessagePayload.raml
11861189
BusinessUnitStoresSetMessagePayload: !include message/payload/BusinessUnitStoresSetMessagePayload.raml
1190+
BusinessUnitTopLevelUnitSetMessagePayload: !include message/payload/BusinessUnitTopLevelUnitSetMessagePayload.raml
1191+
BusinessUnitTypeSetMessagePayload: !include message/payload/BusinessUnitTypeSetMessagePayload.raml
11871192
CartDiscountCreatedMessagePayload: !include message/payload/CartDiscountCreatedMessagePayload.raml
11881193
CartDiscountDeletedMessagePayload: !include message/payload/CartDiscountDeletedMessagePayload.raml
11891194
CartDiscountStoreAddedMessagePayload: !include message/payload/CartDiscountStoreAddedMessagePayload.raml

api-specs/graphql/schema.sdl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,11 +1667,31 @@ type BusinessUnitStoresSet implements MessagePayload {
16671667
type: String!
16681668
}
16691669

1670+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
1671+
type BusinessUnitTopLevelUnitSet implements MessagePayload {
1672+
oldTopLevelUnit: BusinessUnit!
1673+
topLevelUnit: BusinessUnit!
1674+
oldTopLevelUnitRef: KeyReference
1675+
topLevelUnitRef: KeyReference
1676+
type: String!
1677+
}
1678+
16701679
enum BusinessUnitType {
16711680
Company
16721681
Division
16731682
}
16741683

1684+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
1685+
type BusinessUnitTypeSet implements MessagePayload {
1686+
oldUnitType: BusinessUnitType!
1687+
unitType: BusinessUnitType!
1688+
parentUnit: BusinessUnit
1689+
oldParentUnit: BusinessUnit
1690+
parentUnitRef: KeyReference
1691+
oldParentUnitRef: KeyReference
1692+
type: String!
1693+
}
1694+
16751695
input BusinessUnitUpdateAction {
16761696
addAddress: AddBusinessUnitAddress
16771697
addAssociate: AddBusinessUnitAssociate
@@ -1700,6 +1720,9 @@ input BusinessUnitUpdateAction {
17001720
setStoreMode: SetBusinessUnitStoreMode
17011721
changeAssociateMode: ChangeBusinessUnitAssociateMode
17021722
changeApprovalRuleMode: ChangeBusinessUnitApprovalRuleMode
1723+
1724+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
1725+
setUnitType: SetBusinessUnitUnitType
17031726
}
17041727

17051728
input CancelQuoteRequest {
@@ -10872,6 +10895,12 @@ input SetBusinessUnitStores {
1087210895
stores: [ResourceIdentifierInput!]!
1087310896
}
1087410897

10898+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
10899+
input SetBusinessUnitUnitType {
10900+
unitType: BusinessUnitType!
10901+
parentUnit: ResourceIdentifierInput
10902+
}
10903+
1087510904
input SetCartAnonymousId {
1087610905
anonymousId: String
1087710906
}

0 commit comments

Comments
 (0)