Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

WooCommerce Coupons

WooCommerce Coupons abilities of the Hostinger AI plugin's WordPress site MCP server. Search, create, update and delete discount coupons, one at a time or in a batch.

Search, create, update and delete discount coupons, one at a time or in a batch.

Available: Only while WooCommerce is active on the site.

Ability
What it does
Type

Batch create, update, and delete WooCommerce coupons in a single request.

Destructive

Create a new WooCommerce coupon.

Changes the site

Delete a WooCommerce coupon by ID.

Destructive · Safe to retry

Get a single WooCommerce coupon by ID.

Read-only

Search and filter WooCommerce coupons with pagination.

Read-only

Update an existing WooCommerce coupon by ID.

Changes the site · Safe to retry

Batch Update WooCommerce Coupons

hostinger-ai/wc-coupons-batch · Destructive

Batch create, update, and delete WooCommerce coupons in a single request.

No required parameters.

Optional parameters (3)
Parameter
Type
Description

create

array of object

List of coupon objects to create

update

array of object

List of coupon objects to update (must include id)

delete

array of integer

List of coupon IDs to delete

Create WooCommerce Coupon

hostinger-ai/wc-coupons-create · Changes the site

Create a new WooCommerce coupon.

No required parameters.

Optional parameters (21)
Parameter
Type
Default
Description

code

string

Coupon code.

amount

number or string

The amount of discount. Should always be numeric, even if setting a percentage.

status

string

The status of the coupon. Should always be draft, published, or pending review

discount_type

one of percent, fixed_cart, fixed_product

fixed_cart

Determines the type of discount that will be applied.

description

string

Coupon description.

date_expires

null or string

The date the coupon expires, in the site's timezone.

date_expires_gmt

null or string

The date the coupon expires, as GMT.

individual_use

boolean

false

If true, the coupon can only be used individually. Other applied coupons will be removed from the cart.

product_ids

array of integer

List of product IDs the coupon can be used on.

excluded_product_ids

array of integer

List of product IDs the coupon cannot be used on.

usage_limit

integer

How many times the coupon can be used in total.

usage_limit_per_user

integer

How many times the coupon can be used per customer.

limit_usage_to_x_items

integer

Max number of items in the cart the coupon can be applied to.

free_shipping

boolean

false

If true and if the free shipping method requires a coupon, this coupon will enable free shipping.

product_categories

array of integer

List of category IDs the coupon applies to.

excluded_product_categories

array of integer

List of category IDs the coupon does not apply to.

exclude_sale_items

boolean

false

If true, this coupon will not be applied to items that have sale prices.

minimum_amount

number or string

Minimum order amount that needs to be in the cart before coupon applies.

maximum_amount

number or string

Maximum order amount allowed when using the coupon.

email_restrictions

array of string

List of email addresses that can use this coupon.

meta_data

array of object

Meta data.

Description sent to AI tools

Create a new WooCommerce coupon. Requires a coupon code and discount details.

Delete WooCommerce Coupon

hostinger-ai/wc-coupons-delete · Destructive · Safe to retry

Delete a WooCommerce coupon by ID.

Required parameter
Type
Description

id

integer

Unique identifier for the resource

Description sent to AI tools

Delete a WooCommerce coupon by ID. This action cannot be undone.

Get WooCommerce Coupon

hostinger-ai/wc-coupons-get · Read-only

Get a single WooCommerce coupon by ID.

Required parameter
Type
Description

id

integer

Unique identifier for the resource

Description sent to AI tools

Get a single WooCommerce coupon by ID. Returns the full coupon object with all fields.

Search WooCommerce Coupons

hostinger-ai/wc-coupons-search · Read-only

Search and filter WooCommerce coupons with pagination.

No required parameters.

Optional parameters (11)
Parameter
Type
Default
Description

context

one of view, edit

view

Scope under which the request is made; determines fields present in response.

page

integer

1

Current page of the collection.

per_page

integer

10

Maximum number of items to be returned in result set.

search

string

Limit results to those matching a string.

dates_are_gmt

boolean

false

Whether to consider GMT post dates when limiting response by published or modified date.

exclude

array of integer

[]

Ensure result set excludes specific IDs.

include

array of integer

[]

Limit result set to specific ids.

offset

integer

Offset the result set by a specific number of items.

order

one of asc, desc

desc

Order sort attribute ascending or descending.

orderby

one of date, id, include, title, slug, modified

date

Sort collection by object attribute.

code

string

Limit result set to resources with a specific code.

Description sent to AI tools

Search and filter WooCommerce coupons with pagination. Returns a list of coupons matching the search criteria.

Update WooCommerce Coupon

hostinger-ai/wc-coupons-update · Changes the site · Safe to retry

Update an existing WooCommerce coupon by ID.

Required parameter
Type
Description

id

integer

Unique identifier for the resource

Optional parameters (21)
Parameter
Type
Description

code

string

Coupon code.

amount

number or string

The amount of discount. Should always be numeric, even if setting a percentage.

status

string

The status of the coupon. Should always be draft, published, or pending review

discount_type

one of percent, fixed_cart, fixed_product

Determines the type of discount that will be applied.

description

string

Coupon description.

date_expires

null or string

The date the coupon expires, in the site's timezone.

date_expires_gmt

null or string

The date the coupon expires, as GMT.

individual_use

boolean

If true, the coupon can only be used individually. Other applied coupons will be removed from the cart.

product_ids

array of integer

List of product IDs the coupon can be used on.

excluded_product_ids

array of integer

List of product IDs the coupon cannot be used on.

usage_limit

integer

How many times the coupon can be used in total.

usage_limit_per_user

integer

How many times the coupon can be used per customer.

limit_usage_to_x_items

integer

Max number of items in the cart the coupon can be applied to.

free_shipping

boolean

If true and if the free shipping method requires a coupon, this coupon will enable free shipping.

product_categories

array of integer

List of category IDs the coupon applies to.

excluded_product_categories

array of integer

List of category IDs the coupon does not apply to.

exclude_sale_items

boolean

If true, this coupon will not be applied to items that have sale prices.

minimum_amount

number or string

Minimum order amount that needs to be in the cart before coupon applies.

maximum_amount

number or string

Maximum order amount allowed when using the coupon.

email_restrictions

array of string

List of email addresses that can use this coupon.

meta_data

array of object

Meta data.

Description sent to AI tools

Update an existing WooCommerce coupon by ID. Only provided fields will be updated.

Last updated

Was this helpful?