Promotions > Promotions > promotionsModify
Commerce APIPromotionsPromotionspromotionsModify
promotionsModify
POST:promotions.json

Description

Modify one or multiple promotions.

Permission bit: "promotions.modify"

Topic: Promotions

Arguments

data: [PromotionModify!]!

Main argument for mutations.


flat: Boolean

Use flat output format instead of a recursive one


ids: [String!]!

List of promotion ids. See also: Unique Identifiers

Example: ["pr_EQzGqWoY"]


shop_id: String!

Unique shop identifier. See also: Unique Identifiers

Example: "sh_EQzGqWoY"


Data Argument Fields

add_quantity: Int

When promotion is applied to order, add this many of add_variant_id to line items

Example: 1

Valid when: add_quantity is a non-negative integer


add_variant_id: String

Variant id to add to line items of an order when promotion is used

Example: "va_EQzGqWoY"

Valid when: add_variant_id matches regexp pattern: ^va_


auto_apply: Boolean

Automatically apply this promotion

Example: false


currency: String

Currency code used for all order-related prices defined in the promotion

Example: "USD"


enabled: Boolean

Whether this promotion is active or not

Example: false


ends_at: String

The date and time when the promotion will end

Example: "2014-09-04T12:23:34Z"

Timestamp (RFC 3339)


max_uses_per_coupon: Int

The maximum number of times a promotion may apply to orders

Example: 1

Valid when: max_uses_per_coupon is a non-negative integer


max_uses_per_customer: Int

The maximum number of uses per-customer

Example: 1

Valid when: max_uses_per_customer is a non-negative integer


max_uses_per_order: Int

The maximum number of uses per order

Example: 5

Valid when: max_uses_per_order is a non-negative integer


name: String

Name of the promotion

Translatable

Valid when: name is not empty

Valid when: name's length doesn't exceed 250 characters


priority: Int

Priority when automatically applying promotions, higher number takes precedence

Example: 5


rule_names_i18n: [String!]


rules: [PromotionRuleCreate!]

Possible parameters for this promotion


starts_at: String

The date and time when the promotion starts at

Example: "2014-09-04T12:23:34Z"

Timestamp (RFC 3339)


Result

[Promotion!]

Preview (typescript)

Loading module