How to Create Stripe Payment Links With Google Sheets

Learn how to generate Stripe Payment Links with a redirect link and send a post-purchase invoice to the buyer, all from withing Google Sheets

Creating payment links with Stripe is a powerful way to automate the process of selling products or services online, especially when integrated with Google Sheets via Apps Script. Here, we will walk through the process of generating Stripe payment links in Google Sheets using a custom function.

What are Stripe payment links?

Stripe payment links are unique URLs that allow you to accept payments from customers. They can be used to sell products or services without requiring a complex e-commerce setup. These links can be shared via email, SMS, WhatsApp, or on social media platforms, and they do not expire, providing a convenient and versatile payment solution.

Main features of the automation

  1. Creating a Payment Link for One or Multiple Items: The STRIPE function is designed to create a Stripe payment link for either a single product or multiple products. This means that the user can specify one or more items (at most 20 items) that they want to sell, and the function will generate a payment link accordingly. If multiple items are specified, they will all be displayed on the purchase page, and the customer will pay the total amount for all the items. See demos in GIFs below.
  1. Post-Payment Actions: After a payment is completed, the user can choose to either redirect the customer to a specific URL or display a message. This is useful for directing customers to a thank you page, a survey, or another product page. The specific implementation of this feature would depend on whether an HTTPS URL is given as input to the STRIPE function or a message instead.
  1. Sending a Receipt and Post-Purchase Invoice: Once a payment is completed, Stripe automatically sends a receipt and a post-purchase invoice to the customer’s email address.

One-item payment link creation

Multiple-items payment link creation

Configuration steps

  1. Get the API Key: Create an API key on the Stripe dashboard. Then you will need to insert this key in the Google Script code. During the creation of the key, make sure to enable “Write” permissions for the Products, Prices, and Payment Links resources, as these are used in the automation script.

  1. Activate Post-Payment Emails: Next, navigate to Customer emails settings and activate the “Successful Payments” email setting. This ensures that a receipt and post-purchase invoice are sent to the customer’s email address upon successful payment.

In case you want to, Stripe also allows you to customize your receipt with your branding. You can do this from your Stripe dashboard.

Final thoughts

Automating the creation of Stripe payment links with Google Apps Script offers a flexible and efficient solution for managing online payments. With this setup, you can easily create one-time payment links in bulk, redirect your customer after payment, and ensure customers receive post-purchase invoices, all from within a Google Sheet.


Joseph Asinyo

Google Workspace Developer

I’m Joseph. I love building applications and writing Google scripts to automate Google Workspace for greater productivity. Learn more about me.

Scroll to Top