Discounts via PayPal REST API sample?

2019-07-04 12:32发布

问题:

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?

回答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)