younifyd
Menu

Batch Coupons

Batch create, update, and delete coupons

POST/coupons/batch

Use it in a workflow

  1. Add a step and choose the WooCommerce connector.
  2. Pick the Batch Coupons action (under Coupons).
  3. Fill in the fields below, then reference the result from later steps as {{batchCoupons.response.data}}.

Request

Request body

Enter the body as JSON in the step's Body field.

createarray<object>
idinteger

Unique identifier for the resource. read-only

codestring

Coupon code. mandatory

amountstring

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

date_createdstring (date-time)

The date the coupon was created, in the site's timezone. read-only

date_created_gmtstring (date-time)

The date the coupon was created, as GMT. read-only

date_modifiedstring (date-time)

The date the coupon was last modified, in the site's timezone. read-only

date_modified_gmtstring (date-time)

The date the coupon was last modified, as GMT. read-only

discount_typestring

Determines the type of discount that will be applied.

One ofpercentfixed_cartfixed_productDefault "fixed_cart"

descriptionstring

Coupon description.

date_expiresstring (date-time)

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

date_expires_gmtstring (date-time)

The date the coupon expires, as GMT.

usage_countinteger

Number of times the coupon has been used already. read-only

individual_useboolean

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

Default false

product_idsarray<integer>

List of product IDs the coupon can be used on.

excluded_product_idsarray<integer>

List of product IDs the coupon cannot be used on.

usage_limitinteger

How many times the coupon can be used in total.

usage_limit_per_userinteger

How many times the coupon can be used per customer.

limit_usage_to_x_itemsinteger

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

free_shippingboolean

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

Default false

product_categoriesarray<integer>

List of category IDs the coupon applies to.

excluded_product_categoriesarray<integer>

List of category IDs the coupon does not apply to.

exclude_sale_itemsboolean

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

Default false

minimum_amountstring

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

maximum_amountstring

Maximum order amount allowed when using the coupon.

email_restrictionsarray<string>

List of email addresses that can use this coupon.

meta_dataarray<object>5 fields

Meta data.

updatearray<object>
idinteger

Unique identifier for the resource. read-only

codestring

Coupon code. mandatory

amountstring

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

date_createdstring (date-time)

The date the coupon was created, in the site's timezone. read-only

date_created_gmtstring (date-time)

The date the coupon was created, as GMT. read-only

date_modifiedstring (date-time)

The date the coupon was last modified, in the site's timezone. read-only

date_modified_gmtstring (date-time)

The date the coupon was last modified, as GMT. read-only

discount_typestring

Determines the type of discount that will be applied.

One ofpercentfixed_cartfixed_productDefault "fixed_cart"

descriptionstring

Coupon description.

date_expiresstring (date-time)

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

date_expires_gmtstring (date-time)

The date the coupon expires, as GMT.

usage_countinteger

Number of times the coupon has been used already. read-only

individual_useboolean

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

Default false

product_idsarray<integer>

List of product IDs the coupon can be used on.

excluded_product_idsarray<integer>

List of product IDs the coupon cannot be used on.

usage_limitinteger

How many times the coupon can be used in total.

usage_limit_per_userinteger

How many times the coupon can be used per customer.

limit_usage_to_x_itemsinteger

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

free_shippingboolean

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

Default false

product_categoriesarray<integer>

List of category IDs the coupon applies to.

excluded_product_categoriesarray<integer>

List of category IDs the coupon does not apply to.

exclude_sale_itemsboolean

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

Default false

minimum_amountstring

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

maximum_amountstring

Maximum order amount allowed when using the coupon.

email_restrictionsarray<string>

List of email addresses that can use this coupon.

meta_dataarray<object>5 fields

Meta data.

