Coupons
The Coupons resource provides full CRUD for WooCommerce discount coupons.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /woo/coupons | List coupons |
| GET | /woo/coupons/{id} | Get coupon |
| POST | /woo/coupons | Create coupon |
| PUT / PATCH | /woo/coupons/{id} | Update coupon |
| DELETE | /woo/coupons/{id} | Delete coupon |
List query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
fields | string | default set | Comma-separated field names |
code | string | — | Exact coupon code match |
search | string | — | General text search |
sort | string | -date_created | Sort field, prefix - for DESC |
page | int | 1 | Page number |
per_page | int | 20 | Items per page (max 100) |
Allowed sort fields: date_created, date_modified, id, code
Available fields
List defaults: id, code, amount, discount_type, date_created, date_expires, usage_count, usage_limit
All fields: id, code, amount, discount_type, description, date_created, date_modified, date_expires, usage_count, usage_limit, usage_limit_per_user, limit_usage_to_x_items, individual_use, product_ids, excluded_product_ids, free_shipping, minimum_amount, maximum_amount, email_restrictions, exclude_sale_items, meta_data
Create / Update payload
{
"code": "SUMMER25",
"amount": "25.00",
"discount_type": "percent",
"description": "Summer sale 25% off",
"date_expires": "2025-09-01T00:00:00",
"usage_limit": 500,
"usage_limit_per_user": 1,
"individual_use": true,
"minimum_amount": "50.00",
"maximum_amount": "500.00",
"free_shipping": false,
"exclude_sale_items": true,
"product_ids": [42, 55],
"excluded_product_ids": [99],
"email_restrictions": ["vip@example.com"],
"meta_data": [
{ "key": "campaign", "value": "summer-2025" }
]
}
Notes
codeis required on create and must be a non-empty string.discount_typeaccepts:percent,fixed_cart,fixed_product.product_idsandexcluded_product_idsare arrays of integers.email_restrictionsis an array of email address strings.date_expiresaccepts an ISO date string ornull.
v0.3.0 changes
deleteMode('force'default or'trash') on the registrar controls whetherDELETEpermanently removes or trashes the coupon.- Protected meta keys (
_...) are not returned and not writable by default.