question

kirank avatar image
kirank asked kirank commented

Sandbox returning 409 when paying an order (order_already_paid)

On Ecommerce Sandbox, we are seeing Order payments with Code: order_already_paid. When we looked at order details, there was no payment attached to this order. Even though this order has items, it shows as $0 on receipts. It was working for a while. We haven't heard of any reports in production yet. But maybe just we'll get it in few days.

Orderse-commerce api
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.

kirank avatar image kirank commented ·

I think we narrowed the case but unsure if it is our issue.

The case we observe this error is using /v3/orders, created a multiple lineItems of same value. One single line item has a lineItem-level discount. When the order gets created all the line items get the discount leading the whole order to go 0.

Specific POST payload in moderators only thread.


0 Likes 0 ·

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered kirank commented

I checked our logs and you are making the discount request for each line item on the order for both 089........768 and 0KW........70T so the behavior you are seeing is expected (the order total is 0 because you have fully discounted each line item).

3 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.

kirank avatar image kirank commented ·

But the POST data (attached above) we sent (for 0KW...70T) had discount set for only one line Item. Are you seeing differently? (Infact, I captured this postdata.txt from POSTman)

Also if all items are discounted, the receipts (https://sandbox.dev.clover.com/r/<orderid>#/>; should generally show each item and discount applied, right?

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

The "discounts" property in the post data you sent is not adding discounts (they have no affect). In order to add discounts you need to make a separate call per line item: https://docs.clover.com/docs/creating-custom-orders#adding-discounts-to-a-single-line-item. Our logs show this is exactly what you are doing (making a separate discount call per line item). Please take a closer look at the requests you are making.

0 Likes 0 ·
kirank avatar image kirank David Marginian ♦♦ commented ·
Thank you! What you mentioned was indeed true.
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