Blog

Automatically Populate Contracts and Agreements from PHP

Blog

Automatically Populate Contracts and Agreements from PHP

Blog

Automatically Populate Contracts and Agreements from PHP

Blog

Automatically Populate Contracts and Agreements from PHP

Blog

Automatically Populate Contracts and Agreements from PHP

Download PDFDownload PDF
Blog

Automatically Populate Contracts and Agreements from PHP

Formstack
/
August 23, 2016
Blog

Automatically Populate Contracts and Agreements from PHP

MIN
/
August 23, 2016
About the Episode
Episode Highlights
Meet our Guest
Episode Transcript

Creating contracts and collecting signatures can be a very time-consuming task – especially if you’re running a web app with a lot of new customers coming on board.  Being able to automatically generate contracts and send them out for signature can be a crucial piece of your sales cycle.

With Formstack Documents, you can automatically populate contracts, quotes, invoices, and more from templates with a few lines of code.  You don’t have to worry about building any PDF libraries or hassling the tech team to make changes.

In this example, we’re going to show you how you can use Formstack Documents to automatically generate a contract from a PHP web app and then send the contract over to DocuSign for signature.
To get started, we’re going to setup the template for our contract using a Word document.  Inside Word, we’re going to add our boilerplate terms, and then for the spots that we want to insert our customer’s information, we’re going to use merge fields like {$FirstName}, {$LastName}, etc.

Here’s what our contract looked like:


Since we’ll be collecting signatures via DocuSign, we also need to insert a signature tag in the template so that DocuSign knows where to embed the signature once it has been signed.  This signature tag is just like any other text in our document and looks like:  \s1\



Once we have our template finished, we need to upload it to Formstack Documents.  From the Documents page in Formstack Documents, click the New Document button and enter a name.  On the next step, choose Office Document as the document type and then pick the file from your computer.



After you have uploaded your template, you’ll be taken to the settings tab where you can modify various options like the type of file that is generated and the name of the file.  For this example, we’re going to generate a PDF and include the name of our customer in the file name.



Once you have updated the settings, we’re going to setup the delivery of our document to DocuSign so that it is automatically sent to our customer for signing.  Under the Deliver tab, click the New Delivery button and pick DocuSign from the list.

After you authenticate your DocuSign account, you’ll need to define the signer’s name and email address using merge fields.  If you don’t have these merge fields in your document, choose <> from the dropdown and then enter something like {$Email}.



Once you have the DocuSign delivery setup, we’re ready to integrate this document with our PHP app.  To send data over to Formstack Documents, we’re going to do an HTTP POST request (via cURL) to the document’s Merge URL.  To find the Merge URL for your document, go to the Merge tab.



Inside our PHP code, we’re going to setup our cURL request and we’re going to send our data over as JSON.   Here’s an example for you to use:

Once you have added the cURL call to your PHP code, go ahead and run a test from your app to make sure everything is working correctly.  When you run the test, it will generate the contract and send it over to DocuSign for signature.

Here’s what our contract looked like ready to sign in DocuSign:



Start a free trial today to see how Formstack Documents can simplify your paperwork processes.

Blog

Automatically Populate Contracts and Agreements from PHP

Blog

Automatically Populate Contracts and Agreements from PHP

Get the Report

Not a valid e-mail address

Great, thank ya!

You can now access the content.
Oops! Something went wrong while submitting the form.
Blog

Automatically Populate Contracts and Agreements from PHP

Panelists
No items found.
Introduction
Introduction

Great, thank ya!

You can now access the content.
Download NowDownload Now
Oops! Something went wrong while submitting the form.

Creating contracts and collecting signatures can be a very time-consuming task – especially if you’re running a web app with a lot of new customers coming on board.  Being able to automatically generate contracts and send them out for signature can be a crucial piece of your sales cycle.

With Formstack Documents, you can automatically populate contracts, quotes, invoices, and more from templates with a few lines of code.  You don’t have to worry about building any PDF libraries or hassling the tech team to make changes.

In this example, we’re going to show you how you can use Formstack Documents to automatically generate a contract from a PHP web app and then send the contract over to DocuSign for signature.
To get started, we’re going to setup the template for our contract using a Word document.  Inside Word, we’re going to add our boilerplate terms, and then for the spots that we want to insert our customer’s information, we’re going to use merge fields like {$FirstName}, {$LastName}, etc.

