All Release Notes
Added GraphQL mutations for the CartDiscount and ProductDiscount
30 May 2018
Enhancement
GraphQLPricing
Mutations for the CartDiscount and ProductDiscount are now supported on the GraphQL endpoint.
- [GraphQL API] Following types were added in the GraphQL schema:
AbsoluteDiscountValueInput
,CartDiscountDraft
,CartDiscountTargetInput
,CartDiscountUpdateAction
,CartDiscountValueInput
,ChangeCartDiscountCartPredicate
,ChangeCartDiscountIsActive
,ChangeCartDiscountName
,ChangeCartDiscountRequiresDiscountCode
,ChangeCartDiscountSortOrder
,ChangeCartDiscountStackingMode
,ChangeCartDiscountTarget
,ChangeCartDiscountValue
,CustomLineItemsTargetInput
,ExternalDiscountValueInput
,GiftLineItemValueInput
,LineItemsTargetInput
,MoneyInput
,MultiBuyCustomLineItemsTargetInput
,MultiBuyLineItemsTargetInput
,ProductDiscountDraft
,ProductDiscountValueInput
,RelativeDiscountValueInput
,SetCartDiscountCustomField
,SetCartDiscountCustomType
,SetCartDiscountDescription
,SetCartDiscountValidFrom
,SetCartDiscountValidUntil
,ShippingTargetInput
.
- [GraphQL API] Type
ProductDiscount
was changed:ProductDiscount
type description is changed
- [GraphQL API] Type
Mutation
was changed:- Field
updateProductDiscount
was added toMutation
type - Field
updateCartDiscount
was added toMutation
type - Field
deleteProductDiscount
was added toMutation
type - Field
createProductDiscount
was added toMutation
type - Field
createCartDiscount
was added toMutation
type - Field
deleteCartDiscount
was added toMutation
type
- Field
Following changes were introduced in the GraphQL schema (in GraphQL Schema Definition Language):
extend type Mutation {createCartDiscount(draft: CartDiscountDraft!): CartDiscountcreateProductDiscount(draft: ProductDiscountDraft!): ProductDiscountdeleteCartDiscount(id: String!, version: Long!): CartDiscountdeleteProductDiscount(id: String!, version: Long!): ProductDiscountupdateCartDiscount(id: String!, version: Long!, actions: [CartDiscountUpdateAction!]!): CartDiscountupdateProductDiscount(id: String!, version: Long!, actions: [CartDiscountUpdateAction!]!): ProductDiscount}input AbsoluteDiscountValueInput {money: [MoneyInput!]!}input CartDiscountDraft {value: CartDiscountValueInput!cartPredicate: String!target: CartDiscountTargetInputsortOrder: String!name: [LocalizedStringInput!]!description: [LocalizedStringInput!]validFrom: DateTimevalidUntil: DateTimestackingMode: StackingMode = StackingrequiresDiscountCode: Boolean = falseisActive: Boolean = truecustom: CustomFieldsDraft}input CartDiscountTargetInput {lineItems: LineItemsTargetInputcustomLineItems: CustomLineItemsTargetInputshipping: ShippingTargetInputmultiBuyLineItems: MultiBuyLineItemsTargetInputmultiBuyCustomLineItems: MultiBuyCustomLineItemsTargetInput}input CartDiscountUpdateAction {changeValue: ChangeCartDiscountValuechangeCartPredicate: ChangeCartDiscountCartPredicatechangeTarget: ChangeCartDiscountTargetsetValidFrom: SetCartDiscountValidFromsetValidUntil: SetCartDiscountValidUntilchangeIsActive: ChangeCartDiscountIsActivechangeStackingMode: ChangeCartDiscountStackingModechangeRequiresDiscountCode: ChangeCartDiscountRequiresDiscountCodechangeName: ChangeCartDiscountNamesetDescription: SetCartDiscountDescriptionchangeSortOrder: ChangeCartDiscountSortOrdersetCustomType: SetCartDiscountCustomTypesetCustomField: SetCartDiscountCustomField}input CartDiscountValueInput {relative: RelativeDiscountValueInputabsolute: AbsoluteDiscountValueInputgiftLineItem: GiftLineItemValueInput}input ChangeCartDiscountCartPredicate {cartPredicate: String!}input ChangeCartDiscountIsActive {isActive: Boolean!}input ChangeCartDiscountName {name: [LocalizedStringInput!]!}input ChangeCartDiscountRequiresDiscountCode {requiresDiscountCode: Boolean!}input ChangeCartDiscountSortOrder {sortOrder: String!}input ChangeCartDiscountStackingMode {stackingMode: StackingMode!}input ChangeCartDiscountTarget {target: CartDiscountTargetInput!}input ChangeCartDiscountValue {value: CartDiscountValueInput!}input CustomLineItemsTargetInput {predicate: String!}input ExternalDiscountValueInput {dummy: String}input GiftLineItemValueInput {product: ResourceIdentifierInput!variantId: Int!distributionChannel: ResourceIdentifierInputsupplyChannel: ResourceIdentifierInput}input LineItemsTargetInput {predicate: String!}input MoneyInput {currencyCode: Currency!centAmount: Long!}input MultiBuyCustomLineItemsTargetInput {predicate: String!triggerQuantity: Long!discountedQuantity: Long!maxOccurrence: IntselectionMode: SelectionMode}input MultiBuyLineItemsTargetInput {predicate: String!triggerQuantity: Long!discountedQuantity: Long!maxOccurrence: IntselectionMode: SelectionMode}input ProductDiscountDraft {value: ProductDiscountValueInput!predicate: String!sortOrder: String!name: [LocalizedStringInput!]!description: [LocalizedStringInput!]validFrom: DateTimevalidUntil: DateTimeisActive: Boolean = true}input ProductDiscountValueInput {relative: RelativeDiscountValueInputabsolute: AbsoluteDiscountValueInputexternal: ExternalDiscountValueInput}input RelativeDiscountValueInput {permyriad: Int!}input SetCartDiscountCustomField {name: String!value: String}input SetCartDiscountCustomType {typeId: StringtypeKey: Stringtype: ResourceIdentifierInputfields: [CustomFieldInput!]}input SetCartDiscountDescription {description: [LocalizedStringInput!]}input SetCartDiscountValidFrom {validFrom: DateTime}input SetCartDiscountValidUntil {validUntil: DateTime}input ShippingTargetInput {dummy: String}