There are some situations when you may need to create and send an invoice after payment in Stripe. For example, your customer may ask for an invoice after a successful checkout session because a lot of information is missing from the receipt. Also, you may need to send the invoice to your colleagues, storage, CRM system, or anywhere else.
We will show you how to automatically generate a Stripe invoice after successful payment with the help of Plumsail Documents and Zapier.
Systems involved:
Below we propose to consider a step-by-step process:
Let us say, in your Stripe account you have a payment from a customer for providing some services or selling products (an example below). You want to create and send by email an invoice when a customer makes a payment.
To do this automatically, all the data from Stripe will be transferred to Plumsail Documents via Zapier. So the next step is to create a process in Plumsail Documents.
In this step, we need to create the process in Plumsail Documents. Go to Processes in your Plumsail account and add a new process.
Then, select “Start from template” and give the process a name. You can use one of our invoice templates from the list if you don’t want to create your own invoice design. For instance, we will use our invoice template. Then click on the “Next” button.
Note: It’s a good idea to use the Stripe invoice template in Plumsail Documents to unify the design of invoices. So you can upload your own document and turn it into a template. To do this, select “Start from blank” when you create a process. Other steps will be the same.
As you can see in the screenshot above, our document has special {{placeholders}}
marked with double curly brackets. Inserting placeholders, also known as tokens, into documents allows us to turn the document into a template. This way, we mark the areas where we want the Stripe payment data to be filled in. To demonstrate the point, we highlight {{tokens}}
in our template document. In short, the templating engine considers everything between curly {{ }}
brackets to be a placeholder for the data we specify. Templating engine is smart enough to generate invoices with several line items from Stripe payments. To include line items automatically, we use the construction {{services.description}} in our example. Read this article to get familiar with the templating syntax.
After we’ve set tokens in our document template, we go to configure the settings of the output file.
Here we set the settings for the output file. You can use {{tokens}}
to make it dynamic; set the format - PDF, choose a locale, and additionally, you can protect PDF by watermark and other restrictions.
Next, go to delivery options.
In this step, we add deliveries—where the document will be stored and sent. You are free to include as many as you want. There you can see CRMs, chats, and other software from the list of available deliveries. For demonstration purposes, we added an email delivery to send the document to a customer and to a manager.
If you are using Gmail for delivery, be sure that you select all the checkboxes while connecting your Gmail account.
Next, press the button “Save & Next” and go to set up Zapier connection.
Go to Zapier and create an account if you don’t have one. Next, create a Zap.
In the next step, you have to find the Stripe event. It means that an event will occur every time something happens in Stripe.
After that, you have to find and select a certain type of Stripe event. In our case, we select the “New Payment” event.
As you can see, there are a lot of events you can choose from. For example, if you need to create an invoice after a subscription renewal, we advise selecting “New Event” to specify certain events for the subscription.
In the next step, you have to sign into your Stripe account.
Next, you will see a message about the need to allow Zapier access to your Stripe account. Don’t worry, it’s safe, no data will be stolen. Follow the link.
You will go to your Stripe account to get the secret key. Press the button and copy the secret key.
Then, go back to the window that popped up before and paste the secret key into the field. Click “Yes, Continue”.
After that, continue to set the trigger in Zapier. In the next step in Zapier, you will see the “Test trigger” button. Press it to see all the data you will get from Stripe payment.
In our case, we got this from a test.
We will use this data to automatically generate invoices in Plumsail Documents. Click on Continue to proceed to add an action that will be executed on the trigger event. Search for Plumsail Documents.
Choose ‘Start process’ as an action event.
Then choose your account in Plumsail Documents. Click to Continue.
The next step is the last step. Here we have to select our data from Stripe to fill our tokens in the Plumsail document template. Here is what we selected for our tokens:
Process Name: Select created process in Plumsail Documents;
{{date}}
: Created Formatted;
{{invoiceNumber}}
: Customer Invoice Prefix;
{{customerName}}
: Customer Name;
{{customerAddress}}
: Included all customer address outputs. We did not list everything here;
{{customerPhone}}
: Customer Phone;
{{customerEmail}}
: Customer Email;
{{amount}}
: Amount;
{{description}}
: Invoice Lines Data Description. Here we select line items from the invoice.
Let’s Continue. Don’t forget to take a test and turn your Zap on!
To see the result, we ran the Zap, created a new test payment in Stripe, and checked our inbox in Email. Here is what we got:
Our workflow is ready! We automatically created the invoice after a successful payment in Stripe and sent it by email to our recipients.