PayPal GURUS, i need a help, how to insert discount, i use REST API, may be some one, can show sample of code?Is there any way to send discount amount using PHP REST API?
Asked
Active
Viewed 2,331 times
1 Answers
1
At this moment, discounts are not supported in the REST payments API. Your best bet would be to compute the discounted amount on your end and use that as the subtotal as transactions.amount.details.subtotal (https://developer.paypal.com/webapps/developer/docs/api/#create-a-payment).
It is a planned future enhancement, and the invoicing apis do support discounts. (https://developer.paypal.com/webapps/developer/docs/api/#create-an-invoice)

Avi Das
- 1,725
- 1
- 13
- 19
-
See this to help. Use discount item lines with a negative amount. http://stackoverflow.com/a/9710690/511438 – Valamas Nov 27 '14 at 05:24
-
1@AviDas - Modifying the subtotal does not work because then the subtotal would not match the sum of the items in the item_list and paypal does not accept the transaction. – Evan de la Cruz Jun 08 '15 at 23:50
-
The link you provided is for the classic API. I am using an `item_list` inside of a payment's `transaction` (https://developer.paypal.com/docs/api/#transaction-object). Is this how you are doing it? – Evan de la Cruz Jun 09 '15 at 00:03
-
@Valamas-AUS - I've been trying this all day and it wasn't working. Must have been something botched on my end because it seems to be working now. Surely it is now working because I came here and said it wasn't :( Thanks! – Evan de la Cruz Jun 09 '15 at 00:07
-
PayPal REST can accept negative numbers. But cannot be -10. Has to be -10.00. I had problems with it, and it finally accepted when I made it -10.00 – Shawn Rebelo Jun 15 '18 at 01:47