How does a Business Contract work?
A business contract acts as a translation layer between a customer's own data payload and the variables used inside a document or email template.
Instead of forcing the customer to restructure their data to match the template, the contract does the opposite, it takes their JSON or XML payload, as-is, and maps each field to the correct template variable. Once that mapping is set up and saved, it can be reused across multiple templates.
At generation time, the customer simply sends their data in their own format, and the system automatically applies the saved mapping to fill in the right placeholders, including repeating tables and any values that need extra logic or calculation.
In short: the contract adapts to the customer's data, not the other way around.
Importing Your JSON/XML into Perfect Doc Studio
1. Navigate to Business Contracts under the Manage Business Data menu.
2. Click Create New Contract.
3. In the top-right corner, click Import JSON/XML to import your payload structure.
4. Once imported, your payload will appear as shown below. For this example, I have uploaded a sample Claim Statement JSON. As you can see, the payload contains multiple fields along with their corresponding values.
5. You can now replace the sample values with the corresponding variables using the Entity.Attribute format.
6. For each field, enter the corresponding variable available in Perfect Doc Studio. For example, next to "fullName" enter "Customer.Name" and next to "policyNumber", enter "Policy.Number".
Similarly, map the appropriate variables to all the available values.
7. Within the Mapping area, you also have the option to create a new variable if the desired variable is not already available in the system. A new Attribute can be created under an existing Entity. However, to create a new Entity, you need to navigate to the Data Variables section.
8. Once all the variables have been mapped, save the Contract. It will then appear on the Contracts page.

Mapping a Business Contract to a Document Design
1. Navigate to the Document Settings tab.
2. Under General, click on the Business Contracts dropdown.
3. Enable the Enable Data Mapping option.
4. Once enabled, a dropdown will appear, allowing you to select the Business Contract created earlier.
5. Select the required Business Contract. It will then be mapped to the document template.
6. If you disable Data Mapping at any point, the system will display the following message:
"Enabling business contract data mapping will affect transactions currently in progress. Any PDFs being generated may use the new data transformation rules. Are you sure you want to proceed?"
Please make sure you understand the impact before proceeding.
Important points to note
Field names are flexible. The customer can name their JSON/XML keys however their own system already does, there's no requirement to match template variable names.
Only fields the template actually needs are pulled in. A contract can hold many mapped variables, but each template consumes just the subset relevant to it.
JSON and XML are both accepted, but only these two formats, the payload must be uploaded in one of them.
A contract must be linked to a template before it takes effect. Creating and saving the contract alone doesn't connect it to any template until that link is made in the template's settings.
One contract can serve multiple templates, so the same mapping doesn't need to be recreated for every document type that uses similar data.