• Resolved Synfynal

    (@srdjan121)


    Hello WooCommerce Support Team,

    I’ve noticed an inconsistency with the coupon REST API. When a coupon is applied to an order, the usage count is correctly updated. However, the date_modified field in the REST API response does not change accordingly—it continues to return the previous modification date, even though the usage count has been incremented.

    This behavior feels inconsistent, since the resource has clearly been modified (usage count updated), but the modification timestamp does not reflect that change.

    Could you clarify whether this is the intended behavior, or if it’s a bug? Are there any plans to update the REST API so that date_modified reflects changes to usage count as well?

    Thank you for your help!

    Best regards,
    Srdjan

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @srdjan121,

    I see why this feels confusing, you are correctly observing that the coupon resource is changing in practice when the usage count increments, and it makes sense to expect the modification timestamp to reflect that change. I am glad you raised it, and I am keen to help clarify how this works.

    At the moment, this is the intended behaviour in WooCommerce. When a coupon is used, WooCommerce updates internal meta related to usage count, but it does not update the post modified or date_modified value for the coupon itself. From the REST API perspective, date_modified is only updated when the coupon post is explicitly edited, for example changing the amount, expiry date, restrictions, or other coupon settings in the admin.

    Because of that distinction, usage count changes are treated as operational data rather than a content update, so they do not trigger a modification timestamp change in the REST API response.

    If your integration relies on detecting coupon usage changes, the recommended approach is to monitor the usage_count field directly, or to hook into order related events instead of relying on date_modified for this specific case. You can also review the coupon data structure here to see which fields are expected to change via the API: https://woocommerce.github.io/woocommerce-rest-api-docs/#coupon-properties

    If you would like this behaviour to change in the future, the best next step is to open a feature request so the product team can evaluate updating date_modified when usage data changes. That feedback is reviewed by the WooCommerce developers: https://woocommerce.com/feature-requests/woocommerce/.

    Plugin Support thelmachido a11n

    (@thelmachido)

    It’s been a while since we heard back from you for this reason we are closing this thread. 

    If WooCommerce has been useful for your store and you appreciate the support you’ve received, we’d truly appreciate it if you could leave us a quick review here: 

     https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/#new-post

    Feel free to open a new forum topic if you run into any other problem. 

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.