HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Update Promotions

PUT <<api_domain>>/v1/promotions/:promotion_id

To create detailed information of couple promotions
建立優惠活動

Request Example

curl --location --request PUT '<<api_domain>>/v1/promotions/5f69dd8b54893e003575b493' \
--header 'Accept: application/json' \
--header 'Authorization: ${token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "codes": [],
    "conditions": [
        {
            "blacklisted_product_ids": [],
            "min_item_count": null,
            "min_price": 1000,
            "subscription_period": "",
            "type": "red",
            "whitelisted_product_ids": [],
            "blacklisted_product_ids": [],
            "whitelisted_category_ids": []
        }
    ],
    "description_translations": {
        "en": "Promotion description"
    },
    "discount_on": "order",
    "discount_percentage": 12,
    "discount_type": "percentage",
    "discountable_quantity": 1000,
    "end_at": "",
    "extend_promotions": [],
    "max_use_count": null,
    "min_price_type": "after_discount",
    "requires_membership": false,
    "show_coupon": false,
    "start_at": "2020/12/17 04:00 PM",
    "title_translations": {
        "en": "abc"
    },
    "user_max_use_count": 0,
    "whitelisted_delivery_option_ids": [],
    "whitelisted_membership_tier_ids": [],
    "whitelisted_payment_ids": [],
    "whitelisted_tag_contents": [],
    "discountable_product_ids": [],
    "discountable_category_ids": [],
    "status": "active",
    "discounted_price": 123,
    "discount_amount": 11,
    "is_accumulated": true,
    "extended_promotion_id": "",
    "membership_tier_id": "",
    "seo_title_translations": {
        "en": ""
    },
    "seo_description_translations": {
        "en": ""
    },
    "seo_keywords": "",
    //   "term_translations": {"en": "Here this terms"},
    //   "banner_media_ids": [ ],
    "for_affiliate_campaign": "",
    "discounted_point": ""
}'
{
  "title_translations": {
      "en": "Promotions & Campaigns",
      "zh-hant": "優惠活動1"
  },
  "conditions": [
      {
          "min_price": 100,
          "min_item_count": null,
          "blacklisted_product_ids": []
      }
  ],
  "start_at": "2021/09/06 06:00 PM",
  "end_at": "2021/09/07 12:00 AM",
  "max_use_count": null,
  "requires_membership": false,
  "user_max_use_count": 0,
  "discountable_quantity": null,
  "discount_type": "amount",
  "discount_on": "order",
  "whitelisted_payment_ids": [
      "60c1e434a47d91004377f169"
  ],
  "whitelisted_delivery_option_ids": [
      "60d0033f6691e1004483c083"
  ],
  "whitelisted_membership_tier_ids": [],
  "codes": [],
  "discount_amount": 100,
  "discountable_product_ids": [
    "61318d4339eda51a97afe7fb"
  ]  
}
{
  "title_translations": {
      "en": "free shipping"
  },
  "conditions": [
      {
          "min_price": 10
      }
  ],
  "start_at": "2021/09/06 06:00 pm",
  "end_at": "",
  "max_use_count": null,
  "requires_membership": false,
  "min_price_type": "after_discount",
  "user_max_use_count": 0,
  "discountable_quantity": null,
  "discount_type": "free_shipping",
  "discount_on": "order",
  "whitelisted_payment_ids": [
      "60c1e434a47d91004377f169"
  ],
  "whitelisted_delivery_option_ids": [
      "60d0033f6691e1004483c083"
  ],
  "whitelisted_membership_tier_ids": [],
  "codes": []
}
{
  "title_translations": {
      "zh-hant": "購物車加價購",
      "en": "must have this field"
  },
  "conditions": [
    {
      "min_price": 10
    }
  ],
  "start_at": "2021/09/07 11:00 AM",
  "end_at": "2021/09/25 12:00 AM",
  "addon_products": [
      {
          "addon_product_id": "60c9cd1b0053cc00462aad3f",
          "discounted_price": 22,
          "discountable_quantity": 1
      }
  ]
}
{
  "title_translations": {
      "en": "Bundle pricing promotion",
      "zh-hant": "任選優惠"
  },
  "conditions": [
      {
          "min_price": null,
          "min_item_count": 2,
          "whitelisted_product_ids": [
              "61318d4339eda51a97afe7fb"
          ],
          "blacklisted_product_ids": []
      }
  ],
  "start_at": "2021/09/06 06:00 PM",
  "end_at": "2021/09/18 12:00 AM",
  "max_use_count": null,
  "requires_membership": false,
  "min_price_type": "after_discount",
  "user_max_use_count": 0,
  "discountable_quantity": null,
  "discount_type": "bundle_pricing",
  "discount_on": "item",
  "discountable_product_ids": [
      "61318d4339eda51a97afe7fb"
  ],
  "whitelisted_payment_ids": [
      "60c1e434a47d91004377f169"
  ],
  "whitelisted_delivery_option_ids": [
      "60d0033f6691e1004483c083"
  ],
  "whitelisted_membership_tier_ids": [],
  "is_accumulated": true,
  "codes": [],
  "discounted_price": 100
}
{
  "title_translations": {
      "en": "A+B promotions"
  },
  "conditions": [
      {
          "min_item_count": 1,
          "type": "red",
          "whitelisted_product_ids": [
              "60c1e11aa47d91004377f149"
          ]
      },
      {
          "min_item_count": 1,
          "type": "green",
          "whitelisted_product_ids": [
              "60c1e31da47d91004377f14f"
          ]
      }
  ],
  "start_at": "2021/09/07 04:00 PM",
  "end_at": null,
  "max_use_count": null,
  "requires_membership": false,
  "min_price_type": "after_discount",
  "user_max_use_count": 0,
  "discountable_quantity": null,
  "discount_type": "bundle_group",
  "discount_on": "item",
  "discountable_product_ids": [
      "60c1e11aa47d91004377f149",
      "60c1e31da47d91004377f14f"
  ],
  "whitelisted_payment_ids": [
      "60c1e434a47d91004377f169"
  ],
  "whitelisted_delivery_option_ids": [
      "60d0033f6691e1004483c083"
  ],
  "whitelisted_membership_tier_ids": [],
  "is_accumulated": true,
  "codes": [],
  "discounted_price": 50
}
{
  "title_translations": {
      "en": "member point gift promotion",
      "zh-hant": "點數兌換"
  },
  "start_at": "2021/09/06 12:00 AM",
  "end_at": "2021/09/30 12:00 AM",
  "discountable_product_ids": [
      "610258328c5acd00452fcf8b"
  ],
  "gifts": [
      {
          "discounted_point": 123,
          "gift_id": "610258328c5acd00452fcf8b"
      }
  ],
  "term_translations": {
      "en": "this is where you put your terms and conditions",
      "zh-hant": "條款和條件"
  },
  "banner_media_ids": []
}