Here’s what our contract looked like:


Since we’ll be collecting signatures via DocuSign, we also need to insert a signature tag in the template so that DocuSign knows where to embed the signature once it has been signed.  This signature tag is just like any other text in our document and looks like:  \s1\



Once we have our template finished, we need to upload it to Formstack Documents.  From the Documents page in Formstack Documents, click the New Document button and enter a name.  On the next step, choose Office Document as the document type and then pick the file from your computer.



After you have uploaded your template, you’ll be taken to the settings tab where you can modify various options like the type of file that is generated and the name of the file.  For this example, we’re going to generate a PDF and include the name of our customer in the file name.



Once you have updated the settings, we’re going to setup the delivery of our document to DocuSign so that it is automatically sent to our customer for signing.  Under the Deliver tab, click the New Delivery button and pick DocuSign from the list.

After you authenticate your DocuSign account, you’ll need to define the signer’s name and email address using merge fields.  If you don’t have these merge fields in your document, choose <> from the dropdown and then enter something like {$Email}.



Once you have the DocuSign delivery setup, we’re ready to integrate this document with our PHP app.  To send data over to Formstack Documents, we’re going to do an HTTP POST request (via cURL) to the document’s Merge URL.  To find the Merge URL for your document, go to the Merge tab.



Inside our PHP code, we’re going to setup our cURL request and we’re going to send our data over as JSON.   Here’s an example for you to use:

Once you have added the cURL call to your PHP code, go ahead and run a test from your app to make sure everything is working correctly.  When you run the test, it will generate the contract and send it over to DocuSign for signature.

Here’s what our contract looked like ready to sign in DocuSign:



Start a free trial today to see how Formstack Documents can simplify your paperwork processes.

Panelists
No items found.
Infographic

Automatically Populate Contracts and Agreements from PHP

Follow these steps to start automatically populating contracts and agreements.
Download InfographicDownload Infographic

Creating contracts and collecting signatures can be a very time-consuming task – especially if you’re running a web app with a lot of new customers coming on board.  Being able to automatically generate contracts and send them out for signature can be a crucial piece of your sales cycle.

With Formstack Documents, you can automatically populate contracts, quotes, invoices, and more from templates with a few lines of code.  You don’t have to worry about building any PDF libraries or hassling the tech team to make changes.

In this example, we’re going to show you how you can use Formstack Documents to automatically generate a contract from a PHP web app and then send the contract over to DocuSign for signature.
To get started, we’re going to setup the template for our contract using a Word document.  Inside Word, we’re going to add our boilerplate terms, and then for the spots that we want to insert our customer’s information, we’re going to use merge fields like {$FirstName}, {$LastName}, etc.

Here’s what our contract looked like:


Since we’ll be collecting signatures via DocuSign, we also need to insert a signature tag in the template so that DocuSign knows where to embed the signature once it has been signed.  This signature tag is just like any other text in our document and looks like:  \s1\



Once we have our template finished, we need to upload it to Formstack Documents.  From the Documents page in Formstack Documents, click the New Document button and enter a name.  On the next step, choose Office Document as the document type and then pick the file from your computer.



After you have uploaded your template, you’ll be taken to the settings tab where you can modify various options like the type of file that is generated and the name of the file.  For this example, we’re going to generate a PDF and include the name of our customer in the file name.



Once you have updated the settings, we’re going to setup the delivery of our document to DocuSign so that it is automatically sent to our customer for signing.  Under the Deliver tab, click the New Delivery button and pick DocuSign from the list.

After you authenticate your DocuSign account, you’ll need to define the signer’s name and email address using merge fields.  If you don’t have these merge fields in your document, choose <> from the dropdown and then enter something like {$Email}.



Once you have the DocuSign delivery setup, we’re ready to integrate this document with our PHP app.  To send data over to Formstack Documents, we’re going to do an HTTP POST request (via cURL) to the document’s Merge URL.  To find the Merge URL for your document, go to the Merge tab.



Inside our PHP code, we’re going to setup our cURL request and we’re going to send our data over as JSON.   Here’s an example for you to use:

