Upload Excel File to Paypal for Payments
How to connect PayPal Residuum API to Google Sheets
PayPal is a well-known online payments processor that enables money transfers for companies and regular users alike.
Paypal's API enables users to create apps that interact with their accounts, automating operations that pertain to billing, invoicing, orders, payments and many other elements.
In this tutorial, you will larn how to connect the PayPal REST API to Google Sheets in 5 steps:
- Install the Apipheny Addition
- Create a Paypal Live App
- Get a Paypal Access Token
- Enter Paypal API into Apipheny
- Run the Paypal API request
Step one.) Install and open the Apipheny add-on for Google Sheets
Apipheny is an API connector for Google Sheets. You tin use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more than. There is a 30 day free trial included.
1.) Install Apipheny by opening the following link on desktop and so clicking the Install push in the Google Marketplace: https://apipheny.io/install
two.) Later on you've installed Apipheny, open a Google Sheet and and so click on Add-Ons or Extensions selection in the menu at the acme.
In the dropdown listing you should run across Apipheny.
Click Apipheny > Import API to open up the Apipheny sidebar in your Google Sheet.

Stride 2: Create a PayPal Alive App
To use the PayPal REST API, y'all have to create a dedicated app in your Paypal account. You lot can create either a sandbox app, used for testing, or a alive app that uses the actual information in your account.
In this tutorial nosotros will utilise a alive app, to show you how y'all can import actual live information from Paypal into your Google Sheets. Here'south the steps:
1.) Log in to your PayPal Developer Dashboard, using the aforementioned log in information as your Paypal account. If you don't yet accept a Paypal account, you can create one by clicking on the Sign Up push button:
2.) Once logged in, click on My Apps & Credentials and toggle the switch to the Live selection, to starting time creating a live app (Paypal may prompt you to upgrade your account to a business account):
3.) Later clicking "Alive", ringlet downward, and in the REST API apps section, click Create App. And then type a name for your app and so click Create App over again:
iv.) Your new app's details page will open up and brandish the app's identifying information. Copy and save the Client ID and Secret for your app somewhere prophylactic and go set to utilise them in the next stride.
five.) Review your app'southward information and for the purposes of this example, brand sure that the Transaction Search option is checked, before saving your app:
Stride 3: Get your Paypal API Admission Token
In society to admission most PayPal REST API endpoints, you will need an access token. To obtain an access token, you'll either need to do a ringlet command or utilise the Postman app.
Click here for instructions on using the Postman app.
Here's the instruction for whorl:
To make a ringlet command, laissez passer your OAuth 2.0 credentials through a dedicated PayPal Residuum API control, using the cURL command line tool (control prompt window for Windows Os or a terminal for Mac OS):
curlicue -v https://api.paypal.com/v1/oauth2/token \ -H "Accept: application/json" \ -H "Take-Language: en_US" \ -u "CLIENT_ID:SECRET" \ -d "grant_type=client_credentials"
Note: For Mac Bone yous may demand to use single quotes ( ' ) instead of double quotes ( " ).
Use the same values for Client ID and for Secret that you lot copied in the previous stride, into the CLIENT_ID and Surreptitious placeholders you see higher up.
Note: If the token/central that you generate has an expiration fourth dimension, you will need to complete this same procedure again to get a new token when the old one expires.
Y'all can also use other control-line tools besides gyre, but for those, you'll have to set up the Take header to application/ten-www-grade-urlencoded instead of application/json.
In response to this command, the PayPal authorisation server will return your access token in the access_token field of the JSON result:
{ "telescopic": "<scope>", "access_token": "<Access-Token>", "token_type": "Bearer", "app_id": "<App-Id>", "expires_in": 31349, "nonce": "<nonce>" }
Re-create the access token somewhere rubber considering you lot volition demand it in the next step.
- Click here to download coil
- Click here to read well-nigh this topic in the Paypal API documentation
Note: This JSON issue likewise contains an expires_in field, containing the number of seconds after which your newly-retrieved access token expires. For instance, admission tokens with a value of 3600 in the expires_ field will expire in 1 60 minutes from the time the response was generated, pregnant y'all will demand to get a new access token if information technology's been longer than an hour.
Step four: Enter your PayPal API URL into the Apipheny Add-on
Dorsum in the Google Sheet, at the elevation of Apipheny addition, select your HTTP method (Become or Mail) as required by your API endpoint. For this instance nosotros are using Become.
Next, enter your URL for a PayPal Residual API endpoint into the Apipheny addition, where information technology says API URL Path, followed by whatever GET parameters required for your query.
Here'due south a listing of available Paypal API parameters you tin use.
For this example, nosotros volition employ the Transaction Search API to go your PayPal business relationship'due south transaction history. This example URL uses the Get HTTP method and includes a number of parameters: start_date, end_date, fields, page_size and page.
https://api.paypal.com/v1/reporting/transactions?start_date=2020-03-10T00:00:00-0700&end_date=2020-03-24T23:59:59-0700&fields=all&page_size=100&folio=one
See the screenshot below to come across the URL in Apipheny.
Later on y'all enter the API URL into Apipheny, we're going to enter some keys and values into the Headers section.
In the Headers department in Apipheny, you should add together ii rows with the following keys and values:
Header 1 Fundamental 1: Content-Type Value 1: application/json
Header ii Primal 2: Authority Value ii: Bearer your-access-token
It doesn't matter what order the headers are entered. Replace your-access-token with the value from the access_token field in the JSON response you obtained in Stride 3. Enter the access token later "Bearer", with a infinite between "Bearer" and the token (see screenshot below).
The Content-Type and Authority headers are also required, so you should add them equally their own header:
Stride 5: Click "Run" to query the Paypal API in Google Sheets
Click the Run button at the bottom of the Apipheny sidebar and then wait for the Paypal API data to be retrieved and added in to your Google spreadsheet, like this:
In this example, nosotros got our Paypal transaction history information in Google Sheets by using the Apipheny addition.
Take it a step further
Now that you lot know how to query the Paypal API, try using dissimilar parameters in your Paypal API URL. Click here to see a list of available parameters.
Keep in mind that the access token you obtained expires after an hour, so you'll need to get a new access token if it'due south been more than than an hour.
API Tutorials

API Knowledge
What is an API?
What is an API URL?
What are parameters?
What is an endpoint?
What is an API key/token?
What is basic authentication?
What are headers?
What is a Go asking?
What is a Mail service request?
Source: https://apipheny.io/paypal-api-google-sheets/
0 Response to "Upload Excel File to Paypal for Payments"
Postar um comentário