The web has made it incredibly easy for anyone to sell digital products directly to customers through websites, social media, and email newsletters. You can sell PDF ebooks, MP3 music, photos, software apps, gift cards, license keys, coupon codes, website templates, fonts, graphics, video courses, and many more downloadable files.

Some of few e-commerce websites that help you for selling your digital products – Gumroad, E-junkie, Paddle, FastSpring, Shopify, Instamojo and WooCommerce, to name a few,  here’s a do-it-yourself solution that will help you make your digital store within 5 minutes using PayPal and your Google account.

How does it work?

Before we get into the implementation, here’s a big-picture view of how the payment and digital delivery workflow works.

  1. Set the “Buy Now” buttons into your website or blog. Customers can pay with all major credit cards using 1-step checkout.
  2. The customer clicks the button, enters the card details and completes the payment. The customer stays on your site and isn’t redirected anywhere to complete the purchase.
  3. The order is delivered to the customer in a personalized email message. You can also attach a tax invoice in the confirmation emails.

Selling Digital Downloads with PayPal and Google Drive

The workflow uses Google Drive for securely hosting files, PayPal for completing payments, Google Sheets for generating professional PDF invoices and Gmail for delivering the order to the buyer as file attachments.

There are no restrictions on the size of files or the number of products that you can sell. There are no bandwidth or storage restrictions. There’s no transaction fee except for the payment processing fees that are charged by PayPal and Stripe.

How to Start it?

Step 1: Create a PayPal App

Go to developer.paypal.com and sign-in with your PayPal account. If you don’t have one, sign-up here for a new Business account.

Inside your PayPal dashboard, go to My Apps & Credentials > Rest API Apps and create a new app. You can give your app any name as it is for internal use only. PayPal will now create client credentials for testing and live transactions that we’ll need in the next step.

Step 2: Now Create a PayPal Webhook

When a customer completes the purchase and makes the payment, PayPal will send your app a notification by visiting a specific URL and this is known as a webhook.

To create a webhook, go to digitalgoods.dev/copy and copy the Google Sheet to your Google Drive. Inside the sheet, go to Tools > Script Editor, then choose Publish > Deploy As Web App and click the Update button to create your PayPal webhook. Copy the URL to the clipboard.

You will have to allow the script once since it has to do all the operation – send emails, attach Drive files, and generate PDF invoices – on your behalf.

Step 3: Configure App inside Google Sheet

Switch to the “Configuration” sheet inside the Google Spreadsheet and paste the webhook URL inside the “webhook” field. Next, copy-paste the Client ID and Secret generated in step 1 inside the similar fields of the Google Sheet.

There are few other mandatory fields in the sheet. Choose your default currency, the shipping preference, define your brand name and the soft descriptor (this will show in the credit card statement of the buyer).

Go to the Digital Goods menu in the sheet (it is near the Help menu) and choose Test PayPal Configuration to verify the PayPal-Google Sheets connection.

Step 4: Now Add your Digital Products

Switch to the “Items” sheet and enter the default tax rate in the cell E1. Next, add one or more products in the sheet. You only need to define the price of the item in column D, the Tax and Total Amount is automatically calculated based on the tax rate set in E1.

To attach files to your digital product, highlight the Files column, then go to the Digital Goods menu and choose Attach Drive Files. It opens the Google File picker and you can select one or more files from your Google Drive that will be sent to the buyer after they purchase the corresponding product.

Step 5: Create the Tax Invoice Template

Switch to the “Invoice” sheet and customize the invoice template. You can use formulas, add your logos, apply styles to match your brand and the template would be converted to a PDF file and sent as a file attachment in the order confirmation emails.

The invoice template can include placemarkers, similar to the ones you have used inside Document Studio. For instance, the {{Name}} variable will be replaced with the full name of the customer as found in the PayPal order. The {{Email}} variable is replaced with the buyer’s email address while the {{Invoice Id}} adds a unique invoice number to your invoice.

Step 6: Create the Order Confirmation Email

Switch to the “Email” sheet and create the HTML template that you will be sent to customers after they complete the payment. The email will automatically add the files and invoice as attachments but you can customize the email message and subject.

The first row in the sheet is the subject and everything else will go in the message body. The emails, like Mail Merge, can be personalized and you can also use HTML tags to add images, links and rich content in the emails.

Step 7: Test your PayPal buttons

Now that you have added the products to the Google Sheet, it is time to test the integration in sandbox mode before you set the buttons on your live website.

Go back to your PayPal dashboard, and choose Credit Card Generator in the right sidebar. Here you can generate random credit card numbers with expiration date and CVV for testing your buttons in sandbox mode.

Inside the Google Sheet, choose Digital Tools > Embed PayPal Buttons to generate the HTML embed code for your digital products. The screen offers embed codes in both the live mode and the sandbox mode.

Click the Try button next to the Sandbox mode and you’ll be able to test the buttons right inside the Google Sheet. Click the credit card icon, enter the mock credit card number and click “Pay Now” to finish the test transaction.

PayPal requests the Webhook and it triggers the order workflow. Switch to the “Logs” sheet and you’ll soon find a new entry for the transaction that you just completed. Open your Gmail Sent Items folder and you’ll find a copy of the email that was sent the buyer’s email.

If your integration is working as expected, go to the Embed PayPal menu in the sheet and this time copy the embed code for the “Live” mode and paste it on your website. Your product is now live and anyone in the world can buy your product with a single-step checkout.

All the incoming orders can be traced in real-time inside the “Sales” tab of the Google Sheet. The sheet includes the customer’s name, email address, the order summary, and the buyer’s postal address. The address is only available if you have set the shipping preference in the configuration sheet to “GET_FROM_FILE”.

You can directly run Mail Merge with Gmail inside this sheet to easily send product updates to existing customers. If you have been using PayPal before shifting to Digital Goods, put all the PayPal emails under a new Gmail label, extract the email addresses inside the sheet and use that list for your merge.

How to can you sell Unique License Keys & Codes

In some businesses, you may want to send unique codes to the customer. These may include license numbers to unlock software apps (like we do at Digital Inspiration),  passwords to access streaming video courses, discount coupons, gift cards, event registration numbers and more.

This is easy with Digital Goods. Open the “Codes” sheet in the spreadsheet and the pre-generated list of codes in one of the columns. Give this column a heading. Next, include the {{column title}} in your email message and a unique code will be added in place of the marker.

The app looks at the last row of the Sale sheet (the current order), gets the codes from that same row in the Codes sheet and adds them to your email/invoice.

Tips for Troubleshooting

  1. Go to the configuration sheet and set “yes” for the debug setting. Next, do a test transaction inside sandbox mode and check the Logs sheet for any errors.
  2. Go the Digital Goods menu and run Test Configuration again to assure that your PayPal sandbox and live credentials are correct.
  3. PayPal, in rare cases, may delay the delivery of webhooks. Go to the PayPal dashboard and choose Webhooks to get a list of recently-processed webhook events and their status. You can open a case at paypal-techsupport.com for help.
  4. Make sure that you have not renamed or deleted any of the original sheets in your copied Google Spreadsheet.
  5. Open your Chrome Dev Tools, switch to the Network tab and make sure that your adblockers are not blocking the PayPal script.