Once you have added the cURL call to your PHP code, go ahead and run a test from your app to make sure everything is working correctly.  When you run the test, it will generate the contract and send it over to DocuSign for signature.

Here’s what our contract looked like ready to sign in DocuSign:



Start a free trial today to see how Formstack Documents can simplify your paperwork processes.

Creating contracts and collecting signatures can be a very time-consuming task – especially if you’re running a web app with a lot of new customers coming on board.  Being able to automatically generate contracts and send them out for signature can be a crucial piece of your sales cycle.

With Formstack Documents, you can automatically populate contracts, quotes, invoices, and more from templates with a few lines of code.  You don’t have to worry about building any PDF libraries or hassling the tech team to make changes.

In this example, we’re going to show you how you can use Formstack Documents to automatically generate a contract from a PHP web app and then send the contract over to DocuSign for signature.
To get started, we’re going to setup the template for our contract using a Word document.  Inside Word, we’re going to add our boilerplate terms, and then for the spots that we want to insert our customer’s information, we’re going to use merge fields like {$FirstName}, {$LastName}, etc.

Here’s what our contract looked like:


Since we’ll be collecting signatures via DocuSign, we also need to insert a signature tag in the template so that DocuSign knows where to embed the signature once it has been signed.  This signature tag is just like any other text in our document and looks like:  \s1\



Once we have our template finished, we need to upload it to Formstack Documents.  From the Documents page in Formstack Documents, click the New Document button and enter a name.  On the next step, choose Office Document as the document type and then pick the file from your computer.



After you have uploaded your template, you’ll be taken to the settings tab where you can modify various options like the type of file that is generated and the name of the file.  For this example, we’re going to generate a PDF and include the name of our customer in the file name.



Once you have updated the settings, we’re going to setup the delivery of our document to DocuSign so that it is automatically sent to our customer for signing.  Under the Deliver tab, click the New Delivery button and pick DocuSign from the list.

After you authenticate your DocuSign account, you’ll need to define the signer’s name and email address using merge fields.  If you don’t have these merge fields in your document, choose <> from the dropdown and then enter something like {$Email}.



Once you have the DocuSign delivery setup, we’re ready to integrate this document with our PHP app.  To send data over to Formstack Documents, we’re going to do an HTTP POST request (via cURL) to the document’s Merge URL.  To find the Merge URL for your document, go to the Merge tab.



Inside our PHP code, we’re going to setup our cURL request and we’re going to send our data over as JSON.   Here’s an example for you to use:

Once you have added the cURL call to your PHP code, go ahead and run a test from your app to make sure everything is working correctly.  When you run the test, it will generate the contract and send it over to DocuSign for signature.

Here’s what our contract looked like ready to sign in DocuSign:



Start a free trial today to see how Formstack Documents can simplify your paperwork processes.

Collecting payments with online forms is easy, but first, you have to choose the right payment gateway. Browse the providers in our gateway credit card processing comparison chart to find the best option for your business. Then sign up for Formstack Forms, customize your payment forms, and start collecting profits in minutes.

Online Payment Gateway Comparison Chart

NOTE: These amounts reflect the monthly subscription for the payment provider. Formstack does not charge a fee to integrate with any of our payment partners.

FEATURES
Authorize.Net
Bambora
Chargify
First Data
PayPal
PayPal Pro
PayPal Payflow
Stripe
WePay
Monthly Fees
$25
$25
$149+
Contact First Data
$0
$25
$0-$25
$0
$0
Transaction Fees
$2.9% + 30¢
$2.9% + 30¢
N/A
Contact First Data
$2.9% + 30¢
$2.9% + 30¢
10¢
$2.9% + 30¢
$2.9% + 30¢
Countries
5
8
Based on payment gateway
50+
203
3
4
25
USA
Currencies
11
2
23
140
25
23
25
135+
1
Card Types
6
13
Based on payment gateway
5
9
9
5
6
4
Limits
None
None
Based on payment gateway
None
$10,000
None
None
None
None
Form Payments
Recurring Billing
Mobile Payments
PSD2 Compliant

Creating contracts and collecting signatures can be a very time-consuming task – especially if you’re running a web app with a lot of new customers coming on board.  Being able to automatically generate contracts and send them out for signature can be a crucial piece of your sales cycle.

