ecommerce

Add promo rule

Add a new promo rule to a store.

post/3.0/ecommerce/stores/{store_id}/promo-rules

Request

Path parameters

store_idstring required

The store id.

Request body

created_at_foreignstring

The date and time the promotion was created in ISO 8601 format.

descriptionstring required

The description of a promotion restricted to UTF-8 characters with max length 255.

enabledboolean

Whether the promo rule is currently enabled.

target'per_item' | 'total' | 'shipping' required

The target that the discount applies to.

titlestring

The title that will show up in promotion campaign. Restricted to UTF-8 characters with max length of 100 bytes.

type'fixed' | 'percentage' required

Type of discount. For free shipping set type to fixed.

updated_at_foreignstring

The date and time the promotion was updated in ISO 8601 format.

Example request

{
  "description": "Save BIG during our summer sale!",
  "title": "50% off Total Order"
}

Response

amountnumber float

The amount of the promo code discount. If 'type' is 'fixed', the amount is treated as a monetary value. If 'type' is 'percentage', amount must be a decimal value between 0.0 and 1.0, inclusive.

created_at_foreignstring date-time

The date and time the promotion was created in ISO 8601 format.

descriptionstring

The description of a promotion restricted to UTF-8 characters with max length 255.

enabledboolean

Whether the promo rule is currently enabled.

ends_atstring Promo date-time

The date and time when the promotion ends. Must be after starts_at and in ISO 8601 format.

idstring

A unique identifier for the promo rule. If Ecommerce platform does not support promo rule, use promo code id as promo rule id. Restricted to UTF-8 characters with max length 50.

starts_atstring date-time

The date and time when the promotion is in effect in ISO 8601 format.

target'per_item' | 'total' | 'shipping'

The target that the discount applies to.

titlestring

The title that will show up in promotion campaign. Restricted to UTF-8 characters with max length of 100 bytes.

type'fixed' | 'percentage'

Type of discount. For free shipping set type to fixed.

updated_at_foreignstring date-time

The date and time the promotion was updated in ISO 8601 format.

Example response

{
  "amount": 0.5,
  "description": "Save BIG during our summer sale!",
  "title": "50% off Total Order"
}

Changes

No recorded changes to this operation across all 1 revision of this API.