deletearray<integer>
json
{
  "create": [
    {
      "id": 0,
      "code": "string",
      "amount": "string",
      "date_created": "2025-01-01T00:00:00Z",
      "date_created_gmt": "2025-01-01T00:00:00Z",
      "date_modified": "2025-01-01T00:00:00Z",
      "date_modified_gmt": "2025-01-01T00:00:00Z",
      "discount_type": "fixed_cart",
      "description": "string",
      "date_expires": "2025-01-01T00:00:00Z",
      "date_expires_gmt": "2025-01-01T00:00:00Z",
      "usage_count": 0
    }
  ],
  "update": [
    {
      "id": 0,
      "code": "string",
      "amount": "string",
      "date_created": "2025-01-01T00:00:00Z",
      "date_created_gmt": "2025-01-01T00:00:00Z",
      "date_modified": "2025-01-01T00:00:00Z",
      "date_modified_gmt": "2025-01-01T00:00:00Z",
      "discount_type": "fixed_cart",
      "description": "string",
      "date_expires": "2025-01-01T00:00:00Z",
      "date_expires_gmt": "2025-01-01T00:00:00Z",
      "usage_count": 0
    }
  ],
  "delete": [
    0
  ]
}

Response

Returns 200 with an object. Read it in later steps with {{batchCoupons.response.data.<field>}}.

createarray<object>
idinteger

Unique identifier for the resource. read-only

codestring

Coupon code. mandatory

amountstring

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

date_createdstring (date-time)

The date the coupon was created, in the site's timezone. read-only

date_created_gmtstring (date-time)

The date the coupon was created, as GMT. read-only

date_modifiedstring (date-time)

The date the coupon was last modified, in the site's timezone. read-only

date_modified_gmtstring (date-time)

The date the coupon was last modified, as GMT. read-only

discount_typestring

Determines the type of discount that will be applied.

One ofpercentfixed_cartfixed_productDefault "fixed_cart"

descriptionstring

Coupon description.

date_expiresstring (date-time)

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

date_expires_gmtstring (date-time)

The date the coupon expires, as GMT.

usage_countinteger

Number of times the coupon has been used already. read-only

individual_useboolean

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

Default false

product_idsarray<integer>

List of product IDs the coupon can be used on.

excluded_product_idsarray<integer>

List of product IDs the coupon cannot be used on.

usage_limitinteger

How many times the coupon can be used in total.

usage_limit_per_userinteger

How many times the coupon can be used per customer.

limit_usage_to_x_itemsinteger

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

free_shippingboolean

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

Default false

product_categoriesarray<integer>

List of category IDs the coupon applies to.

excluded_product_categoriesarray<integer>

List of category IDs the coupon does not apply to.

exclude_sale_itemsboolean

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

Default false

minimum_amountstring

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

maximum_amountstring

Maximum order amount allowed when using the coupon.

email_restrictionsarray<string>

List of email addresses that can use this coupon.

meta_dataarray<object>5 fields

Meta data.

updatearray<object>
idinteger

Unique identifier for the resource. read-only

codestring

Coupon code. mandatory

amountstring

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

date_createdstring (date-time)

The date the coupon was created, in the site's timezone. read-only

date_created_gmtstring (date-time)

The date the coupon was created, as GMT. read-only

date_modifiedstring (date-time)

The date the coupon was last modified, in the site's timezone. read-only

date_modified_gmtstring (date-time)

The date the coupon was last modified, as GMT. read-only

discount_typestring

Determines the type of discount that will be applied.

One ofpercentfixed_cartfixed_productDefault "fixed_cart"

descriptionstring

Coupon description.

date_expiresstring (date-time)

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

date_expires_gmtstring (date-time)

The date the coupon expires, as GMT.

usage_countinteger

Number of times the coupon has been used already. read-only

individual_useboolean

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

Default false

product_idsarray<integer>

List of product IDs the coupon can be used on.

excluded_product_idsarray<integer>

List of product IDs the coupon cannot be used on.

usage_limitinteger

How many times the coupon can be used in total.

usage_limit_per_userinteger

How many times the coupon can be used per customer.

limit_usage_to_x_itemsinteger

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

free_shippingboolean

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