Request parameters

ParameterTypeDescriptionExample
promotionPromotionPlease check the link on the left

當指定分類商品或指定商品時,才能更新 seo_title_translations, seo_description_translations, seo_keywords, term_translations
When promotion's discount_on is item or category, the four params
seo_title_translations, seo_description_translations, seo_keywords and term_translations can be updated

  • Sample Response

{
  "id": "5e8445bcca53240021eab706",
  "discount_percentage": 10,
  "discount_amount": {
    "cents": 999999999,
    "currency_symbol": "NT$",
    "currency_iso": "TWD",
    "label": "NT$999,999,999",
    "dollars": 999999999
  },
  "discountable_quantity": 3,
  "discounted_point": 100,
  "discounted_price": {
    "cents": 999999999,
    "currency_symbol": "NT$",
    "currency_iso": "TWD",
    "label": "NT$999,999,999",
    "dollars": 999999999
  },
  "discountable_product_ids": [
    "5e8420f2ad0fba0015406e56",
    "5e8420b54c61c3001ea5155c"
  ],
  "conditions": [
    {
      "id": "5f06c338a5daed002d2dbc7e",
      "min_item_count": 2,
      "min_price": null,
      "type": null,
      "whitelisted_product_ids": [
        "5e8420f2ad0fba0015406e56",
        "5e8420b54c61c3001ea5155c"
      ],
      "whitelisted_category_ids": [],
      "blacklisted_product_ids": []
    }
  ],
  "title_translations": {
    "en": "string",
    "zh-hant": "string",
    "zh-cn": "string",
    "vi": "string",
    "ms": "string",
    "ja": "string",
    "th": "string",
    "id": "string",
    "de": "string",
    "fr": "string"
  },
  "discountable_category_ids": [
    "5e8c5b7ee3880972601cd58c",
    "5f48cb50e38809d8b4801609"
  ],
  "discount_on": "order",
  "discount_type": "percentage",
  "is_accumulated": true,
  "codes": [
    "VIP001",
    "VIP002"
  ],
  "show_coupon": true,
  "membership_tier_id": "5e844fb7b6c29b000f00f9c6",
  "requires_membership": true,
  "whitelisted_membership_tier_ids": [
    "5e844fb7b6c29b000f00f9c6",
    "5e844fa74c61c30030a521f3"
  ],
  "whitelisted_tag_contents": [
    "string"
  ],
  "user_max_use_count": 1,
  "max_use_count": 20,
  "use_count": 5,
  "sum_use_count": 14,
  "whitelisted_delivery_option_ids": [
    "5e8417e7d4f5f100393710fa",
    "5e841409beef3d001b403c3c",
    "5e8413ed563778001e96a319"
  ],
  "whitelisted_payment_ids": [
    "5e8413688fa5fc00159950d1",
    "5e84133f95b3340015764347",
    "5e84132050b28e002d149b18",
    "5e840fe1ca53240018eaaa50"
  ],
  "start_at": "2020-07-09T04:00:00.000+00:00",
  "end_at": "null",
  "status": "active",
  "usable": true,
  "for_affiliate_campaign": true,
  "is_contain_campaign": true,
  "seo_keywords": "summer special",
  "seo_description_translations": {
    "en": "string",
    "zh-hant": "string",
    "zh-cn": "string",
    "vi": "string",
    "ms": "string",
    "ja": "string",
    "th": "string",
    "id": "string",
    "de": "string",
    "fr": "string"
  },
  "seo_title_translations": {
    "en": "string",
    "zh-hant": "string",
    "zh-cn": "string",
    "vi": "string",
    "ms": "string",
    "ja": "string",
    "th": "string",
    "id": "string",
    "de": "string",
    "fr": "string"
  },
  "link": {
    "id": "string",
    "status": "string",
    "type": "string",
    "name": "string",
    "name_translation": {
      "en": "string",
      "zh-hant": "string",
      "zh-cn": "string",
      "vi": "string",
      "ms": "string",
      "ja": "string",
      "th": "string",
      "id": "string",
      "de": "string",
      "fr": "string"
    },
    "value_id": "string",
    "url_link": "string",
    "key": "string",
    "html_target": "string",
    "section": "string",
    "owner_id": "string",
    "children_ids": [
      "string"
    ]
  },
  "extended_promotion_id": "5f06a6cb0a3509004853443a",
  "extend_promotions": [
    {
      "id": "5f06c48a436e2b004b471613",
      "discount_percentage": null,
      "discount_amount": null,
      "discountable_quantity": null,
      "discounted_point": 10000,
      "discounted_price": null,
      "discountable_product_ids": [
        "5f06a6ad2a051a0048caec6f"
      ],
      "conditions": []
    }
  ]
}