How can I create woocommerce coupon with an expiration date using the rest api?

34 Views Asked by At

I'm trying to create a coupon via the woocommerce rest api: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-coupon

I can create coupons fine, but it seems the expiration date is always unset.

e.g. posting

{
  "code": "IGNME",
  "description": "IGNORE ME",
  "discount_type": "percent",
  "amount": 5,
  "date_expires": "2024-03-21T19:23:00",
  "date_expires_gmt": "2024-03-21T18:23:00"
}

Would return;

  ...
  "date_expires": null,
  "date_expires_gmt": null,
  ...

Checking on the site and there is no expiration date aswell. I tried date/time different formats but could not get a valid one.

How can I create woocommerce coupon with an expiration date using the rest api?

0

There are 0 best solutions below