Search code examples
flutterpaypalsubscriptionbillingrecurring-billing

How to set up a PayPal monthly payment with varying amounts


I'm currently building a Flutter application with an unusual subscription model. The idea is that depending on how the user uses the app, they would seamlessly be charged a different amount of money each month. I plan to use PayPal, and I've looked into their REST API, this is what I found: https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#definition-agreement_details

In this API endpoint, I'm assuming I can setup a Billing Agreement for each user of a specific amount_range, where once the user agrees to the payment, I'd be allowed to seamlessly charge each user a varying amount, within that range.

Am I correct in my conclusion? Would this be the best approach? if not, can you point me in the right direction for how to achieve what I'm trying to do?

I do not want to use the deprecated API. it's very important to be using REST API.

Thank you very much.


Solution

  • The Billing Agreement API you link to is deprecated.

    Using the current PayPal Subscriptions, if you create a unique Plan for each subscriber, you can update that Plan > 10 days before their next billing date, and they will receive an email notification of the new amount.

    You can use webhooks to keep track of active subscriptions and the last time you've been successfully paid for one.

    If you need an internal ID for reconciliation, set the parameter custom_id when you first create the subscription; its value will be returned in webhook events for that subscription.