What is PayPal API
A PayPal API is an interface which serves as an intermedium between a server and a client program. In our case, the server program which provides API to the third party developers is PayPal. A client is a program which developers create basing on the PayPal API for making payments on a website, refunding sales, looking up details of transactions, setting up a billing plan, storing a credit card’s history secure, etc. PayPal is a REST API, it uses HTTP methods to be easily incorporated into the web and mobile apps.
How to get PayPal API key, credentials, and signature
Bear in mind that working with PayPal API is available only if you have a PayPal Premier, Business or Website Payments Pro account. First of all, in this tutorial you’ll have to create a business account.
Create PayPal business account
Step 1. Sign up on PayPal.
Step 2. You’ll have to give information about yourself first: your first name, last name, business email and password.
Step 3. After that, you should give details about the business: its legal name, phone number and address.
Pay special attention to the fact that PayPal is available for certain provinces and countries around the world.
They are: Alberta, British Columbia, Manitoba, New Brunswick, NewFoundland and Labrador, Northwest Territories, Nova Scotia, Nunavut, Ontario, Prince Edward Island, Quebec, Saskatchewan, Yukon.
If your business doesn’t belong to any of these provinces, you should read a PayPal FAQ for International Developers. In short, if you are a non-US or non-UK developer, you can use their NVP/SOAP APIs.
Step 4. Further, you should select your business type from the following options: Individual, Sole Proprietorship, Partnership, Corporation, Private Company, Public Company, Nonprofit organization, Government entity.
Then, describe your business in greater detail and answer several questions:
Click “Submit”. Then, tell about yourself.
Step 5. After that, you’ll have to choose the purpose of your PayPal account. You can use it for requesting or sending money, sending customers an invoice or offering PayPal checkout on the website. Choose Set Up Online Payments. Now, you’re halfway before getting your PayPal key.
Get PayPal API credentials
Step 1. When you’ve created a business account, go to the PayPal Developer page and log in to the dashboard.
Step 2. After signing in, you’ll be able to get a personal PayPal API key. For this, go to the “My Apps & Credentials” section and click “Create App”
Step 3. Enter an app name and click “Create” once again. You’ll get a Client ID, a name of a Sandbox account and a “Secret”.
Get PayPal API Signature or Certificate
Our next step is to generate either PayPal API Signature credentials or API Certificate credentials. If you hesitate which one to choose, here’s our explanation of their difference:
- PayPal API Signature includes an API Username, API Password, and Signature, which does not expire.
- API Certificate credentials include an API Username in PayPal, API Password, and Certificate, which expires automatically after three years.
Keep in mind, that for getting API credentials in PayPal you should have a verified email address.
This is how you should get API Signature or Certificate credentials for your PayPal account:
- Log in to your PayPal Sandbox account, use your business profile data.
- Click the “Settings” icon.
- Click Account access under “Account & Security” on the left of the page.
- In the “API access” section, click “Update”.
- Click “Manage API credentials” under “NVP/SOAP API integration”.
- Select one of the following options. Request API Signature – Select for API Signature authentication. Request API Certificate – Select for API Certificate authentication.
- Click “Agree” and “Submit”.
- That’s it! After that, PayPal will generate your API credentials.
PayPal API examples
PayPal offers several REST APIs and breaks them down into three categories:
- Live – they are recently released, fully supported and available to new subscribers.
- Limited release – fully supported API, available on specific markets.
- Deprecated – archived but totally supported APIs.
You may find the most popular examples below.
Payouts API
This kind of API is used to send money to multiple PayPal recipients. It’s perfect for those who want to send rewards, rebates and commissions. Recipients will have to tell their email address, mobile number or Payer ID.
Payments REST API
The most widespread and functional kind of API. It is used to securely and smoothly accept online payments on the websites and in apps. It allows to accept payments immediately or postpone them, show details for completed transactions, make full or partial refunds.
PayPal Express Checkout API
Smart PayPal payment buttons offer users the most relevant, simple and secure checkouts. You can easily customize PayPal buttons, and there’s an opportunity to add alternative payment methods such as Venmo or credit card. If you add it to your website or application, it works in the following manner: first, a checkout popup window appears and offers a user to log in to PayPal. Secondly, after the shopper approved the payment, the PayPal Orders API will finalize the transaction.
Subscriptions API
You are allowed to launch a process of recurring PayPal payments for physical goods and services, as well as for digital products. There’s an opportunity to define a fixed amount of money to pay and graduated-based plan.
PayPal Disputes API
In case there’s a problem, which occurred on the PayPal side, they offer to open a dispute and communicate with their support team.
PayPal Recurring Payments API
This API example is deprecated, although the PayPal team fully supports merchants who still use it. Recurring payments API is an analogue of Subscriptions API, but it performs less functionality.
Invoice API
This API example is deprecated, although the PayPal team fully supports merchants who still use it. Recurring payments API is an analogue of Subscriptions API, but it performs less functionality. To track invoice payments you can use webhooks – special HTTP callbacks that receive notification messages for events.
PayPal offers an API executor which allows developers to test and integrate products before launching. Use it to check the work of any product you’ve chosen.
PayPal integration on a website
To get a PayPal button on a website, you’ll have to launch Engineering and Business workflows at the same time.
First, build your own API solution as was described in this article before. Secondly, set up a sandbox to test the product (as a developer) and apply for a Live account. A Live account will integrate all the functions of PayPal. Integrate and test the product you’ve created. After everything’s fine, sign a contract for getting a Live account. Prepare everything to go live, check properly and, finally, launch your PayPal API based solution!
If you don’t want to spend a lot of time on passing all those steps, take advantage of customizable, beautiful and easy-to-integrate PayPal button by Elfsight. Just create a business account on PayPal and be ready to embed a button on a website.
One of the most popular API examples is PayPal Express Checkout which uses NVP and SOAP Integration method. It is deprecated, and although PayPal still supports it, the more recent Checkout API uses new and enhanced features.
PayPal API limits and pricing
If you get money from a PayPal account, you should pay a fee of certain percentage plus a fixed fee based on the currency. If you use PayPal, you don’t have to pay any monthly or termination fees in 2020. Below, you’ll see how much using PayPal will cost in several countries:
If the money you receive come from a PayPal account in: | You should pay |
Canada | a fee of 2.9% of the transaction amount plus $0.30 CAD |
USA | a fee of 3.7% of the transaction amount plus $0.30 USD |
Europe | a fee of 3.9% of the transaction amount plus €0.35 EUR |
Russia | a fee of 3.9% of the transaction amount plus 10 RUB |
Brazil | a fee of 3.9% of the transaction amount plus 0.60 BRL |
Mexico | a fee of 3.9% of the transaction amount plus $4.00 MXN |
Singapore | a fee of 3.9% of the transaction amount plus $0.50 SGD |
Check the full list of countries and fees on the PayPal Payments Standard page.
Talking about daily limits of how many times you can reach PayPal API, it’s possible to make as many calls as you want. Although, we’d recommend avoiding hitting API too many times.
PayPal documentation
PayPal API documentation is extremely large due to the fact that it describes the processes of payments all around the world. To work with it, you should choose a type of account: Developer, Personal or Business. Secondly, select a kind of API you’d like to use in the project (we have enumerated them before). Then, find a page with the needed kind of API, study methods and objects offered by PayPal, and, finally, test what you get in a developer’s Sandbox.
PayPal API changes
PayPal has made several API types deprecated, although still supports them. Getting acquainted with numerous changes in PayPal API can be helpful in studying the process of its integration on a website.
2018 changes: Horizontal button layout started to be used by default; the code samples in the Payouts API Integration were updated; the recommended and default notations for the small Smart Payment Button were removed.
2019 change: Code samples were added to the currency conversion features, as well as a list of country exclusions.
2020 change: The handling recurring payments were updated. Users now have to create recurring payments rather than up to 10 at a time.
FAQ
Should I register as a developer if I can access the sandbox without logging in to the developer's website?
It isn’t necessary. But if you want to have access to some really cool features, such as creating a pre-configured test account, access the REST API credentials and transaction dashboard, you should do it.
Is it possible to restore the history of my transactions with the NVP/SOAP APIs, if I’m currently using the REST API.
Unfortunately, no, but specially for this case, PayPal developers have introduced TransactionSearch API.
Should I leave strings empty if the values are optional?
The handler shouldn’t be left with empty strings, if you don’t want to fulfill the optional fields, simply don’t add them.
Will all the PayPal NVP/SOAP APIs be updated to REST?
PayPal is currently improving their services, and NVP APIs, belonging to the older generation, will be soon updated.
Conclusion
Reading all the PayPal documentation can take hours, because you’ll have to organize the process of getting and selling payments through the website or application. Another problem is that PayPal is currently moving from older NVP/SOAP APIs to the REST one, which means twice as much documentation as was earlier.
Today, it’s possible to place an easy customizable Elfsight PayPal button on a website without coding and reading tons of documentation pages. Simply register your business account on a PayPal website – the process is in our tutorial – and create the widget with amazing functionality. Try it now!