question

webforte avatar image
webforte asked David Marginian Deactivated edited

Order discount not working using rest api

Hi,
I am able to apply a discount on an order but when we make payment its takes full payment of the order, not the remaining amount.
Also when we are adding the remaining amount in pay API then able to pay the pending amount but the order status shows partially_paid.

Please refer to this screenshot:- https://prnt.sc/245regu
ex.

If a Line item's price is $15 and applied a discount coupon of $5 then the user should pay only $10.
But order-pay API charges the user $15.

Thanks

OrdersDiscounts
10 |2000

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

webforte avatar image
webforte answered

https://api.clover.com/v3/merchants/6ZA5DNC74X5S1/orders/XTQK4G3W583M8/discounts
Body json - { "discount":{ "id":"X2FF8YFS0G48C"},"amount":-1000,"name":"testing"}


Order ID - XTQK4G3W583M8

Order Receipt - https://prnt.sc/249ztz1

10 |2000

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

webforte avatar image
webforte answered David Marginian Deactivated converted comment to answer

When paying for an order which has a discount coupon applied using this API
https://scl.clover.com/v1/orders/XTQK4G3W583M8/pay

{ "amount":499,"ecomind":"ecom","source":"clv_1TSTS4YVkU6TCArfCPWaaZt7" }

If the amount parameter is set for the remaining amount then the payment status shows as "Partially Paid"

But if the amount parameter is removed from body JSON then the user gets charged for the full amount of $14.99.
{ "ecomind":"ecom","source":"clv_1TSTS4YVkU6TCArfCPWaaZt7" }


10 |2000

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

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