question

jms avatar image
jms asked David Marginian Deactivated commented

Overcharging on Ecommerce API if order has discounts

HI

We have an overcharging issue with customers when an order is charged for using the e-commerce API if a discount is added to that order.

We use the endpoints to process orders:

OrderPlacing: https://api.clover.com/v3/merchants/{merchantId}/orders
AddDiscount: https://api.clover.com/v3/merchants/{merchantId}/orders/{orderId}/discounts
TokenizedCharge: https://scl.clover.com/v1/orders/{orderId}/pay

A sample request-response for the TokenizedCharge is as follows (sandbox, also happens on live):

Request (note that we are sending the correct value to be charged; refer bill below):

{"amount":515,"currency":"USD","source":"clv_1TSTSQRmMHET7Y1GcwDq7exo"}

Response:

{"id":"SBGP2SEECQ5JW","object":"order","amount":578,"tax_amount":28,"currency":"USD","charge":"RC4CGNHNR46YP","first6":"411111","created":1594282068000,"ref_num":"019100500860","auth_code":"OK5734","items":[{"parent":"1D8RRXCGXYM2J","amount":550,"description":"Chestnut Rose Cassis Tart"}],"source":{"address_line1_check":"unavailable","address_zip":"12345","address_zip_check":"pass","brand":"VISA","exp_month":"12","exp_year":"2020","last4":"1111"},"status":"paid","status_transitions":{"paid":1594282073817}}

Notice that the response amount is higher that the charge request amount.

Also note that the tax amount in the response is incorrect. Even though we don't specify it, when the discount is applied, it gives a wrong value (the tax showing up in clover orders is 25 cents but here it is 28 cents)

This incorrect tax/amount does NOT happen if there is no discounts in the order.

The overcharged scenario is clearly visible in the bill as well:

Please help us figure this issue out.

e-commerce apiTaxesDiscounts
clover-bill.png (20.1 KiB)
2 comments
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·

I just pinged the ecomm team about this.

1 Like 1 ·
iliaskarim avatar image iliaskarim commented ·

Thank you for flagging the issue @jms.

1 Like 1 ·
David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

It looks like this is a bug on our end. I have created an issue for further investigation.

As a workaround, we believe you can specify the order total when creating the order, that way it doesn't have to be computed by ecomm. Please see - https://docs.clover.com/docs/working-with-orders#section-calculating-order-totals for how to calculate the order total.

15 comments
10 |2000

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

jms avatar image jms commented ·

We tried your workaround and it worked. Sadly we can't use that solution.

An unpaid order shows up in the clover online dashboard if the total is set (regardless of state) since it automatically goes to OPEN state.

The problem is now merchants can see an order which may not be paid for (say user closes the payment form). Now the merchant will actually go ahead and start preparing the order since paying later when customer comes to collect is also an option.

The result is an unpaid order has been prepared which the user has actually decided not to proceed with.

  • Do you have any other solution?
  • Could you please provide an ETA on the actual fix on clover e-commerce API? (this is impacting heavily on our merchants orders who use promo discounts)
0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ jms commented ·

I will get in touch with the ecomm team tomorrow morning and see if they have any additional workarounds.

0 Likes 0 ·
jms avatar image jms David Marginian ♦♦ commented ·

Hi @David, a kind reminder on this

0 Likes 0 ·
Show more comments
Show more comments
a-leafiy avatar image
a-leafiy answered David Marginian Deactivated commented

Hi, I still got this problem when I apply a discount to a ecomm order. The discount does not apply to the total payment.

1 comment
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·

The original question is about the method of the discount calculation, not discounts not being applied. If you want some assistance you will need to describe the problem and provide the request you are making and some sample order ids for us to look at. Please do that in a new post as your question doesn't appear to be related to this thread.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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