Create discount code
shoprocket_create_discount_codeWRITE: create a live discount code that shoppers can use at checkout and that reduces the store's revenue. Type fixed or percentage needs coupon_value; free_shipping does not. Use usage_limit and dates to bound it. Calling twice creates two codes. PUT /v1/discount-codes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_date | No | First valid day, yyyy-mm-dd. Required together with expire_date. | |
| coupon_code | No | The code shoppers type. Default: Shoprocket generates a random one. | |
| coupon_type | Yes | fixed = amount off, percentage = percent off, free_shipping. | |
| description | Yes | What the code is for (shown in the dashboard). | |
| expire_date | No | Last valid day, yyyy-mm-dd. Required together with start_date. | |
| usage_limit | No | Maximum number of uses in total. | |
| coupon_value | No | Required for fixed and percentage. Shoprocket documents 'a positive integer in cents': for fixed 500 = 5.00; for percentage send the whole percent (10 = 10%) and check the reply. | |
| limit_per_user | No | 1 = one use per customer. | |
| coupon_applies_to | Yes | What it applies to. free_shipping allows only all_orders and all_orders_over. | |
| minimum_order_value | No | Minimum order value in cents (as Shoprocket takes it); used with all_orders_over. | |
| coupon_applies_to_value | No | Required for multiple_products (comma-separated product ids) and categories (comma-separated category slugs). |