Search code examples
paypalpaypal-subscriptions

PayPal Subscription: Refund full or partial


I am using Paypal rest API on my site. Till now I have implemented flow for regular order -

  1. Create checkout session
  2. Approve Payment by Payer
  3. Capture Payment
  4. Refund against captured payment

For subscription, I have implemented -

  1. Create a checkout session with a subscription
  2. Approve subscription by the payer

But after this, I couldn't get any further to capture any payment even from webhook, against which I could initiate a refund. There is an API for subscription capture, but it only adjusts the outstanding balance with the current payment. Also, the API doesn't return any object that might carry any capture info to work on a refund.

Does PayPal have any way to refund against payments on recurring subscriptions?


Solution

  • Approved subscriptions will charge automatically on their schedule. That is the point of subscriptions.

    To be notified of subscription payments, register a listener endpoint for the webhook event PAYMENT.SALE.COMPLETED.

    To refund subscription payments, full or partially, use the rel:refund link within any such sale object to refund it. See the v1/payments/sale/.../refund API call.