Skip to content

Commit

Permalink
Updated API from documentation release
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Jan 7, 2025
1 parent b73499a commit 3ee2d90
Show file tree
Hide file tree
Showing 24 changed files with 215 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"action": "addCustomerGroupAssignment",
"customerGroupAssignment": {
"customerGroup": {
"id": "{{customer-group-id}}",
"typeId": "customer-group"
}
}
}
6 changes: 6 additions & 0 deletions api-specs/api/examples/Customer/CustomerGroupAssignment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"customerGroup": {
"typeId": "customer-group",
"id": "customer-group-1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"action": "removeCustomerGroupAssignment",
"customerGroup": {
"id": "{{customer-group-id}}",
"typeId": "customer-group"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"action": "setCustomerGroupAssignments",
"customerGroupAssignments": [
{
"customerGroup": {
"id": "{{customer-group-id-1}}",
"typeId": "customer-group"
}
},
{
"customerGroup": {
"id": "{{customer-group-id-2}}",
"typeId": "customer-group"
}
}
]
}
4 changes: 4 additions & 0 deletions api-specs/api/traits/price-selecting.raml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ queryParameters:
required: false
description: |
`id` of an existing [CustomerGroup](ctp:api:type:CustomerGroup) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). Can only be used **in conjunction with** the `priceCurrency` parameter.
priceCustomerGroupAssignments?:
type: string[]
description: |
IDs of existing [CustomerGroups](ctp:api:type:CustomerGroup) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection), when using [multiple Customer Groups](/../api/customers-overview#multiple-customer-groups). Can only be used **in conjunction with** the `priceCurrency` parameter.
priceChannel:
type: string
required: false
Expand Down
5 changes: 5 additions & 0 deletions api-specs/api/types/customer/Customer.raml
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,8 @@ properties:
description: |
Indicates whether the `password` is required for the Customer.
default: Password
customerGroupAssignments?:
type: CustomerGroupAssignment[]
(beta): true
description: |
Customer Groups of the Customer.
5 changes: 5 additions & 0 deletions api-specs/api/types/customer/CustomerDraft.raml
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,8 @@ properties:
- Set to `Password` to make the `password` field required for the Customer.
- Set to `ExternalAuth` when the password is not required for the Customer.
default: Password
customerGroupAssignments?:
type: CustomerGroupAssignmentDraft[]
(beta): true
description: |
Customer Groups to assign to the Customer.
13 changes: 13 additions & 0 deletions api-specs/api/types/customer/CustomerGroupAssignment.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#%RAML 1.0 DataType
(package): Customer
type: object
(beta): true
displayName: CustomerGroupAssignment
example: !include ../../examples/Customer/CustomerGroupAssignment.json
description: |
Represents an individual Customer Group assignment as a [Reference](ctp:api:type:Reference) to a [CustomerGroup](ctp:api:type:CustomerGroup).
properties:
customerGroup:
type: CustomerGroupReference
description: |
Reference to a Customer Group.
10 changes: 10 additions & 0 deletions api-specs/api/types/customer/CustomerGroupAssignmentDraft.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#%RAML 1.0 DataType
(package): Customer
displayName: CustomerGroupAssignmentDraft
type: object
(beta): true
properties:
customerGroup:
type: CustomerGroupResourceIdentifier
description: |
ResourceIdentifier of a Customer Group.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#%RAML 1.0 DataType
(package): Customer
type: CustomerUpdateAction
(beta): true
displayName: CustomerAddCustomerGroupAssignmentAction
discriminatorValue: addCustomerGroupAssignment
example: !include ../../../examples/Customer/CustomerAddCustomerGroupAssignmentAction.json
description: |
Adds a single Customer Group to the Customer's list of `customerGroupAssignments`. Adding a Customer Group generates the [CustomerGroupAssignmentAdded](ctp:api:type:CustomerGroupAssignmentAddedMessage) Message.
properties:
customerGroupAssignment:
type: CustomerGroupAssignmentDraft
description: |
Customer Group to assign to the Customer.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#%RAML 1.0 DataType
(package): Customer
type: CustomerUpdateAction
(beta): true
displayName: CustomerRemoveCustomerGroupAssignmentAction
discriminatorValue: removeCustomerGroupAssignment
example: !include ../../../examples/Customer/CustomerRemoveCustomerGroupAssignmentAction.json
description: |
Unassigns a Customer Group from a Customer. Unassigning a Customer Group generates the [CustomerGroupAssignmentRemoved](ctp:api:type:CustomerGroupAssignmentRemovedMessage) Message.
properties:
customerGroup:
type: CustomerGroupResourceIdentifier
description: |
Customer Group to unassign from the Customer.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#%RAML 1.0 DataType
(package): Customer
type: CustomerUpdateAction
(beta): true
displayName: CustomerSetCustomerGroupAssignmentsAction
discriminatorValue: setCustomerGroupAssignments
example: !include ../../../examples/Customer/CustomerSetCustomerGroupAssignmentsAction.json
description: |
Assigns multiple Customer Groups to a Customer. Assigning Customer Groups generates the [CustomerGroupAssignmentsSetMessage](ctp:api:type:CustomerGroupAssignmentsSetMessage) Message.
properties:
customerGroupAssignments:
type: CustomerGroupAssignmentDraft[]
description: |
Customer Groups to assign to the Customer.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#%RAML 1.0 DataType
(package): Message
type: Message
(beta): true
displayName: CustomerGroupAssignmentAddedMessage
discriminatorValue: CustomerGroupAssignmentAdded
description: |
Generated after a successful [Add CustomerGroupAssignment](ctp:api:type:CustomerAddCustomerGroupAssignmentAction) update action.
properties:
customerGroupAssignment:
type: CustomerGroupAssignment
description: |
[CustomerGroupAssignment](ctp:api:type:CustomerGroupAssignment) that was added during the [Add CustomerGroupAssignment](ctp:api:type:CustomerAddCustomerGroupAssignmentAction) update action.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#%RAML 1.0 DataType
(package): Message
type: Message
(beta): true
displayName: CustomerGroupAssignmentRemovedMessage
discriminatorValue: CustomerGroupAssignmentRemoved
description: |
Generated after a successful [Remove CustomerGroupAssignment](ctp:api:type:CustomerRemoveCustomerGroupAssignmentAction) update action.
properties:
customerGroupAssignment:
type: CustomerGroupReference
description: |
[CustomerGroupAssignment](ctp:api:type:CustomerGroupAssignment) that was removed during the [Remove CustomerGroupAssignment](ctp:api:type:CustomerRemoveCustomerGroupAssignmentAction) update action.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#%RAML 1.0 DataType
(package): Message
type: Message
(beta): true
displayName: CustomerGroupAssignmentsSetMessage
discriminatorValue: CustomerGroupAssignmentsSet
description: |
Generated after a successful [Set CustomerGroupAssignments](ctp:api:type:CustomerSetCustomerGroupAssignmentsAction) update action.
properties:
customerGroupAssignments?:
type: CustomerGroupAssignment[]
description: |
List of [CustomerGroupAssignments](ctp:api:type:CustomerGroupAssignment) that were set during the [Set CustomerGroupAssignments](ctp:api:type:CustomerSetCustomerGroupAssignmentsAction) update action.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#%RAML 1.0 DataType
(package): Message
type: MessagePayload
(beta): true
displayName: CustomerGroupAssignmentAddedMessagePayload
discriminatorValue: CustomerGroupAssignmentAdded
description: |
Generated after a successful [Add CustomerGroupAssignment](ctp:api:type:CustomerAddCustomerGroupAssignmentAction) update action.
properties:
customerGroupAssignment:
type: CustomerGroupAssignment
description: |
[CustomerGroupAssignment](ctp:api:type:CustomerGroupAssignment) that was added during the [Add CustomerGroupAssignment](ctp:api:type:CustomerAddCustomerGroupAssignmentAction) update action.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#%RAML 1.0 DataType
(package): Message
type: MessagePayload
(beta): true
displayName: CustomerGroupAssignmentRemovedMessagePayload
discriminatorValue: CustomerGroupAssignmentRemoved
description: |
Generated after a successful [Remove CustomerGroupAssignment](ctp:api:type:CustomerRemoveCustomerGroupAssignmentAction) update action.
properties:
customerGroupAssignment:
type: CustomerGroupReference
description: |
[CustomerGroupAssignment](ctp:api:type:CustomerGroupAssignment) that was removed during the [Remove CustomerGroupAssignment](ctp:api:type:CustomerRemoveCustomerGroupAssignmentAction) update action.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#%RAML 1.0 DataType
(package): Message
type: MessagePayload
(beta): true
displayName: CustomerGroupAssignmentsSetMessagePayload
discriminatorValue: CustomerGroupAssignmentsSet
description: |
Generated after a successful [Set CustomerGroupAssignments](ctp:api:type:CustomerSetCustomerGroupAssignmentsAction) update action.
properties:
customerGroupAssignments?:
type: CustomerGroupAssignment[]
description: |
List of [CustomerGroupAssignments](ctp:api:type:CustomerGroupAssignment) that were set during the [Set CustomerGroupAssignments](ctp:api:type:CustomerSetCustomerGroupAssignmentsAction) update action.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ properties:
type: string
description: |
`id` of an existing [CustomerGroup](ctp:api:type:CustomerGroup) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). Can only be used **in conjunction with** the `priceCurrency` parameter.
priceCustomerGroupAssignments?:
type: string[]
description: |
IDs of existing [CustomerGroups](ctp:api:type:CustomerGroup) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection), when using [multiple Customer Groups](/../api/customers-overview#multiple-customer-groups). Can only be used **in conjunction with** the `priceCurrency` parameter.
priceChannel?:
type: string
description: |
Expand Down
11 changes: 11 additions & 0 deletions api-specs/api/types/types.raml
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ CustomerCreatePasswordResetToken: !include customer/CustomerCreatePasswordResetT
CustomerDraft: !include customer/CustomerDraft.raml
CustomerEmailTokenReference: !include customer/CustomerEmailTokenReference.raml
CustomerEmailVerify: !include customer/CustomerEmailVerify.raml
CustomerGroupAssignment: !include customer/CustomerGroupAssignment.raml
CustomerGroupAssignmentDraft: !include customer/CustomerGroupAssignmentDraft.raml
CustomerPagedQueryResponse: !include customer/CustomerPagedQueryResponse.raml
CustomerPasswordTokenReference: !include customer/CustomerPasswordTokenReference.raml
CustomerReference: !include customer/CustomerReference.raml
Expand All @@ -450,12 +452,14 @@ MyCustomerResetPassword: !include customer/MyCustomerResetPassword.raml
MyCustomerSignin: !include customer/MyCustomerSignin.raml
CustomerAddAddressAction: !include customer/updates/CustomerAddAddressAction.raml
CustomerAddBillingAddressIdAction: !include customer/updates/CustomerAddBillingAddressIdAction.raml
CustomerAddCustomerGroupAssignmentAction: !include customer/updates/CustomerAddCustomerGroupAssignmentAction.raml
CustomerAddShippingAddressIdAction: !include customer/updates/CustomerAddShippingAddressIdAction.raml
CustomerAddStoreAction: !include customer/updates/CustomerAddStoreAction.raml
CustomerChangeAddressAction: !include customer/updates/CustomerChangeAddressAction.raml
CustomerChangeEmailAction: !include customer/updates/CustomerChangeEmailAction.raml
CustomerRemoveAddressAction: !include customer/updates/CustomerRemoveAddressAction.raml
CustomerRemoveBillingAddressIdAction: !include customer/updates/CustomerRemoveBillingAddressIdAction.raml
CustomerRemoveCustomerGroupAssignmentAction: !include customer/updates/CustomerRemoveCustomerGroupAssignmentAction.raml
CustomerRemoveShippingAddressIdAction: !include customer/updates/CustomerRemoveShippingAddressIdAction.raml
CustomerRemoveStoreAction: !include customer/updates/CustomerRemoveStoreAction.raml
CustomerSetAddressCustomFieldAction: !include customer/updates/CustomerSetAddressCustomFieldAction.raml
Expand All @@ -465,6 +469,7 @@ CustomerSetCompanyNameAction: !include customer/updates/CustomerSetCompanyNameAc
CustomerSetCustomFieldAction: !include customer/updates/CustomerSetCustomFieldAction.raml
CustomerSetCustomTypeAction: !include customer/updates/CustomerSetCustomTypeAction.raml
CustomerSetCustomerGroupAction: !include customer/updates/CustomerSetCustomerGroupAction.raml
CustomerSetCustomerGroupAssignmentsAction: !include customer/updates/CustomerSetCustomerGroupAssignmentsAction.raml
CustomerSetCustomerNumberAction: !include customer/updates/CustomerSetCustomerNumberAction.raml
CustomerSetDateOfBirthAction: !include customer/updates/CustomerSetDateOfBirthAction.raml
CustomerSetDefaultBillingAddressAction: !include customer/updates/CustomerSetDefaultBillingAddressAction.raml
Expand Down Expand Up @@ -920,6 +925,9 @@ CustomerEmailChangedMessage: !include message/CustomerEmailChangedMessage.raml
CustomerEmailTokenCreatedMessage: !include message/CustomerEmailTokenCreatedMessage.raml
CustomerEmailVerifiedMessage: !include message/CustomerEmailVerifiedMessage.raml
CustomerFirstNameSetMessage: !include message/CustomerFirstNameSetMessage.raml
CustomerGroupAssignmentAddedMessage: !include message/CustomerGroupAssignmentAddedMessage.raml
CustomerGroupAssignmentRemovedMessage: !include message/CustomerGroupAssignmentRemovedMessage.raml
CustomerGroupAssignmentsSetMessage: !include message/CustomerGroupAssignmentsSetMessage.raml
CustomerGroupCustomFieldAddedMessage: !include message/CustomerGroupCustomFieldAddedMessage.raml
CustomerGroupCustomFieldChangedMessage: !include message/CustomerGroupCustomFieldChangedMessage.raml
CustomerGroupCustomFieldRemovedMessage: !include message/CustomerGroupCustomFieldRemovedMessage.raml
Expand Down Expand Up @@ -1191,6 +1199,9 @@ CustomerEmailChangedMessagePayload: !include message/payload/CustomerEmailChange
CustomerEmailTokenCreatedMessagePayload: !include message/payload/CustomerEmailTokenCreatedMessagePayload.raml
CustomerEmailVerifiedMessagePayload: !include message/payload/CustomerEmailVerifiedMessagePayload.raml
CustomerFirstNameSetMessagePayload: !include message/payload/CustomerFirstNameSetMessagePayload.raml
CustomerGroupAssignmentAddedMessagePayload: !include message/payload/CustomerGroupAssignmentAddedMessagePayload.raml
CustomerGroupAssignmentRemovedMessagePayload: !include message/payload/CustomerGroupAssignmentRemovedMessagePayload.raml
CustomerGroupAssignmentsSetMessagePayload: !include message/payload/CustomerGroupAssignmentsSetMessagePayload.raml
CustomerGroupCustomFieldAddedMessagePayload: !include message/payload/CustomerGroupCustomFieldAddedMessagePayload.raml
# yamllint disable-line rule:line-length
CustomerGroupCustomFieldChangedMessagePayload: !include message/payload/CustomerGroupCustomFieldChangedMessagePayload.raml
Expand Down
2 changes: 1 addition & 1 deletion api-specs/graphql/schema.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -8924,7 +8924,7 @@ type ProductVariant {
prices: [ProductPrice!]

"Returns a single price based on the price selection rules."
price(currency: Currency!, country: Country, customerGroupId: String, channelId: String, date: DateTime): ProductPrice
price(currency: Currency!, country: Country, customerGroupId: String, customerGroupAssignmentIds: [String], channelId: String, date: DateTime): ProductPrice
images: [Image!]!
assets: [Asset!]!
availability: ProductVariantAvailabilityWithChannels
Expand Down
3 changes: 1 addition & 2 deletions api-specs/history/types/GraphQLError.raml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ properties:
items: any
description: Query fields listed in order from the root of the query response up to the field in which the error occurred. `path` is displayed in the response only if an error is associated with a particular field in the query result.
extensions:
type: object
# type: GraphQLErrorObject
type: GraphQLErrorObject
description: Dictionary with additional information where applicable.
2 changes: 1 addition & 1 deletion api-specs/history/types/common/PatternComponent.raml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type: object
(beta): true
displayName: PatternComponent
# discriminator: type
discriminator: type
properties:
type:
type: string
2 changes: 1 addition & 1 deletion api-specs/history/types/types.raml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GraphQLResponse: !include ../../api/types/graphql/GraphQLResponse.raml
GraphQLError: !include GraphQLError.raml
GraphQLErrorLocation: !include ../../api/types/graphql/GraphQLErrorLocation.raml
GraphQLVariablesMap: !include ../../api/types/graphql/GraphQLVariablesMap.raml
# GraphQLErrorObject: !include ../../api/types/error/graphql/GraphQLErrorObject.raml
GraphQLErrorObject: !include ../../api/types/error/graphql/GraphQLErrorObject.raml
# Generated types
AddAddressChange: !include change/AddAddressChange.raml
AddAssetChange: !include change/AddAssetChange.raml
Expand Down

0 comments on commit 3ee2d90

Please sign in to comment.