Promotions

Add, edit, and delete anything related to promotions.

Promotion

promotion_id
integer

The promotion ID for the item in WP EasyCart.

promotion_type
integer

The types may be 1 (price/percent off), 4 (shipping discount), 6 (price/percetage at min total), 7 (free shipping), 8 (price/percetage at min items), and 9 (BOGO).

promotion_message
string

This is a short message, sometimes displayed to the customer, where applicable.

start_date
string

The start date of this promotion in the format of YYYY-MM-DD

end_date
string

The end date of this promotion in the format of YYYY-MM-DD

limit_type
string

When applicable, values may be limit by none, product, manufacturer, or category. Must include correct ID based on this value.

product_id
integer

Limit by product, where applicable.

manufacturer_id
integer

Limit by manufacturer, where applicable.

category_id
integer

Limit by category, where applicable.

discount_type
string

Type of discount, either price or percentage

discount_amount
number

Price or percentage to discount, when applicable.

price_threshold
number

For promo type 6 or 7, the minimum amount required for the discount to apply.

item_threshold
integer

For promo type 8, the minimum items required for the discount to apply.

bogo_max
integer

For promo type 9, the maximum times per customer this can be redeemed.

{
  • "promotion_id": 0,
  • "promotion_type": 0,
  • "promotion_message": "string",
  • "start_date": "string",
  • "end_date": "string",
  • "limit_type": "string",
  • "product_id": 0,
  • "manufacturer_id": 0,
  • "category_id": 0,
  • "discount_type": "string",
  • "discount_amount": 0,
  • "price_threshold": 0,
  • "item_threshold": 0,
  • "bogo_max": 0
}

Gets a list of promotions

This allows you to get a list of promotions

SecuritybearerAuth or basicAuth
Request
query Parameters
page
integer <int64>

Page number starting at 1

perpage
integer <int64>

Number of items per page

sortby
string

Sort results by term

sortdir
string

Sort results ASC or DESC

search
string

Filter promotions by a search term

Responses
200

Successful operation

400

Unauthorized

get/promotions
Request samples
Response samples
application/json
[
  • {
    }
]

Add a promotion

This allows you to add a new promotion

SecuritybearerAuth
Request
Request Body schema: application/json
required

Submit any or all elements to add a new promotion.

promotion_type
integer

The types may be 1 (price/percent off), 4 (shipping discount), 6 (price/percetage at min total), 7 (free shipping), 8 (price/percetage at min items), and 9 (BOGO).

promotion_message
string

This is a short message, sometimes displayed to the customer, where applicable.

start_date
string

The start date of this promotion in the format of YYYY-MM-DD

end_date
string

The end date of this promotion in the format of YYYY-MM-DD

limit_type
string

When applicable, values may be limit by none, product, manufacturer, or category. Must include correct ID based on this value.

product_id
integer

Limit by product, where applicable.

manufacturer_id
integer

Limit by manufacturer, where applicable.

category_id
integer

Limit by category, where applicable.

discount_type
string

Type of discount, either price or percentage

discount_amount
number

Price or percentage to discount, when applicable.

price_threshold
number

For promo type 6 or 7, the minimum amount required for the discount to apply.

item_threshold
integer

For promo type 8, the minimum items required for the discount to apply.

bogo_max
integer

For promo type 9, the maximum times per customer this can be redeemed.

Responses
200

Successful operation

400

Unauthorized

post/promotions
Request samples
application/json
{
  • "promotion_type": 0,
  • "promotion_message": "string",
  • "start_date": "string",
  • "end_date": "string",
  • "limit_type": "string",
  • "product_id": 0,
  • "manufacturer_id": 0,
  • "category_id": 0,
  • "discount_type": "string",
  • "discount_amount": 0,
  • "price_threshold": 0,
  • "item_threshold": 0,
  • "bogo_max": 0
}
Response samples
application/json
{
  • "promotion_id": 0,
  • "promotion_type": 0,
  • "promotion_message": "string",
  • "start_date": "string",
  • "end_date": "string",
  • "limit_type": "string",
  • "product_id": 0,
  • "manufacturer_id": 0,
  • "category_id": 0,
  • "discount_type": "string",
  • "discount_amount": 0,
  • "price_threshold": 0,
  • "item_threshold": 0,
  • "bogo_max": 0
}

