I'm trying to implement creating a subscription together with a discount of various duration given eg. 1 month, 2 months... I would also like to be able to set the amount of the discount.
I described my attempt below (it failed).
My first approach was to add a new phase to an existing plan in a catalog every time a discount did not exist. To achieve it, I fetched a catalog and added a new phase to the aimed product. Then, I deleted the product from the catalog and requested an update. Next, I fetched that catalog again, added the product and requested an update. Unfortunately, received an enigmatic error java.lang.IllegalStateException: Failed to de-serialize catalog for tenantRecordId='7'. I dug a little bit deeper and I found another error: java.lang.IllegalStateException: Failed to de-serialize catalog for tenantRecordId='7'.
Do you have any ideas what the cause was or how to fix it?