CloudHow to automatically send PayPal transactions to Google Sheet

How to automatically send PayPal transactions to Google Sheet

Google Sheet setup

Google Sheets is a free spreadsheet offered by Google. For those familiar with Excel will find Google Sheets no different. You will need a Google account to create a Google Sheet. Create an account if you don’t have one.

After opening the sheet, write a few lines of code that will be called from your PayPal account to send the transaction when an activity happens in PayPal. The code will get transaction information and write into the sheet.

How to write the code

After opening the Sheets change the name from Untitled spreadsheet to something relevant. Then click Script editor from Tools menu

Writing the code

Clear the template block of code and replace with the code below.

function doPost(e) {

  var rowData = [];

  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getActiveSheet()

  rowData.push(new Date(e.parameter.payment_date));

That’s all the code. For the technical folks, PayPal sends an event (e) to Google Sheets with ‘parameter’ that contains all the transaction data. Explore PayPal developer section for more details.

Deploy code to web

Select Deploy as web app in Publish menu. This is important step, make all changes carefully here. Any error will result in failed link with PayPal.

You will be prompted through series of verification steps to complete Google permissions. Start by completing the options on first screen and click Deploy button. Give permission to owner of Google Sheet.

  • In Project version: select ‘new’, enter description
  • Execute the app as: Me
  • Who has access to the app: Anyone, even anonymous

After completing all verification, a screen like below will pop up. Copy the URL carefully into notepad. You will need it during Instant Payment Notification (IPN) setup in PayPal.

Home | Google Sheet Setup | PayPal Setup | Test IPN

Email to get professional help and get started.

Pages: 1 2 3 4

Categories: Cloud Tags: , , , ,