Gets a promotion by ID

This allows you to get a promotion from your store by promotion ID

SecuritybearerAuth or basicAuth
Request
path Parameters
promotion_id
required
integer <int64>

Promotion ID

Responses
200

Successful operation

400

Unauthorized

get/promotions/{promotion_id}
Request samples
Response samples
application/json
{
  • "promotion_id": 0,
  • "promotion_type": 0,
  • "promotion_message": "string",
  • "start_date": "string",
  • "end_date": "string",
  • "limit_type": "string",
  • "product_id": 0,
  • "manufacturer_id": 0,
  • "category_id": 0,
  • "discount_type": "string",
  • "discount_amount": 0,
  • "price_threshold": 0,
  • "item_threshold": 0,
  • "bogo_max": 0
}

Updates a promotion by ID

This allows you to update a promotion

SecuritybearerAuth
Request
path Parameters
promotion_id
required
integer <int64>

Promotion ID

Request Body schema: application/json
required

Submit any or all elements to update the promotion.

promotion_type
integer

The types may be 1 (price/percent off), 4 (shipping discount), 6 (price/percetage at min total), 7 (free shipping), 8 (price/percetage at min items), and 9 (BOGO).

promotion_message
string

This is a short message, sometimes displayed to the customer, where applicable.

start_date
string

The start date of this promotion in the format of YYYY-MM-DD

end_date
string

The end date of this promotion in the format of YYYY-MM-DD

limit_type
string

When applicable, values may be limit by none, product, manufacturer, or category. Must include correct ID based on this value.

product_id
integer

Limit by product, where applicable.

manufacturer_id
integer

Limit by manufacturer, where applicable.

category_id
integer

Limit by category, where applicable.

discount_type
string

Type of discount, either price or percentage

discount_amount
number

Price or percentage to discount, when applicable.

price_threshold
number

For promo type 6 or 7, the minimum amount required for the discount to apply.

item_threshold
integer

For promo type 8, the minimum items required for the discount to apply.

bogo_max
integer

For promo type 9, the maximum times per customer this can be redeemed.

Responses
200

Successful operation

400

Unauthorized

patch/promotions/{promotion_id}
Request samples
application/json
{
  • "promotion_type": 0,
  • "promotion_message": "string",
  • "start_date": "string",
  • "end_date": "string",
  • "limit_type": "string",
  • "product_id": 0,
  • "manufacturer_id": 0,
  • "category_id": 0,
  • "discount_type": "string",
  • "discount_amount": 0,
  • "price_threshold": 0,
  • "item_threshold": 0,
  • "bogo_max": 0
}
Response samples
application/json
{
  • "promotion_id": 0,
  • "promotion_type": 0,
  • "promotion_message": "string",
  • "start_date": "string",
  • "end_date": "string",
  • "limit_type": "string",
  • "product_id": 0,
  • "manufacturer_id": 0,
  • "category_id": 0,
  • "discount_type": "string",
  • "discount_amount": 0,
  • "price_threshold": 0,
  • "item_threshold": 0,
  • "bogo_max": 0
}

Deletes a promotion by ID

This allows you to delete a promotion from your store

SecuritybearerAuth
Request
path Parameters
promotion_id
required
integer <int64>

Promotion ID

Responses
200

Successful operation

400

Unauthorized

delete/promotions/{promotion_id}
Request samples
Response samples
application/json
{
  • "promotion_id": 0,
  • "promotion_type": 0,
  • "promotion_message": "string",
  • "start_date": "string",
  • "end_date": "string",
  • "limit_type": "string",
  • "product_id": 0,
  • "manufacturer_id": 0,
  • "category_id": 0,
  • "discount_type": "string",
  • "discount_amount": 0,
  • "price_threshold": 0,
  • "item_threshold": 0,
  • "bogo_max": 0
}