With Formstack Documents, you can automatically populate contracts, quotes, invoices, and more from templates with a few lines of code.  You don’t have to worry about building any PDF libraries or hassling the tech team to make changes.

In this example, we’re going to show you how you can use Formstack Documents to automatically generate a contract from a PHP web app and then send the contract over to DocuSign for signature.
To get started, we’re going to setup the template for our contract using a Word document.  Inside Word, we’re going to add our boilerplate terms, and then for the spots that we want to insert our customer’s information, we’re going to use merge fields like {$FirstName}, {$LastName}, etc.

Here’s what our contract looked like:


Since we’ll be collecting signatures via DocuSign, we also need to insert a signature tag in the template so that DocuSign knows where to embed the signature once it has been signed.  This signature tag is just like any other text in our document and looks like:  \s1\



Once we have our template finished, we need to upload it to Formstack Documents.  From the Documents page in Formstack Documents, click the New Document button and enter a name.  On the next step, choose Office Document as the document type and then pick the file from your computer.



After you have uploaded your template, you’ll be taken to the settings tab where you can modify various options like the type of file that is generated and the name of the file.  For this example, we’re going to generate a PDF and include the name of our customer in the file name.



Once you have updated the settings, we’re going to setup the delivery of our document to DocuSign so that it is automatically sent to our customer for signing.  Under the Deliver tab, click the New Delivery button and pick DocuSign from the list.

After you authenticate your DocuSign account, you’ll need to define the signer’s name and email address using merge fields.  If you don’t have these merge fields in your document, choose <> from the dropdown and then enter something like {$Email}.



Once you have the DocuSign delivery setup, we’re ready to integrate this document with our PHP app.  To send data over to Formstack Documents, we’re going to do an HTTP POST request (via cURL) to the document’s Merge URL.  To find the Merge URL for your document, go to the Merge tab.



Inside our PHP code, we’re going to setup our cURL request and we’re going to send our data over as JSON.   Here’s an example for you to use:

Once you have added the cURL call to your PHP code, go ahead and run a test from your app to make sure everything is working correctly.  When you run the test, it will generate the contract and send it over to DocuSign for signature.

Here’s what our contract looked like ready to sign in DocuSign:



Start a free trial today to see how Formstack Documents can simplify your paperwork processes.

Creating contracts and collecting signatures can be a very time-consuming task – especially if you’re running a web app with a lot of new customers coming on board.  Being able to automatically generate contracts and send them out for signature can be a crucial piece of your sales cycle.

With Formstack Documents, you can automatically populate contracts, quotes, invoices, and more from templates with a few lines of code.  You don’t have to worry about building any PDF libraries or hassling the tech team to make changes.

In this example, we’re going to show you how you can use Formstack Documents to automatically generate a contract from a PHP web app and then send the contract over to DocuSign for signature.
To get started, we’re going to setup the template for our contract using a Word document.  Inside Word, we’re going to add our boilerplate terms, and then for the spots that we want to insert our customer’s information, we’re going to use merge fields like {$FirstName}, {$LastName}, etc.

Here’s what our contract looked like:


Since we’ll be collecting signatures via DocuSign, we also need to insert a signature tag in the template so that DocuSign knows where to embed the signature once it has been signed.  This signature tag is just like any other text in our document and looks like:  \s1\



Once we have our template finished, we need to upload it to Formstack Documents.  From the Documents page in Formstack Documents, click the New Document button and enter a name.  On the next step, choose Office Document as the document type and then pick the file from your computer.



After you have uploaded your template, you’ll be taken to the settings tab where you can modify various options like the type of file that is generated and the name of the file.  For this example, we’re going to generate a PDF and include the name of our customer in the file name.



Once you have updated the settings, we’re going to setup the delivery of our document to DocuSign so that it is automatically sent to our customer for signing.  Under the Deliver tab, click the New Delivery button and pick DocuSign from the list.

After you authenticate your DocuSign account, you’ll need to define the signer’s name and email address using merge fields.  If you don’t have these merge fields in your document, choose <> from the dropdown and then enter something like {$Email}.



Once you have the DocuSign delivery setup, we’re ready to integrate this document with our PHP app.  To send data over to Formstack Documents, we’re going to do an HTTP POST request (via cURL) to the document’s Merge URL.  To find the Merge URL for your document, go to the Merge tab.



