4
votes

I have some questions about subscription functionality using REST API. We have implemented recurring payments using "Express Checkout NVP/SOAP Integration" but for us it isn't optimal, because:

  • Webhooks easier and more usable then IPN messages;
  • We can't force customers to pay from PayPal balance.

That's why I want to rewrite it with REST API. I think the flow will be like:

  • User press button and we make the first request to get auth token;
  • Create billing plan;
  • Activate billing plan;
  • Create billing agreement;
  • Because of we're using PayPal payments here we redirect the customer to approve payment;
  • Execute billing agreement.

My questions are:

  1. Is this flow correct?
  2. To redirect customer for approving payment we need to make four requests to PayPal API servers, is it normal?
  3. Should I create and activate a billing plan for every customer or I can use one plan for all customers?
  4. If so can I create the plan in the merchant's profile page or I can do it only programmatically?
1
Be careful... at last check (approx 6 mos. ago), REST API requests were only able to see transactions that were created via the REST API. I know they've been working on fixing that, but it's requiring a major reworking on their backend. I wouldn't hold my breath.InteXX
Thank you! It's very useful.greg
YW... best of luck.InteXX

1 Answers

11
votes

Let me see if I can answer your questions and provide some samples.

  1. Yes, that flow is correct for the first request. If you already have a plan that you'd like to subscribe people to created, you can skip those billing plan steps. More on that below.
  2. For the REST APIs, yes that's the normal flow for PayPal. Think of the plan as setting up the architecture of the payment that you'd like to offer (such as a subscription plan for a service). You set this up once and then can subscribe many people to that same subscription plan using a billing agreement.
  3. If the details of the plan are the same for each person, then create one plan and then use a billing agreement for each person to subscribe them all to that same plan.
  4. I haven't seen an integration of this with the profile system, but it's an interesting idea. For the time being, as far as I know you'll need to do this programmatically.

I've also created some new quickstart guides on the site that should help through creating the billing plan and agreements:

I have a more practical example of this billing plan / agreement integration in a Slack bot payment sample, if that helps: https://developer.paypal.com/docs/api/service-integrations/slack-bot/subscribe/