question

ondrej avatar image
ondrej asked ondrej answered

Unable to delete a discount: ClientException: status code: 400

Hello,

I am adding a discount in the Register app during the custom tender processing. Sometimes I need to delete it after creation (during the same custom tender processing). But that sometimes (I would swear that It was once working) fails with:

com.clover.sdk.v1.ClientException: status code: 400 Order{json='{"total":716,"clientCreatedTime":1465334319000,"createdTime":1465334320000,"modifiedTime":1465334325000,"manualTransaction":false,"state":"locked","currency":"USD","id":"YV9AP714CK1BE",.....

I am adding the discount using:

orderConnector.addDiscount2

and I am deleting it using:

orderConnector.deleteDiscounts(orderId, Arrays.asList(new String[]{discountId}));

Don't you have any pointer to solve this error please? Should deleteDiscounts work?

Thank you, Ondrej

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

ondrej avatar image
ondrej answered

It seems that the problem is with the order state locked. Once it is in this state it is not possible to delete a discount.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community