Inside our PHP code, we’re going to setup our cURL request and we’re going to send our data over as JSON.   Here’s an example for you to use:

Once you have added the cURL call to your PHP code, go ahead and run a test from your app to make sure everything is working correctly.  When you run the test, it will generate the contract and send it over to DocuSign for signature.

Here’s what our contract looked like ready to sign in DocuSign:



Start a free trial today to see how Formstack Documents can simplify your paperwork processes.

Creating contracts and collecting signatures can be a very time-consuming task – especially if you’re running a web app with a lot of new customers coming on board.  Being able to automatically generate contracts and send them out for signature can be a crucial piece of your sales cycle.

With Formstack Documents, you can automatically populate contracts, quotes, invoices, and more from templates with a few lines of code.  You don’t have to worry about building any PDF libraries or hassling the tech team to make changes.

In this example, we’re going to show you how you can use Formstack Documents to automatically generate a contract from a PHP web app and then send the contract over to DocuSign for signature.
To get started, we’re going to setup the template for our contract using a Word document.  Inside Word, we’re going to add our boilerplate terms, and then for the spots that we want to insert our customer’s information, we’re going to use merge fields like {$FirstName}, {$LastName}, etc.

Here’s what our contract looked like:


Since we’ll be collecting signatures via DocuSign, we also need to insert a signature tag in the template so that DocuSign knows where to embed the signature once it has been signed.  This signature tag is just like any other text in our document and looks like:  \s1\



Once we have our template finished, we need to upload it to Formstack Documents.  From the Documents page in Formstack Documents, click the New Document button and enter a name.  On the next step, choose Office Document as the document type and then pick the file from your computer.



After you have uploaded your template, you’ll be taken to the settings tab where you can modify various options like the type of file that is generated and the name of the file.  For this example, we’re going to generate a PDF and include the name of our customer in the file name.



Once you have updated the settings, we’re going to setup the delivery of our document to DocuSign so that it is automatically sent to our customer for signing.  Under the Deliver tab, click the New Delivery button and pick DocuSign from the list.

After you authenticate your DocuSign account, you’ll need to define the signer’s name and email address using merge fields.  If you don’t have these merge fields in your document, choose <> from the dropdown and then enter something like {$Email}.



Once you have the DocuSign delivery setup, we’re ready to integrate this document with our PHP app.  To send data over to Formstack Documents, we’re going to do an HTTP POST request (via cURL) to the document’s Merge URL.  To find the Merge URL for your document, go to the Merge tab.



Inside our PHP code, we’re going to setup our cURL request and we’re going to send our data over as JSON.   Here’s an example for you to use:

Once you have added the cURL call to your PHP code, go ahead and run a test from your app to make sure everything is working correctly.  When you run the test, it will generate the contract and send it over to DocuSign for signature.

Here’s what our contract looked like ready to sign in DocuSign:



Start a free trial today to see how Formstack Documents can simplify your paperwork processes.

Creating contracts and collecting signatures can be a very time-consuming task – especially if you’re running a web app with a lot of new customers coming on board.  Being able to automatically generate contracts and send them out for signature can be a crucial piece of your sales cycle.

With Formstack Documents, you can automatically populate contracts, quotes, invoices, and more from templates with a few lines of code.  You don’t have to worry about building any PDF libraries or hassling the tech team to make changes.

In this example, we’re going to show you how you can use Formstack Documents to automatically generate a contract from a PHP web app and then send the contract over to DocuSign for signature.
To get started, we’re going to setup the template for our contract using a Word document.  Inside Word, we’re going to add our boilerplate terms, and then for the spots that we want to insert our customer’s information, we’re going to use merge fields like {$FirstName}, {$LastName}, etc.

Here’s what our contract looked like:


Since we’ll be collecting signatures via DocuSign, we also need to insert a signature tag in the template so that DocuSign knows where to embed the signature once it has been signed.  This signature tag is just like any other text in our document and looks like:  \s1\



Once we have our template finished, we need to upload it to Formstack Documents.  From the Documents page in Formstack Documents, click the New Document button and enter a name.  On the next step, choose Office Document as the document type and then pick the file from your computer.



