POST:promotions.json
Commerce APIPOST:promotions.json

POST:promotions.json

Description

Modify one or multiple promotions.

Permission bit: "promotions.modify"

Topic: Promotions

Query Parameters

flat: Boolean

Use flat output format instead of a recursive one

Example: ?flat=true


ids: Comma-separated array of String, required

List of promotion ids. See also: Unique Identifiers

Example: ?ids=pr_EQzGqWoY,pr_EQzGqWoY


shop_id: String, required

Unique shop identifier. See also: Unique Identifiers

Example: ?shop_id=sh_EQzGqWoY

Request Body

Array of PromotionModify

[
  {
    "add_quantity": 1,
    "add_variant_id": "va_EQzGqWoY",
    "auto_apply": false,
    "currency": "USD",
    "enabled": false,
    "ends_at": "2014-09-04T12:23:34Z",
    "max_uses_per_coupon": 1,
    "max_uses_per_customer": 1,
    "max_uses_per_order": 5,
    "name": "",
    "priority": 5,
    "rule_names_i18n": [
      ""
    ],
    "rules": [
      {
        "condition": {
          "amount": 0,
          "category_id": "ca_EQzGqWoY",
          "conditions": [
            null
          ],
          "customer_group_id": "cg_EQzGqWoY",
          "operator": "eq",
          "product_id": "pd_EQzGqWoY",
          "quantity": 0,
          "shipping_provider_id": "sp_EQzGqWoY",
          "type": "and",
          "variant_id": "va_EQzGqWoY"
        },
        "id": "pe_EQzGqWoY",
        "name": "Free Item",
        "type": "item_fixed_amount_off",
        "value": 0
      }
    ],
    "starts_at": "2014-09-04T12:23:34Z"
  }
]

Response Body

Array of Promotion

Response Body Type

Loading module