🎉  Build a workflow powerhouse. Learn more about our new Airtable integration.   🎉

May 26, 2016

Automatically Generate Invoices for Deals in Pipedrive

With a CRM like Pipedrive you can keep your sales team organized and focused on hitting their goals.  Communicate with prospects, track opportunities, and close deals – all from any desktop or mobile device.

Another way that you can improve your sales process is by using WebMerge to automatically generate documents from Pipedrive like contracts, proposals, and invoices.  In this example, we’re going to show you how to automatically generate an invoice for a deal when it is marked as “Won”.

To get started, we’re going to setup our invoice template using the online document builder in WebMerge.  From the Documents page in WebMerge, click the New Document button and enter a name.  On the next step, pick Build Your Own as the document type and then continue.

Inside the document builder, we’re going to add all of our boilerplate invoice information like our logo and address.  Then for the spots that we want to insert our deal or customer information, we’re going to use merge fields like {$DealName}, {$CustomerName}, {$CustomerPhone}, etc.

Here’s what our invoice template looks like:

After you upload your template, you’ll be taken to the Settings tab where you can change options like the type of file that you want to generate and even the name of the file.  For this example, we’re going to generate a PDF and we’re going to include the name of our deal in the invoice name.

We’re also going to turn on Debug Mode (at the bottom of the page) and turn on the Field Map under Advanced Settings.  We’ll use these a little later.

Next, we’re going to setup our email delivery so that our invoice is automatically sent to our customer.  From the Deliver tab, go ahead and edit the default email delivery that was created.  If you don’t have an email merge field in your document, go ahead and pick <<other>> from the dropdown then enter in a field like {$EmailTo}.  Feel free to update any of the other settings.

To integrate with Pipedrive, we’re going to utilize their notification feature.  Under the Merge tab, we need to copy the Merge URL for our document.

Next, we need to build the full URL for our notification using this script: https://www.webmerge.me/scripts/pipedrive -  This script uses the Pipedrive API to pull in all the data associated to the deal and contact.  You’ll need to enter your Pipedrive API Key and the Merge URL for your document.  This will generate a Webhook URL that you’ll want to put into Pipedrive.

Once you have the webhook URL built, we need to login to Pipedrive and setup the notification.  Under Settings, go to the Webhooks page and create a new webhook then add the webhook URL.

Our last step is going to be linking up the Pipedrive fields with the merge fields in our document.  To do this, we need to run a quick test by updating a deal to “Won” and this will trigger the notification to be sent.

Then, we’re going to login to WebMerge and go to the Overview tab of our document.  You should see a recent merge and then a View Data button.  Go ahead and click that View Data button and you’ll be able to see all the data that is being sent over.

For each of those fields, we need to take the field name and enter it into the Field Map for the associated merge field.

Now that you've got your Field Map updated, you're ready for a real test. Go back into Pipedrive and update another deal. This will send data over to WebMerge and generate your invoice.

Here's what our merged invoice looked like.

That’s it, you’re all done!  You can now automatically generate all types of documents from Pipedrive.  Can you think of any other ways that you can use WebMerge to simplify your paperwork process?

6 min read

Ready to give Formstack Documents a try?
Start your Free Trial now!


Create Invoices from Pipedrive Now

By signing up here, you agree to our Terms of Use