After you have uploaded your template, you’ll be taken to the settings tab where you can modify various options like the type of file that is generated and the name of the file.  For this example, we’re going to generate a PDF and include the name of our customer in the file name.



Once you have updated the settings, we’re going to setup the delivery of our document to DocuSign so that it is automatically sent to our customer for signing.  Under the Deliver tab, click the New Delivery button and pick DocuSign from the list.

After you authenticate your DocuSign account, you’ll need to define the signer’s name and email address using merge fields.  If you don’t have these merge fields in your document, choose <> from the dropdown and then enter something like {$Email}.



Once you have the DocuSign delivery setup, we’re ready to integrate this document with our PHP app.  To send data over to Formstack Documents, we’re going to do an HTTP POST request (via cURL) to the document’s Merge URL.  To find the Merge URL for your document, go to the Merge tab.



Inside our PHP code, we’re going to setup our cURL request and we’re going to send our data over as JSON.   Here’s an example for you to use:

Once you have added the cURL call to your PHP code, go ahead and run a test from your app to make sure everything is working correctly.  When you run the test, it will generate the contract and send it over to DocuSign for signature.

Here’s what our contract looked like ready to sign in DocuSign:



Start a free trial today to see how Formstack Documents can simplify your paperwork processes.

Creating contracts and collecting signatures can be a very time-consuming task – especially if you’re running a web app with a lot of new customers coming on board.  Being able to automatically generate contracts and send them out for signature can be a crucial piece of your sales cycle.

With Formstack Documents, you can automatically populate contracts, quotes, invoices, and more from templates with a few lines of code.  You don’t have to worry about building any PDF libraries or hassling the tech team to make changes.

In this example, we’re going to show you how you can use Formstack Documents to automatically generate a contract from a PHP web app and then send the contract over to DocuSign for signature.
To get started, we’re going to setup the template for our contract using a Word document.  Inside Word, we’re going to add our boilerplate terms, and then for the spots that we want to insert our customer’s information, we’re going to use merge fields like {$FirstName}, {$LastName}, etc.

Here’s what our contract looked like:


Since we’ll be collecting signatures via DocuSign, we also need to insert a signature tag in the template so that DocuSign knows where to embed the signature once it has been signed.  This signature tag is just like any other text in our document and looks like:  \s1\



Once we have our template finished, we need to upload it to Formstack Documents.  From the Documents page in Formstack Documents, click the New Document button and enter a name.  On the next step, choose Office Document as the document type and then pick the file from your computer.



After you have uploaded your template, you’ll be taken to the settings tab where you can modify various options like the type of file that is generated and the name of the file.  For this example, we’re going to generate a PDF and include the name of our customer in the file name.



Once you have updated the settings, we’re going to setup the delivery of our document to DocuSign so that it is automatically sent to our customer for signing.  Under the Deliver tab, click the New Delivery button and pick DocuSign from the list.

After you authenticate your DocuSign account, you’ll need to define the signer’s name and email address using merge fields.  If you don’t have these merge fields in your document, choose <> from the dropdown and then enter something like {$Email}.



Once you have the DocuSign delivery setup, we’re ready to integrate this document with our PHP app.  To send data over to Formstack Documents, we’re going to do an HTTP POST request (via cURL) to the document’s Merge URL.  To find the Merge URL for your document, go to the Merge tab.



Inside our PHP code, we’re going to setup our cURL request and we’re going to send our data over as JSON.   Here’s an example for you to use:

Once you have added the cURL call to your PHP code, go ahead and run a test from your app to make sure everything is working correctly.  When you run the test, it will generate the contract and send it over to DocuSign for signature.

Here’s what our contract looked like ready to sign in DocuSign:



Start a free trial today to see how Formstack Documents can simplify your paperwork processes.

Formstack
Formstack is a SaaS company with a mission to help organizations digitize what matters, automate workflows, and fix processes—all without code. A variety of team members come together to compile posts under Formstack's authorship.
More Articles
Meet The Host
Content Marketing Manager
Connect
Lindsay is a writer with a background in journalism and loves getting to flex her interview skills as host of Practically Genius. She manages Formstack's blog and long-form reports, like the 2022 State of Digital Maturity: Advancing Workflow Automation.