I incorrectly configured a coupon and it charged a customer for the 2nd billing cycle of a monthly pricing plan (I had intended the coupon to work for 3 months). When I went to the customer’s subscription in the Wix dashboard, I could not see the coupon anywhere (I could see that it worked for the first month because there was a discount but there was no indication what coupon was used to create this discount). When I tried to get this information from a Velo API call, it is also not available, with one exception: if the last payment used the coupon, it is available (pricing.prices[0].price.coupon.code). But only the most recent payment is available. Previous payments are not available (at some point the Wix data stopped populating beyond one entry in the “cycles” array of the order object - only the last cycle is shown. Wix AI says this data is not available and I should write custom code to record it. Is it really the case that this information is discarded?
Hi markschroeder, sorry this cost you a billing cycle. From what you describe, the coupon only shows on the most recent payment in the order object, so earlier cycles can’t be rebuilt from the API after the fact. I haven’t verified that part against the API myself, so treat it as a pointer rather than a confirmed answer. For the charge that already went out, Wix support can check the billing record for that subscription and show which coupon was applied. Going forward, a webhook on the subscription payment event that saves the coupon code and cycle to a CMS collection will keep your own history.
This is what I ended up doing. I already had a hook for order cycle start (wixPricingPlans_onOrderCycleStarted) to log the event to a custom CMS. I just added a new field in the custom CMS for coupon code and then populated it if it was available in the event’s order.