You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Properly cancel orders and free up coupons

Accepted answer
83
Views
5
Comments
edited Mar 29, 2023 7:41PM in Commerce 5 comments

Summary:

How to properly cancel an order via /ccadmin API and free up coupon associated with it

Content:

Hi,

We're trying to cancel an order via PUT /ccadmin/v1/orders/{id} (our ERP rejected it) to free up a coupon which has been used on it. Here's what we've done so far:

1. set "paymentGroups"/"state" to "SETTLE_FAILED";

2. set order "state" to "REMOVED".

Still, the coupon remains unusable - actually we're sure this is not the proper way to do it. What else can be done? Giving another coupon to the shopper is not an option yet, ideally we should be able to cancel his order (and learn how to properly cancel orders should we need to :) and ask him to use the same coupon again.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!