Platform Release 30 May 2018

Mutations for the CartDiscount and ProductDiscount are now supported on the GraphQL endpoint.

Following changes were introduced in the GraphQL schema (in SDL format):

extend type Mutation {
  createCartDiscount(draft: CartDiscountDraft!): CartDiscount
  createProductDiscount(draft: ProductDiscountDraft!): ProductDiscount
  deleteCartDiscount(id: String!, version: Long!): CartDiscount
  deleteProductDiscount(id: String!, version: Long!): ProductDiscount
  updateCartDiscount(id: String!, version: Long!, actions: [CartDiscountUpdateAction!]!): CartDiscount
  updateProductDiscount(id: String!, version: Long!, actions: [CartDiscountUpdateAction!]!): ProductDiscount
}

input AbsoluteDiscountValueInput {
  money: [MoneyInput!]!
}

input CartDiscountDraft {
  value: CartDiscountValueInput!
  cartPredicate: String!
  target: CartDiscountTargetInput
  sortOrder: String!
  name: [LocalizedStringInput!]!
  description: [LocalizedStringInput!]
  validFrom: DateTime
  validUntil: DateTime
  stackingMode: StackingMode = Stacking
  requiresDiscountCode: Boolean = false
  isActive: Boolean = true
  custom: CustomFieldsDraft
}

input CartDiscountTargetInput {
  lineItems: LineItemsTargetInput
  customLineItems: CustomLineItemsTargetInput
  shipping: ShippingTargetInput
  multiBuyLineItems: MultiBuyLineItemsTargetInput
  multiBuyCustomLineItems: MultiBuyCustomLineItemsTargetInput
}

input CartDiscountUpdateAction {
  changeValue: ChangeCartDiscountValue
  changeCartPredicate: ChangeCartDiscountCartPredicate
  changeTarget: ChangeCartDiscountTarget
  setValidFrom: SetCartDiscountValidFrom
  setValidUntil: SetCartDiscountValidUntil
  changeIsActive: ChangeCartDiscountIsActive
  changeStackingMode: ChangeCartDiscountStackingMode
  changeRequiresDiscountCode: ChangeCartDiscountRequiresDiscountCode
  changeName: ChangeCartDiscountName
  setDescription: SetCartDiscountDescription
  changeSortOrder: ChangeCartDiscountSortOrder
  setCustomType: SetCartDiscountCustomType
  setCustomField: SetCartDiscountCustomField
}

input CartDiscountValueInput {
  relative: RelativeDiscountValueInput
  absolute: AbsoluteDiscountValueInput
  giftLineItem: 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: ResourceIdentifierInput
  supplyChannel: ResourceIdentifierInput
}

input LineItemsTargetInput {
  predicate: String!
}

input MoneyInput {
  currencyCode: Currency!
  centAmount: Long!
}

input MultiBuyCustomLineItemsTargetInput {
  predicate: String!
  triggerQuantity: Long!
  discountedQuantity: Long!
  maxOccurrence: Int
  selectionMode: SelectionMode
}

input MultiBuyLineItemsTargetInput {
  predicate: String!
  triggerQuantity: Long!
  discountedQuantity: Long!
  maxOccurrence: Int
  selectionMode: SelectionMode
}

input ProductDiscountDraft {
  value: ProductDiscountValueInput!
  predicate: String!
  sortOrder: String!
  name: [LocalizedStringInput!]!
  description: [LocalizedStringInput!]
  validFrom: DateTime
  validUntil: DateTime
  isActive: Boolean = true
}

input ProductDiscountValueInput {
  relative: RelativeDiscountValueInput
  absolute: AbsoluteDiscountValueInput
  external: ExternalDiscountValueInput
}

input RelativeDiscountValueInput {
  permyriad: Int!
}

input SetCartDiscountCustomField {
  name: String!
  value: String
}

input SetCartDiscountCustomType {
  typeId: String
  typeKey: String
  type: ResourceIdentifierInput
  fields: [CustomFieldInput!]
}

input SetCartDiscountDescription {
  description: [LocalizedStringInput!]
}

input SetCartDiscountValidFrom {
  validFrom: DateTime
}

input SetCartDiscountValidUntil {
  validUntil: DateTime
}

input ShippingTargetInput {
  dummy: String
}