All Release Notes
Added support for key and Messages for Discount Codes
7 February 2024
Composable Commerce
HTTP API
Enhancement
Pricing and DiscountsMessages/SubscriptionsGraphQL
You can now use user-defined key values to identify Discount Codes. Previously, you could identify them only by their auto-generated IDs. The enhancement also includes a new update action to set the key
value, allowing you to update Discount Code keys efficiently without the need to bulk import Discount Codes with the updated keys.
Additionally, this enhancement also adds support for Messages for Discount Codes. You can subscribe to these Messages for changes when creating, deleting, or setting a key value for a Discount Code.
Changes:
- [API]
- Added
key
to DiscountCode and DiscountCodeDraft. - Added the Set Key update action to Discount Codes.
- Added
DiscountCodeCreated
,DiscountCodeDeleted
,DiscountCodeKeySet
Messages.
- Added
- [GraphQL API]
- Input field
key
was added toDiscountCode
andDiscountCodeDraft
type. - Input field
setKey
was added toDiscountCodeUpdateAction
type. - Argument
key
was added toQuery.discountCode
field and changedQuery.discountCode(id)
from required to optional. - Argument
key
was added toMutation.updateDiscountCode
field and changedMutation.updateDiscountCode(id)
from required to optional. - Argument
key
was added toMutation.deleteDiscountCode
field that changedMutation.deleteDiscountCode(id)
from required to optional. - Added the following types to the GraphQL schema:
SetDiscountCodeKey
,DiscountCodeCreated
,DiscountCodeDeleted
,DiscountCodeKeySet
.
- Input field
The following changes were introduced in terms of GraphQL SDL:
extend type DiscountCode {key: String}extend input DiscountCodeDraft {key: String}extend input DiscountCodeUpdateAction {setKey: SetDiscountCodeKey}input SetDiscountCodeKey {key: String}extend type Query {discountCode("Queries with specified ID"id: String,"Queries with specified key"key: String): DiscountCode}extend type Mutation {updateDiscountCode(version: Long!, actions: [DiscountCodeUpdateAction!]!,"Queries with specified ID"id: String,"Queries with specified key"key: String): DiscountCodedeleteDiscountCode(version: Long!,"Queries with specified ID"id: String,"Queries with specified key"key: String): DiscountCode}type DiscountCodeCreated implements MessagePayload {discountCode: DiscountCode!type: String!}type DiscountCodeDeleted implements MessagePayload {type: String!}type DiscountCodeKeySet implements MessagePayload {key: StringoldKey: Stringtype: String!}