Which Paypal API for preapproved payments? - paypal

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.

Related

Integrating Paypal Payment and Invoicing APIs

I have been manually issuing invoices to charge my clients for services using Paypal.
Now I am creating an interface to allow them to purchase the services automatically on my website.
I also want to show them a history of their purchases. However, I cannot show a history of paid invoices using the Transaction Search API; I need to use the Invoicing > Search Invoices API.
I have used the Paypal Payments API to manage the payment side of new products, which now correctly produces an itemised transaction and allows the customer to checkout. But this does not produce an invoice.
How can I simultaneously produce an invoice (i.e which can be retrieved by the Invoicing API to show previous payments) and allow the customer to pay it? It seems like the Invoicing API works around the idea of sending an invoice to client by email, but this is unnecessary. I want them to pay it immediately (and already have the Payment API setup for this).
So what would a useful workflow be?: Use my Paypal Payment API to receive and authorise the payment, and on authorisation, use the Invoicing API to produce an invoice which reflects this and then updates the invoice status to paid? Or am I missing something easier here?
The Invoicing API is not meant to be mixed or used with any other API. It is for generating invoices to be sent by email or in link form.
General ecommerce payment processing (without invoice links) is entirely separate, there is no crossover. You should ensure you are using the current v2/checkout/orders API to receive new payments, not older v1 APIs.
As far as displaying a list of previous purchases to your customers, you shouldn't reply on PayPal for this (except perhaps in the case of invoices since this is part of the point of offloading invoice management to PayPal). But for normal web purchases, PayPal is not a database -- it is a payment processing service. Keep track of all your own order information, and simply store PayPal transaction IDs when they complete for your own accounting records -- but the ID you reference with the customer should be your own unique order ID, which you can pass to PayPal in your purchase_units[0].invoice_id when you create an order for checkout approval.

Some questions about billing plans & agreements REST API

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/

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 REST API: add a payment experience to a billing agreement

If you want to customise your store when using the payment endpoint, that's fine, you can create a payment experience and then pass the payment_experience_id to the payment endpoint.
But what if you're using the billing agreement endpoint? I notice there's no payment_experience_id field, so how do you customise the store? Can't find anything about this in the API docs.
In the PayPal standard & express payment payment reference docs, e.g.:
https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
... see the fields PAGESTYLE for the direct equivalent of the REST payment experience (a group of setting that you set up at an account level and apply to the payment experience as a set), or the fields HRDIMG, PAGEFLOWCOLOR, CARTBORDERCOLOR, LOGOIMG, and BRANDNAME fto override any single piece of the experince for a particular payment.

Feature supported list for PayPal Rest API for non US

Looking forward for PayPal's new RestAPI.
We have already started building and finding cool things as we go. Since its an on going process of releasing features it is still not clear sometimes what is supported and what is not. I am listing down my doubts for what is supported for Non-US developers.
Merchants cannot accept payments by taking credit card number.
Subscription / recurring payment possible?
For Pay with PayPal method, does Paypal offer to accept payments form non Paypal users? Like pay directly using card on Paypal page?
Do mention if I missed anything.
To register for a Live set of REST credentials you are required to provide:
U.S. Business owner Social Security Number, date of birth, and other personal details.
U.S. Business Tax ID (EIN, ITIN) and other business information.
Subscription / Recurring Payments are not yet available through the REST process. There are Reference Transactions allowed through "Vault" though.
There isn't an equivalent to "SOLUTIONTYPE" for the REST process yet but hopefully soon.