Some questions about billing plans & agreements REST API - paypal

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:
Is this flow correct?
To redirect customer for approving payment we need to make four requests to PayPal API servers, is it normal?
Should I create and activate a billing plan for every customer or I can use one plan for all customers?
If so can I create the plan in the merchant's profile page or I can do it only programmatically?

Let me see if I can answer your questions and provide some samples.
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.
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.
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.
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:
Billing plans: https://developer.paypal.com/docs/api/quickstart/create-billing-plan/
Billing agreements: https://developer.paypal.com/docs/api/quickstart/create-billing-agreement/
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/

Related

Pay as you go with Paypal

I want to implement a pay as you go with Paypal, as I read the subscriptions API we need to create a plan and product, and as I understand it, it works based on the regular payments which obviously we don't want that we want if the user's budget is below a certain amount we recharge the user by a fixed amount again, can anybody guide me how to approach and implement pay as go using Paypal?
You are correct, subscriptions bill on a regular schedule whereas what you are describing is the ability to bill an arbitrary amount at any time.
That feature is called "reference transactions", or sometimes "billing agreements". It is not enabled for PayPal business accounts by default. To request the feature, the owner of the PayPal account should contact PayPal's general business support (note: not technical support) and explain the business need for this reference transactions feature.
If it's approved for the account, PayPal can then guide you on which API integration to use; potentially something like the newest v2/vault.

Recurring payment on PayPal Express Checkout

Im trying set up recurring payment on my site by using Paypal Express Checkout. I did read through the official docs and I couldnt find anything useful related to recurring payment.
https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/add-paypal-button/
Im just wondering does Express Checkout support recurring payment? If so, how can I achieve that or Where can I get some good example to start with?
Thank you for your help in advance. Much appreciated
Cheers
We have a similar issue before. You might wanted to take a look at this thread.
I'm trying to understand the use case here. When you say recurring payment for express checkout,it has to be something a customer is buying regularly like restocking an item, in that case it's not an express checkout, it's a recurring purchase by a returning customer. They must have opted to restock at a regular interval like every 30 days, 2 months etc. They also must be registered users on your website.
So your logic must include — Checking all the customers who have set up an automatic purchase for an item.
—Check their frequency of purchase and charge them for the amount of the item at that frequency.
—For this purpose PayPal has a REST API :
This is the accurate place to look for to implement PayPal recurring payments:
https://developer.paypal.com/docs/api/payments/#payment_create
In case they also allow you to authorize payments through the following API
https://developer.paypal.com/docs/api/payments/#authorization
you could use it as well.
But at least this narrows down your choices in terms of regular payment authorization.
This API will allow you to request PayPal services to authorize payment on a regular basis for that customer. You will still have to have your own logic to check the 'subscription' for your products and the intervals.
—The CreateRecurringPaymentsProfile API Operation (NVP) at the link below looks to be for personal payments. For example something an Inventory Management System will do.
https://developer.paypal.com/docs/classic/api/merchant/CreateRecurringPaymentsProfile_API_Operation_NVP/
It's an API specific to adding recurring payments functionality.
Since you're a developer, PayPal Developers' Resources will answer any queries you have regarding the API functionality and usage. You will have to just know what to ask for. You are their B2B customer trying to understand their API system. You can also file a bug on their Developer portal if you're not getting proper answers.

PayPal Express Checkout with a mix of one time purchase and recurring payments through the REST API

I am using the PayPal REST API and would like to create a transaction that includes a combination of recurring and one-time payments in a single transaction.
According to the documentation for the NVP integration, it seems such a transaction is possible. However, I'm not sure how to accomplish the same using the REST API. I have searched the REST API documentation as well as the .NET SDK examples and cannot find an example of a transaction that uses a mix of recurring and one-time payments.
Our use case: We process transactions for downloadable software - most of the products are one-time purchases, but some of the products (such as anti-virus products) have a recurring billing component associated with them. As such, we need to process a single transaction where one of the items is a regular purchase, and the other is a part of a recurring plan. We plan to process these transactions using the "PayPal" payment method (i.e. not direct credit card). Specifically, we'll be using Express Checkout.
Any guidance would be much appreciated. Thank you!
Based on what you're doing about, here's what I think your best course of action might be:
When you have a user checking out that may have some multi-month subscriptions, and some single time subscriptions, you set up a new billing plan with each item to be purchased. For the subscriptions, you set up an entry that is set to multiple months, and for a single payment you set a single month payment (see https://developer.paypal.com/docs/integration/direct/create-billing-plan/ for an example of multiple entries).
Next, you need to execute that plan for the user via a billing agreement (https://developer.paypal.com/docs/integration/direct/create-billing-agreement/). Within the billing agreement you can set the start date to execute immediately, which should complete the checkout process for both billing orders right then.
Let me know if that works out for your scenario.

PayPal chained payments with variable recipients (from non-US business account)

I have a hard time finding clear answers to what's involved in implementing following case of chained payments using PayPal...
We are based in New Zealand, offering following types of accounts:
https://www.paypal.com/nz/webapps/mpp/compare-business-products
Currently, we have a Business Express Checkout account.
Our browser app allows users to set up product configurators. The configurators are then used by other users (consumers), to purchase configured products.
A. Simple payment case:
When consumers pay for the configured product, we are the primary recipient, and pass on the payment to the owner of the configurator, minus our revenue share %.
B. Complex Payment case:
Same as A, but multiple secondary recipients. We can't use parallel payments, because the multiple recipients need to be obfuscated.
For each case:
If not chained payments, what is the best fit PayPal option? Which API, if applicable?
Does the Express Checkout account support the required API? If not, which account type, available in New Zealand, does?
Which of the parties requires approval from PayPal? What type of approval? How long does the approval process take, and what affects its success?
Any other considerations when moving from the sandbox to the live setup?
What's the cost of the solution?
We'd obviously favour solutions that require minimal approval hassle, as we will be dealing with many configurators.
It seems like Adaptive Chained Payment is your best option.
Express Checkout support parallel payment but Express Checkout does not support chained payment.
You need a apply for an APP id if you're using Adaptive Payment. I could not answer how long it will took for them to approve.
Everything is the same when you're moving in Live. Just make sure your App has been approved, and the endpoint is change to Live.
The only cost is the PayPal fee's that PayPal collect for each transaction you made.

Which Paypal API for preapproved payments?

I'm trying to implement PayPal on a completely custom shopping cart and have been unable to figure out which API for recurring payments we need.
We ship a physical product every 2, 3, 4, 6 months so shipment and payment have to both happen together. In addition it must be easy for the user to change their shipment date - or add or remove items to their regular shipments without too much stress (either on their part or mine).
I've generally looked at Paypal's recurring billing as more suited to software based subscriptions and I don't think this is the API I need. I'd like to just bill the customer via a billing agreement and then initiate the shipment.
The way Skype does it seems to be ideal - they establish a billing agreement (shown in my PayPal account under 'My account > Profile > Pay List'
but I cannot seem to find that in the SOAP API document.
What is the API I need to create a billing agreement that I can trigger whenever I want. Can this be done with Express Checkout API ?
The API you are looking for is called reference transactions. This allows you to set up a billing agreement with a customer, get back a token, and then use that token to issue charges in the future. It can be done via the Express Checkout API.
You have to contact PayPal customer support to get this activated for your account before you can use it.