Default false

product_categoriesarray<integer>

List of category IDs the coupon applies to.

excluded_product_categoriesarray<integer>

List of category IDs the coupon does not apply to.

exclude_sale_itemsboolean

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

Default false

minimum_amountstring

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

maximum_amountstring

Maximum order amount allowed when using the coupon.

email_restrictionsarray<string>

List of email addresses that can use this coupon.

meta_dataarray<object>5 fields

Meta data.

deletearray<object>
idinteger

Unique identifier for the resource. read-only

codestring

Coupon code. mandatory

amountstring

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

date_createdstring (date-time)

The date the coupon was created, in the site's timezone. read-only

date_created_gmtstring (date-time)

The date the coupon was created, as GMT. read-only

date_modifiedstring (date-time)

The date the coupon was last modified, in the site's timezone. read-only

date_modified_gmtstring (date-time)

The date the coupon was last modified, as GMT. read-only

discount_typestring

Determines the type of discount that will be applied.

One ofpercentfixed_cartfixed_productDefault "fixed_cart"

descriptionstring

Coupon description.

date_expiresstring (date-time)

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

date_expires_gmtstring (date-time)

The date the coupon expires, as GMT.

usage_countinteger

Number of times the coupon has been used already. read-only

individual_useboolean

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

Default false

product_idsarray<integer>

List of product IDs the coupon can be used on.

excluded_product_idsarray<integer>

List of product IDs the coupon cannot be used on.

usage_limitinteger

How many times the coupon can be used in total.

usage_limit_per_userinteger

How many times the coupon can be used per customer.

limit_usage_to_x_itemsinteger

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

free_shippingboolean

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

Default false

product_categoriesarray<integer>

List of category IDs the coupon applies to.

excluded_product_categoriesarray<integer>

List of category IDs the coupon does not apply to.

exclude_sale_itemsboolean

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

Default false

minimum_amountstring

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

maximum_amountstring

Maximum order amount allowed when using the coupon.

email_restrictionsarray<string>

List of email addresses that can use this coupon.

meta_dataarray<object>5 fields

Meta data.

json
{
  "create": [
    {
      "id": 0,
      "code": "string",
      "amount": "string",
      "date_created": "2025-01-01T00:00:00Z",
      "date_created_gmt": "2025-01-01T00:00:00Z",
      "date_modified": "2025-01-01T00:00:00Z",
      "date_modified_gmt": "2025-01-01T00:00:00Z",
      "discount_type": "fixed_cart",
      "description": "string",
      "date_expires": "2025-01-01T00:00:00Z",
      "date_expires_gmt": "2025-01-01T00:00:00Z",
      "usage_count": 0
    }
  ],
  "update": [
    {
      "id": 0,
      "code": "string",
      "amount": "string",
      "date_created": "2025-01-01T00:00:00Z",
      "date_created_gmt": "2025-01-01T00:00:00Z",
      "date_modified": "2025-01-01T00:00:00Z",
      "date_modified_gmt": "2025-01-01T00:00:00Z",
      "discount_type": "fixed_cart",
      "description": "string",
      "date_expires": "2025-01-01T00:00:00Z",
      "date_expires_gmt": "2025-01-01T00:00:00Z",
      "usage_count": 0
    }
  ],
  "delete": [
    {
      "id": 0,
      "code": "string",
      "amount": "string",
      "date_created": "2025-01-01T00:00:00Z",
      "date_created_gmt": "2025-01-01T00:00:00Z",
      "date_modified": "2025-01-01T00:00:00Z",
      "date_modified_gmt": "2025-01-01T00:00:00Z",
      "discount_type": "fixed_cart",
      "description": "string",
      "date_expires": "2025-01-01T00:00:00Z",
      "date_expires_gmt": "2025-01-01T00:00:00Z",
      "usage_count": 0
    }
  ]
}

Need more? See the WooCommerce guide for connection setup and behaviour shared by every action.

Was this page helpful?