{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"7d62b4ae-0caa-4e42-b477-b1c22f5fac99","name":"Foxit APIs","description":"# Overview\n\nFoxit offers a comprehensive suite of REST APIs powered by Foxit’s industry-leading document technology and scalable cloud infrastructure. These APIs give developers unmatched flexibility and control to design, automate, and optimize end-to-end document workflows across modern applications.\n\nFoxit’s API ecosystem includes **PDF Services APIs**, **PDF Embed APIs**, **Document Generation APIs**, and **eSign APIs**, each designed to address different stages of the document lifecycle from viewing and editing to creating, converting, signing, and managing documents at scale\n\n---\n\n## Foxit PDF Services APIs\n\nFoxit PDF Services APIs provides a set of REST APIs that allow you to perform powerful PDF operations, such as conversion, editing, merging, and more by simply making HTTP requests. These APIs are platform-independent and can be integrated into any application with ease.\n\n## Available Features\n\n### 📄 Format Conversions\n\n- Convert to/from:\n    \n    - PDF ⇄ Word\n        \n    - PDF ⇄ Excel\n        \n    - PDF ⇄ PowerPoint\n        \n    - PDF ⇄ HTML\n        \n    - PDF ⇄ Text\n        \n    - PDF ⇄ RTF\n        \n    - PDF ⇄ Images\n        \n\n### 🛠️ PDF Operations\n\n- Merge multiple PDFs\n    \n- Split PDFs into parts\n    \n- Compare document versions\n    \n- Compress file size\n    \n- Add or remove password protection\n    \n- Reorganize pages\n    \n- Flatten form fields and annotations\n    \n- Optimize for web with linearization\n    \n\n## [Read more about PDF APIs](#pdf-services-apis)\n\n## Foxit Document Generation APIs\n\nThe Document Generation APIs are built to simplify and automate the creation, formatting, and manipulation of documents in a scalable and reliable manner. Designed as a standalone solution, they are ideal for organizations that need to dynamically generate documents from templates, merge data into PDFs, or automate workflows across various departments.\n\nThese APIs can be seamlessly integrated into applications or enterprise platforms, enabling:\n\n- On-demand generation of standardized documents\n    \n- Data-driven document population from structured sources (e.g., JSON)\n    \n- Output in multiple formats such as PDF and DOCX.\n    \n\nBy leveraging these APIs, businesses can reduce manual effort, ensure document consistency, and accelerate time-to-delivery for customer-facing or internal documents.\n\n## ⭐ Key Features\n\n- **Document Template Management** 📝⚙️\n    \n    - Use predefined template documents with tags for dynamic data insertion.\n        \n    - Analyze a template document for text tags identification.\n        \n    - Embed text tags directly in document templates to automate content placement.\n        \n- **Input Data** 📃➕\n    \n    - Include your template document as a Base64 encoded file string.\n        \n    - Text tags are replaced with actual values from input data. It maps values directly to text tags within your template document.\n        \n- **Document Generation** 🔧📃\n    \n    - Combines structured data and template documents to produce polished, ready-to-use documents.\n        \n    - Choose your desired output format, such as PDF or DOCX.\n        \n\n## [Read more about Document Generation APIs](#document-generation-apis)\n\n---\n\n## eSign APIs\n\nFoxit eSign is the #1 easiest and most collaborative contract management and eSignature solution, offering a wide range of robust features for seamless agreement workflows.\n\n### ✅ Key Features\n\n- Collaborative contract and agreement building\n    \n- Template-based contract creation\n    \n- eSignature workflows supporting single or multiple users\n    \n- Advanced bulk eSignature with dashboard and notification controls\n    \n- API integration for seamless connectivity with other software or websites\n    \n- Developer tools to embed Foxit eSign in custom applications or workflows\n    \n\n---\n\n## 🛠️ Ways to Build with eSign\n\nFoxit eSign provides flexible integration options to suit your development environment:\n\n### 1\\. 🔗 REST API\n\n- Allows data exchange over HTTPS\n    \n- Easily integrates with web, server-side, or native applications\n    \n- Commonly used for:\n    \n    - Generating documents server-side\n        \n    - Automating eSignature workflows\n        \n\n### 2\\. 💻 SDKs (Software Development Kits)\n\n- Available for .NET, Java, PHP, Python, Ruby, and TypeScript\n    \n- Wraps API calls for frequently used development scenarios\n    \n- Simplifies embedding Foxit eSign in custom web apps\n    \n\n### 3\\. 🌐 Embed Foxit eSign\n\n- Use an to embed Foxit eSign templates in your web views\n    \n- Customize and complete document signing directly within your application\n    \n- Ideal for allowing users to:\n    \n    - Review\n        \n    - Fill\n        \n    - Sign\n        \n    - Save document copies seamlessly\n        \n\n### 4\\. 🔌 Platform Integrations\n\n- Native integration with popular CRM, financial, helpdesk, and productivity tools\n    \n- Lets you access Foxit eSign features directly from your existing platforms\n    \n\n---\n\n## 🔔 Webhooks – Real-Time System Updates\n\nKeep your internal systems in sync with automatic updates via Webhooks.\n\n- Webhooks notify your system about document events (e.g., signer completed, document executed)\n    \n- Foxit eSign sends an HTTP POST with a JSON payload containing:\n    \n    - `event_name`\n        \n    - `event_date`\n        \n    - `data` (event-specific details)\n        \n\n## [Read more about eSign APIs](#esign-apis)\n\n# Getting Started\n\nTo get started with the Document Generation APIs and PDF Services APIs, first create a Foxit Developer account. Once registered, you will receive the API credentials required to begin integration.\n\nFollow the steps below to quickly set up your environment and start using the APIs:  \n👉 **Start here**: [Foxit Developer Portal](https://app.developer-api.foxit.com/)\n\n**Important**: Foxit eSign APIs use a separate account and dashboard from other Foxit API services.  \nTo integrate the eSign APIs, you must create an account in the Foxit eSign Portal to obtain your eSign API credentials.\n\n👉 **Foxit eSign Login**: [Foxit eSign Portal](https://login.foxitesign.foxit.com/)\n\n---\n\n## Step 1: Create Account\n\n- Visit the Foxit Developer Portal.\n    \n- Click **Register** and fill in the required details.\n    \n- Verify your email address to activate your account.\n    \n- After login, you'll be taken to the Foxit APIs Dashboard.\n    \n\n> The account created provides access only to the PDF Services APIs and Document Generation APIs. \n  \n\n<img src=\"https://content.pstmn.io/cf5e4948-2c26-4dda-9797-18992fda2edd/aW1hZ2UucG5n\" alt=\"Foxit%20Developer%20Portal\" width=\"596\" height=\"442\">\n\n## Step 2: Request API Access Credentials\n\nOnce logged in:\n\n- Navigate to the Foxit APIs Dashboard.\n    \n- On the left panel, click `Orders`.\n    \n- It will show all the plans along for their respective set of APIs.\n    \n\n<img src=\"https://content.pstmn.io/f2c750f3-eba2-4c69-b6c9-c91abcc2466e/aW1hZ2UucG5n\" alt=\"Orders%20Section\" width=\"580\" height=\"209\">\n\n- Choose the APIs you want to use:\n    \n    - PDF Services API\n        \n    - Document Generation API\n        \n    - PDF Embed API - [Contact Sales](https://mailto:jason_welch@foxitsoftware.com)\n        \n    - eSign API - [Contact Sales](https://mailto:jason_welch@foxitsoftware.com)\n        \n\n<img src=\"https://content.pstmn.io/eb07da7c-ff44-47c8-8f22-1b9c0284d02f/aW1hZ2UucG5n\" alt=\"API%20Services\" width=\"550\" height=\"310\">\n\n- Select your plan type:\n    \n    - 365-Day API Free Trial Access – Start testing instantly.\n        \n    - Request API Access – Submit a request for production use by clicking on **\"Select a Plan\"**.\n        \n\n> 💡 Choosing Request API Access will prompt the Foxit team to review your application. Approval typically takes 24 hours. \n  \n\n## Step 3: Get Your API Sandbox Credentials\n\nIf you selected the Free Trial Access option:\n\n- Your temporary Client ID and Client Secret will be generated instantly after project creation.\n    \n- These API credentials are valid only for the PDF Services APIs and Document Generation APIs.  \n    To access the eSign APIs, you must **create an account on the** [Foxit eSign Portal](https://login.foxitesign.foxit.com/) and coordinate with the [Sales team](https://mailto:jason_welch@foxitsoftware.com) to obtain the required credentials.\n    \n- Copy your credentials and store them securely.\n    \n- Use the credentials in your integration to begin making API calls.\n    \n\n<img src=\"https://content.pstmn.io/8acd819c-ad7e-4ca1-8eaf-a8240931cb87/VW50aXRsZWQgKDMpLnBuZw==\" width=\"481\" height=\"565\">\n\n> 🔒 Note: Trial credentials are valid for 365 days and grant access to all supported API features. \n  \n\n## Step 4: Complete Purchase (For Production Access)\n\nIf you selected Buy Now for API Access:\n\n- You will be prompted to **Contact Sales**.\n    \n\n<img src=\"https://content.pstmn.io/8ed1a674-a709-44bf-b0fc-7b4702cb3bd7/aW1hZ2UucG5n\" alt=\"Contact%20Sales\" width=\"576\" height=\"297\">\n\n- Click on **\"contact sales\"** to send the email. Provide your purchase details.\n    \n- The Foxit team will review your request and grant access within **24 hours**.\n    \n- You will receive an email confirmation along with your **API credentials**.\n    \n\n---\n\n# API Environments and Base URLs\n\nOur APIs use environment-specific URLs for seamless integration across PDF, Document Generation, and eSign services.  \nEnsure you use the correct server and authentication credentials for reliable and secure access.\n\n## PDF APIs\n\n#### US Server\n\nUse this URL for US region:\n\n| Server | Base URI |\n| --- | --- |\n| default | `https://na1.fusion.foxit.com` |\n\n## Document Generation APIs\n\n#### US Server\n\nUse this URL for US region:\n\n| Server | Base URI |\n| --- | --- |\n| default | `https://na1.fusion.foxit.com` |\n\n## eSign APIs\n\n#### US Server\n\nUse this URL for US region:\n\n| Server | Base URI |\n| --- | --- |\n| default | `https://na1.foxitesign.foxit.com/api` |\n\n#### EU Server\n\nUse this URL for the European region:\n\n| Server | Base URI |\n| --- | --- |\n| default | `https://eu1.foxitesign.foxit.com/api` |\n\n#### AU Server\n\nUse this URL for the Australia region:\n\n| Server | Base URI |\n| --- | --- |\n| default | `https://au1.foxitesign.foxit.com/api` |\n\n#### CA Server\n\nUse this URL for the Canada region:\n\n| Server | Base URI |\n| --- | --- |\n| default | `https://na2.foxitesign.foxit.com/api` |\n\n---\n\n# 🔐 Authorization - PDF Services APIs\n\nFoxit APIs use header-based authentication. To authorize your API requests, you'll need to obtain a Client ID and Client Secret.\n\n> To access the PDF Services and Document Generation APIs, create an account in the Developer Portal.  \nTo access the eSign API, create a separate account in the eSign Portal. \n  \n\n### PDF APIs\n\nFoxit PDF Services APIs use Basic Authentication via custom headers. To authenticate your API requests, you must include your Client ID and Client Secret in the request headers.\n\n#### Required Headers:\n\n- `client_id`: Your unique Client ID\n    \n- `client_secret`: Your associated Client Secret\n    \n\n> ⚠️ Important: Keep your credentials secure. Never expose them in public repositories or client-side code. \n  \n\n#### Header Example\n\n``` curl\ncurl {BASEURI}/{endpoint} \\\n--header \"client_id: YOUR_CLIENT_ID\" \\\n--header \"client_secret: YOUR_CLIENT_SECRET\" \\\n\n ```\n\n> Replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with your actual credentials. Replace {endpoint} with the specific API endpoint you're calling. \n  \n\n# PDF Services APIs\n\nFoxit PDF APIs offer a comprehensive suite of tools designed to streamline document processing, conversion, and management. Whether you're uploading source files, manipulating PDFs, or tracking document tasks, these APIs provide robust and flexible capabilities for developers.\n\n## API Categories\n\n### 📄 Document Upload\n\n- Upload source files for processing\n    \n- Supports multiple input formats\n    \n- Returns a unique `documentId` for subsequent operations\n    \n\n### 📥 Document Download\n\n- Retrieve processed documents\n    \n- Supports file streaming with appropriate headers\n    \n- Optionally specify custom filenames\n    \n\n### 🛠️ PDF Management\n\n- **Security**: Apply or remove password protection\n    \n- **Analysis**: Compare documents side-by-side\n    \n- **Modification**: Split, extract pages, flatten forms\n    \n- **Enhancement**: Add watermark, merge documents\n    \n- **Optimization**: Compress files, linearize for web\n    \n\n### 📄 PDF Creation\n\n- Convert the following formats to PDF:\n    \n    - Microsoft Office files\n        \n    - Images (PNG, JPEG, etc.)\n        \n    - HTML pages\n        \n    - Text and RTF documents\n        \n\n### 🔄 PDF Conversion\n\n- Convert PDFs into other formats:\n    \n    - Word (.docx), Excel (.xlsx), PowerPoint (.pptx)\n        \n    - Images (JPEG, PNG)\n        \n    - HTML, Plain Text, RTF\n        \n\n### 📊 Task Status\n\n- Track the progress of operations\n    \n- View real-time completion percentages\n    \n- Access final results or handle any errors gracefully\n    \n\n# 🚀Foxit PDF Services - Quick Start Guide\n\nGetting started with Foxit PDF APIs is fast and simple. Whether you're working on a web or backend platform, you can integrate document workflows in just a few steps.\n\nFollow the steps below:\n\n### 🔐 API Keys for Authorization\n\nBefore making any API calls, you’ll need your developer credentials. Follow these steps:\n\n- **Create Your Account**  \n    Sign up on the [Foxit API Developer Portal](https://developer-api.foxit.com/). This gives you access to API tools and dashboard, see detailed instructions at [Create Account](#getting-started).\n    \n\n- **Get API Trial Credentials**  \n    After account setup, retrieve your **Client ID** and **Client Secret** used for authenticating API requests. See detailed instructions at [Get Foxit API Trial Credentials](#get-foxit-cloud-api-trial-credentials).\n    \n\n### ⚙️ Document Operation Workflow\n\n**1\\. 📤 Uploading a Document**\n\n- Use the `POST /pdf-services/api/documents/upload` endpoint to upload your source file.\n    \n- Submit your file using `multipart/form-data`.\n    \n- Include your Client ID and Client Secret in the request headers for authentication.\n    \n- Receive a unique `documentId` that will be used for all subsequent API calls.\n    \n\n**Sample cURL Request**\n\n``` bash\ncurl --location 'https://na1.fusion.foxit.com/pdf-services/api/documents/upload' \\\n--header 'Content-Type: multipart/form-data' \\\n--header 'client_id: YOUR_CLIENT_ID' \\\n--header 'client_secret: YOUR_CLIENT_SECRET' \\\n--form 'file=@\"/C:/Users/Downloads/FoxitAPISampleDoc.pdf\"'\n\n ```\n\n- **Supported formats:** PDF, Microsoft Office files, images, and plain text. extensions include: `.jfif`, `.pjpeg`, `.jpeg`, `.jpe`, `.pjp`, `.jpg`, `.jpx`, `.bmp`, `.dib`, `.png`, `.gif`, `.tiff`, `.tif`, `.pdf`, `.doc`, `.docx`, `.xls`, `.xlsx`, `.ppt`, `.pptx`, `.txt`, `.html`, `.htm`, `.shtml`, `.zip`, `.gd`, `.rtf`, `.dot`, `.dotx`, `.docm`, `.dotm`, `.wpd`, `.xlt`, `.xltx`, `.xlsm`, `.xlsb`, `.xltm`, `.csv`, `.pot`, `.potx`, `.pptm`, `.ppsx`, `.ppsm`, `.potm`, `.vsd`, `.vsdx`, `.wps`, `.hwp`, `.ofd`\n    \n\n**2\\. 🛠️ Perform Operation**\n\n- Create, Convert, Flatten, Split or Compress with their respective operation endpoints. Please check out [API reference](#place-holder) for endpoint details.\n    \n- Submit a request with `documentId` and operation-specific parameters.\n    \n- All operations are **asynchronous**.\n    \n- Receive a `taskId` to monitor the operation's progress.\n    \n\n**3\\. ✅ Fetch Operation Status**\n\n- Use the `GET /pdf-services/api/tasks/:task-id` endpoint with the provided `taskId` to track the status of your operation.\n    \n- Monitor the current status, which could be one of the following:  \n    PENDING, PROCESSING, COMPLETED, or FAILED.\n    \n- Progress is tracked in real-time as a percentage (0–100%).\n    \n- Once the task is successfully completed, a `resultDocumentId` will be returned, which you’ll use to download the final file.\n    \n\n**Sample cURL Request**\n\n``` bash\ncurl --location 'https://na1.fusion.foxit.com/pdf-services/api/tasks/6838c9c66b1cc44ab40040c5' \\\n--header 'client_id: YOUR_CLIENT_ID' \\\n--header 'client_secret: YOUR_CLIENT_SECRET' \\\n--header 'Authorization: Basic Og=='\n\n ```\n\n**Sample Response**\n\n``` json\n{\n    \"taskId\": \"6838c9cxxb1cc44abxxx40c5\",\n    \"status\": \"COMPLETED\",\n    \"progress\": 100,\n    \"resultDocumentId\": \"683xx9cf6b1ccxxxb40040cb\"\n}\n\n ```\n\n**4\\. 📥 Download Result**\n\n- Use the `GET /api/documents/:document-id/download` endpoint with the `resultDocumentId` to retrieve the final processed document.\n    \n- Download supports content streaming with appropriate content-type headers.\n    \n- Optionally specify a custom filename.\n    \n\n``` bash\ncurl --location 'https://na1.fusion.foxit.com/pdf-services/api/documents/6838c9cf6b1cc44ab40040cb/download?filename=financial-report-2023' \\\n--header 'client_id: YOUR_CLIENT_ID' \\\n--header 'client_secret: YOUR_CLIENT_ID'\n\n ```\n\n---\n\n## ⚠️ Error Handling\n\nThe Foxit PDF API implements standard HTTP status codes to indicate the outcome of API requests. In the event of an error, a structured response is returned, making it easier for developers to diagnose and resolve issues.\n\n| Status Code | Meaning | Description |\n| --- | --- | --- |\n| `400` | Bad Request | The request parameters are missing or malformed. |\n| `401` | Unauthorized | The API key is missing or invalid. |\n| `404` | Not Found | The requested resource could not be located. |\n| `413` | Payload Too Large | The file exceeds the maximum allowed size. |\n| `500` | Internal Server Error | An unexpected error occurred on the server side. |\n\n### 🧾 Error Response Format\n\nEach error response includes the following fields:\n\n- **Error Code**: Identifies the type of error.\n    \n- **Message**: A human-readable explanation of what went wrong.\n    \n- **Details (optional)**: Additional technical information or context to assist with debugging.\n    \n\n### ✅ Best Practices\n\n### Asynchronous Operations:\n\n- Remember that all operations are asynchronous.\n    \n- Always confirm task status before attempting to download results.\n    \n- Integrate thoughtful retry logic for reliable task completion.\n    \n\n---\n\n## File Size Limits\n\n- The maximum file size supported for PDF Services APIs is **100 MB**.\n    \n- For Word to PDF conversion, the file size is limited to **50 MB**.\n    \n\n---\n\n## Support & Assistance\n\n- **Foxit Support Center:** Your first stop for comprehensive help resources, tutorials, and FAQs. For more details check out [Support Center.](https://kb.foxit.com/s/)\n    \n- **API Status Updates:** Keep an eye on the health and performance of our APIs.\n    \n- **Direct Technical Support:** For personalized troubleshooting and issue resolution, connect with our technical experts at [<b>support@foxitsoftware.com</b>](https://mailto:support@foxitsoftware.com)**.**\n    \n\n---\n\n## Next Steps\n\nTo get the most out of your integration, here's what we recommend:\n\n- **Dive into the API Reference:** For comprehensive details on every endpoint, request, and response, explore our full API documentation.\n    \n- **Try the Quick Start Example:** Get up and running fast by working through our quick start guide. It's the best way to see the API in action.\n    \n- **Contact Sales for Production Keys:** When you're ready to go live, reach out to our sales team to acquire your production API keys.  \n    [Contact Sales](https://mailto:jason_welch@foxitsoftware.com)\n    \n\n# 🔐 Authorization - Document Generation APIs\n\n### Document Generation APIs\n\nFoxit Document Generation APIs use Basic Authentication via custom headers. To authenticate your API requests, you must include your Client ID and Client Secret in the request headers.\n\n#### Required Headers:\n\n- `client_id`: Your unique Client ID\n    \n- `client_secret`: Your associated Client Secret\n    \n\n> ⚠️ Important: Keep your credentials secure. Never expose them in public repositories or client-side code. \n  \n\n#### Header Example\n\n``` curl\ncurl {BASEURI}/{endpoint} \\\n--header \"client_id: YOUR_CLIENT_ID\" \\\n--header \"client_secret: YOUR_CLIENT_SECRET\" \\\n\n ```\n\n> Replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with your actual credentials. Replace {endpoint} with the specific API endpoint you're calling. \n  \n\n# Document Generation APIs\n\nThe Document Generation API enables dynamic creation of professional, data-driven documents using pre-defined templates. By embedding smart text tags within your documents and supplying structured data, you can automate the generation of PDF or DOCX files with precision and efficiency.\n\nTo automate the creation of documents with dynamic data, Foxit offers two powerful APIs designed to work together seamlessly:\n\n1. **🔍 Analyze Document API**  \n    This API scans your uploaded template document to detect all embedded text tags (placeholders). It returns a detailed list of identified tags, enabling you to understand which variables need to be mapped and how to structure your input data.\n    \n2. **📄 Generate Document API**  \n    This API takes your Word template (as a Base64-encoded string) and structured input data (JSON), and dynamically injects values into the corresponding text tags. The result is a fully formatted, ready-to-use document output in PDF or DOCX format.\n    \n\nThese APIs streamline the entire document automation process from understanding your template structure to generating polished, data-populated documents.\n\n---\n\n## 📝 How to Generate Documents Dynamically\n\nWe offer RESTful APIs for document generation, enabling users to send requests and receive dynamic document outputs. These endpoints support key operations such as template creation, data submission, and document generation. All communications are secured, with built-in mechanisms to ensure authentication and authorization of each request.  \nOur APIs empower you to generate documents efficiently through the following key steps:\n\n✔️ Prepare Word template with text tags\n\n✔️ Prepare JSON with matching keys\n\n✔️ Convert document to Base64\n\n✔️ Make API call to generate final document\n\nLet's dive into the step by step process\n\n## 🧩 Step 1: Create Your Template\n\nTo generate a document, the first step is to create a template where values can be dynamically inserted.  \nThis template could be any document such as a contract, agreement, or form.\n\n### Add Text Tags on Document\n\nText tags act as placeholders that will be replaced with actual values when data is sent through the API.  \nYou can add text tags directly within your Word document using double curly braces, like `{{Foxit}}`.\n\nThe invoice template below showcases the use of dynamic elements like styled tables, repeating data, calculations, and conditional logic. These features help generate fully customized documents during document generation.\n\n<img src=\"https://content.pstmn.io/306935ac-9052-4be7-b7d8-ac6eb0b17d42/V29yZCBUZW1wbGF0ZSBFeGFtcGxlLnBuZw==\" alt=\"Word%20Template%20Screenshot\" width=\"545\" height=\"431\">\n\n| Reference Number | Description |\n| --- | --- |\n| 1 | A page header. Each page can have its own header or you can repeat headers across pages. |\n| 2 | A reserved keyword, `today`, formatted in a specific data format. (reference here) |\n| 3 | A simple string `AccountName` which will pre-populated with a string value using the Document Generation API |\n| 4 | A Date Field formatted using the `\\@ MM/dd/yyyy` formatting parameter. |\n| 5 | A table defined within a table group which will create multiple tables depending on unique product codes. |\n| 6 | A `=SUM(ABOVE)` calculation field that will dynamically populate the total purchase price based on the values provided via `documentValues` of the last column in the table. |\n| 7 | A native merge field used to conditionally generate the terms and conditions depending on if the `ShowAgreement` field is passed as `true` when making the `GenerateDocument` call |\n| 8 | An eSignature text tag for dynamically creating an eSignature field. The signature field will be automatically placed when uploaded into Foxit eSign.  <br>  <br>Note that the signature field is declared as grey in this example, but can be fully transparent in an actual document. |\n\nWhen merged, the placeholder merge fields are replaced with the data provided from the `documentValues` JSON object from Generate Document API Request. This merged template appears as below:\n\n<img src=\"https://content.pstmn.io/e3cce981-512c-4ab2-9302-a2366f70a7aa/V29yZFRlbXBsYXRlR2VuZXJhdGVkLnBuZw==\" width=\"580\" height=\"524\">\n\n### How to Add Text Tags\n\nText tags in the document must match the variable names in your JSON payload. Here's how you can use them with different data formats:\n\n#### **Simple Strings**\n\nYou can directly insert simple string variables in your template using curly braces.  \nExample:\n\n```\nMy name is {{name}}; I am {{age}} years old.      \n\n ```\n\n**JSON Example**:\n\n```\n{\n    \"name\":\"Peter\", \n    \"age\":30\n}    \n\n ```\n\n_Output_: `My name is Peter; I am 30 years old.`\n\n#### **Dates**\n\nYou can insert the current date or format specific date fields using text tags in your document.  \nTo insert today's date use the following text tag:\n\n```\n{{today \\@ MM/dd/yyyy}}     \n\n ```\n\n> Note: You do not need to pass this value in the JSON. The tag will automatically insert the current system date in the specified format. \n  \n\nFor Date Field formatting: `{{FIELD_NAME \\\\@ DATE_FORMAT}}` text tag may be applied.  \nTo format a date from your JSON see the below example:\n\n```\nPayment Due Date is {{PaymentDueDate \\@ MM/dd/yyyy}}\n\n ```\n\n**JSON Example**:\n\n```\n{\n    \"PaymentDueDate\": \"06/02/2025\"\n}    \n\n ```\n\n_**Output**_: `Payment Due Date is 06/02/2025`\n\nThe following field codes are supported for Date Format:\n\n| **Date Format Supported** | **Field Codes** |\n| --- | --- |\n| Month/Day/Year | `MM/dd/yyyy` |\n| Non-padded month/day | `M/d/yyyy` |\n| Day/Month/Year (EU format) | `dd/MM/yyyy` |\n| ISO 8601 format | `yyyy-MM-dd` |\n| Full month name | `MMMM d, yyyy` |\n| Abbreviated month | `MMM d, yyyy` |\n| European text format | `d MMM yyyy` |\n| Full date + month names | `dddd, MMMM d, yyyy` |\n| Abbreviated weekday/month | `ddd, MMM d` |\n\n#### **Tables**\n\nYou can dynamically populate tables with rows and columns using text tags. To begin a table, use the `{{TableStart:field_name}}` tag. To close the table, add the `{{TableEnd:field_name}}` tag in the last column of the final row in your Word document.\n\nExample usage in a Word document:\n\n| SI | Qty | Total |\n| --- | --- | --- |\n| `{{TableStart:OpportunityLineItems}}` | `{{OpportunityLineItems.quantity}}` | `{{OpportunityLineItems.totalprice}}` `{{TableEnd:OpportunityLineItems}}` |\n\nThe tags like `{{OpportunityLineItems.quantity}}` and `{{OpportunityLineItems.totalprice}}` will be replaced with actual values from your JSON input during document generation. Each entry in the `OpportunityLineItems` array will generate a new row in the table.\n\n_Output_:\n\n<img src=\"https://content.pstmn.io/caf28a92-e031-4ca3-9fb2-5e8f302d6a78/aW1hZ2UucG5n\" alt=\"Output%20of%20Table%20Values\" width=\"604\" height=\"403\">\n\n#### **Formula for SUM**\n\nThe text tag `=SUM(ABOVE)` calculation fields are supported in tables. If a `=SUM(ABOVE)` field is added as its own row in a table, it will take the values of the last column in the table and dynamically calculate the total sum.\n\nExample usage of SUM formula:\n\n| SI | Qty | Total |\n| --- | --- | --- |\n| `{{TableStart:OpportunityLineItems}}` | `{{OpportunityLineItems.quantity}}` | `{{OpportunityLineItems.totalprice}}` `{{TableEnd:OpportunityLineItems}}` |\n|  |  | **Total Purchase Price**: `{{=SUM(ABOVE)}}` |\n\n_Output_:\n\n<img src=\"https://content.pstmn.io/8bbc1067-7bd6-4041-ba68-6ce171bb9aa2/aW1hZ2UucG5n\" alt=\"Output%20of%20SUM%20formula\" width=\"608\" height=\"414\">\n\n#### **eSignature Fields**\n\nAn eSignature text tag for dynamically creating an eSignature field. The signature field will be automatically placed when uploaded into Foxit eSign.\n\nExample of esignature field text tag:\n\n_For Signer 1_\n\n```\n${signfield:1:y:____}\n\n ```\n\n_For Signer 2_\n\n```\n${signfield:2:y:____}\n\n ```\n\nCheck out more examples from our eSign API documentation here(link)\n\n#### Adding Conditional Blocks\n\nTo add **conditional logic** in your Word template, you can use mail merge fields to render specific content based on the data you provide.\n\n##### Enable Field Code View\n\nFirst, enable the visibility of field codes in your document:\n\n- Press `ALT + F9` to toggle field code view.\n    \n\n##### Insert a Conditional Field\n\nNavigate to the part of the document where you want to add a condition. Then:\n\n1. Go to the **Insert** tab.\n    \n2. Click on **Quick Parts**.\n    \n3. Select **Field**.\n    \n\nThis opens the **Field Editor**. In the left-hand list, scroll down and select If:\n\n<img src=\"https://content.pstmn.io/71f7cb7e-9c71-48ef-b6ec-be62e9ed5ff1/c2hvdDEucG5n\" width=\"690\" height=\"446\">\n\nThis will insert an `IF` field into your document (make sure you're still viewing field codes). Right click and select toggle to view field:\n\n<img src=\"https://content.pstmn.io/eccedcb0-a5d4-4e06-9b96-4a399838d6b3/c2hvdDIucG5n\" width=\"258\" height=\"49\">\n\n##### IF Field Syntax\n\n```\n{ IF \"SOMEVALUE\" = \"SOMECONDITION\" \"text to be shown if true\" \"text to be shown if false\" }\n\n ```\n\nYou can also use other operations like `<`, `<=`, `>`, and `>=`.\n\n##### Insert the Field You Want to Evaluate\n\n1. Place your cursor after `IF` inside the brackets.\n    \n2. Go to **Insert > Quick Parts > Field**, and choose **MergeField**.\n    \n3. Enter the name of the field you want to check (e.g., a field from your JSON data).\n    \n\n<img src=\"https://content.pstmn.io/48a95e69-9465-4490-928f-33667e303db7/c2hvdDMucG5n\" width=\"690\" height=\"446\">\n\nClick OK, and it will be added to your IF condition.\n\n<img src=\"https://content.pstmn.io/ca68ed59-f3e1-417b-9e18-c03e4b2651ea/c2hvdDQucG5n\" width=\"720\" height=\"48\">\n\nExample:\n\n```\n{ IF \"Country\" }  \n\n ```\n\n##### Complete the IF Statement\n\nYou're almost there. The last step is to add the condition and define the output text for both the `true` and `false` cases. Technically both are optional and can be empty strings. Here we've added a check for the value of `country`:\n\n<img src=\"https://content.pstmn.io/4bb7b8d2-08e1-4e27-b47b-34dcd24c80d1/c2hvdDUucG5n\" width=\"857\" height=\"85\">\n\nExample:\n\n```\n{ IF \"Country\" = \"true\" \"Agreement text if true\" \"Some text if other than true\" }  \n\n ```\n\n## 🗂️ Step 2: Map Data with JSON\n\nThe next step is to prepare the JSON data that will be used to inject values into your Word document template.\n\nThis JSON should be included in the request body of the Document Generation API (`/document-generation/api/GenerateDocumentBase64`) under the `documentValues` parameter as key-value pairs.\n\nEach key in the JSON should match the corresponding text tag used in your template document.\n\nLets use example of real text tags and map their values in JSON.\n\n- **Simple String** - `{{AccountName}}`, `{{Name}}`\n    \n- **Table** - `{{TableStart:OpportunityLineItems}}`, `{{OpportunityLineItems.quantity}}`, `{{OpportunityLineItems.unitprice \\# Currency }}`, `{{OpportunityLineItems.totalprice \\# Currency}}`, `{{TableEnd:OpportunityLineItems}}`\n    \n- **Date** - `{{today \\@ MM/dd/yyyy}}`, `{{PaymentDueDate \\@ MM/dd/yyyy}}`\n    \n- **SUM formula** - `{{=SUM(ABOVE) \\# Currency}}`\n    \n- **Conditional Formula** - `ShowAgreement`\n    \n\n_JSON body request_:\n\n```\n{\n  \"outputFormat\": \"pdf\",\n  \"currencyCulture\": \"en-US\",\n  \"documentValues\": {\n    \"ShowAgreement\": \"true\",\n    \"PaymentDueDate\": \"06/02/2025\",\n    \"AccountName\": \"Jordan O'Connor\",\n    \"Name\": \"Jordan\"\n    \"OpportunityLineItems\": [\n    {\n        \"OpportunityLineItems.quantity\": \"1\",\n        \"OpportunityLineItems.unitprice\": \"3500.00\",\n        \"OpportunityLineItems.totalprice\": \"3500.00\"\n    },\n    {\n        \"OpportunityLineItems.quantity\": \"2\",\n        \"OpportunityLineItems.unitprice\": \"3500.00\",\n        \"OpportunityLineItems.totalprice\": \"7000.00\"\n    },\n    {\n        \"OpportunityLineItems.quantity\": \"1\",\n        \"OpportunityLineItems.unitprice\": \"2100.00\",\n        \"OpportunityLineItems.totalprice\": \"2100.00\"\n    }\n    ]\n  },\n  \"base64FileString\": \"YOUR_DOCUMENT_BASE64_STRING\"\n}\n\n ```\n\n## 🚀 Step 3: Upload and Generate Document\n\nThe final step is to **convert your Word document template to a Base64-encoded string** and include it in the request body of the **Document Generation API**  \n`/document-generation/api/GenerateDocumentBase64`.\n\nTo specify the output format:\n\n- Set the parameter **`outputFormat`** to `\"DOCX\"` to receive a **Word document** as output.\n    \n- Set it to `\"PDF\"` to receive a **PDF file** instead. (Default is PDF)\n    \n\nThe API will inject the values from your JSON into the template and return the generated document in the specified format.\n\n<img src=\"https://content.pstmn.io/c0e29d8f-414f-48c6-abb0-9ccc0e3b78a7/aW1hZ2UucG5n\" width=\"600\" height=\"655\">\n\n---\n\n# 🚀Document Generation - Quick Start Guide\n\nGetting started with Foxit Document Generation APIs is designed to be **fast and simple**. Whether you're developing for a web or backend platform, you can seamlessly integrate our powerful document generation capabilities into your workflows in just a few steps.\n\n**Begin by following these steps:**\n\n### 🔐 API Keys for Authorization\n\nBefore we proceed, make sure you have finished the account creation step to get your trial or production credentials.  \nIf you haven't yet, you can do so by following the below:\n\n- **Create Your Account**  \n    Sign up on the [Foxit Cloud API Developer Portal](http://fusion-deployed.foxit.com/). This gives you access to API tools and dashboard, see detailed instructions at [Create Account](#create-account).\n    \n- **Get API Trial Credentials**  \n    After account setup, retrieve your **Client ID** and **Client Secret** used for authenticating API requests. See detailed instructions at [Get Foxit Cloud API Trial Credentials](#get-foxit-cloud-api-trial-credentials).\n    \n\n### 🔁 Add Text Tags on Document\n\nFor this example, we’ll be using a DOCX file. You can create it using any preferred online or offline document editor. Once your DOCX is ready, insert the required text tags into the file. Refer to the screenshots and sample tags below for guidance.\n\n<img src=\"https://content.pstmn.io/b59c1204-c1a0-4d88-a8f4-ad30a789a519/aW1hZ2UucG5n\" width=\"606\" height=\"637\">\n\n### 🛠️ Prepare Documents with Text Tags\n\nText Tags allow you to dynamically populate documents by linking placeholder text with values from your JSON input data using the Document Generation API.\n\nA **Text Tag** is a plain text placeholder embedded in your document. It is wrapped with double curly braces ({{ }}), where the content inside represents a variable or field name from your JSON data.\n\nWhen a document is generated, these tags are automatically replaced with actual values.  \nExample Tags:\n\n- `Account Name: {{Account.Name}}`\n    \n- `Payment Due Date: {{CloseDate}}`\n    \n\n### 📊 Analyze the Documents for Text Tags\n\nDo you have existing documents embedded with text tags and need to programmatically identify them? The **Analyze Document API** is your solution.\n\nThis API allows you to extract all defined text tags from your template documents. This capability is crucial for programmatically mapping field values, ensuring you have all the necessary variables to construct your JSON payload when generating new documents using the Document Generation API.\n\n#### How it Works\n\nSimply send your document (e.g., as a Base64 string) to the Analyze Document API. It will parse the document and return a structured list of all detected tags, categorized for easy use.\n\n#### Example cURL Request:\n\n```\ncurl --location 'https://na1.fusion.foxit.com/document-generation/api/AnalyzeDocumentBase64' \\\n--header 'client_id: 7bxxx0xx0dxx4xxdbxx5axx1axxf3xxe' \\\n--header 'client_secret: 9a8xxx4d0xx0xx2xx0xx9xx9xx90xxCx' \\\n--header 'Content-Type: application/json' \\\n--data '{\n  \"base64FileString\": \"YOUR_DOCUMENT_BASE64_STRING\"\n}'\n\n ```\n\n#### Example of Text Tags Analysis:\n\n```\n{\n    \"singleTagsString\": \"AccountName,PaymentDueDate,ROW_NUMBER,OpportunityLineItems.quantity,OpportunityLineItems.unitprice,OpportunityLineItems.totalprice,Name,today,ShowAgreement\",\n    \"doubleTagsString\": \"OpportunityLineItems\"\n}\n\n ```\n\nIn this example:\n\n- `singleTagsString` lists all individual text tags found. These correspond to fields that expect a single value.\n    \n- `doubleTagsString` identifies tags that typically represent tables or repeating sections (e.g., `OpportunityineItems` suggests a list of line items).\n    \n\nThis output provides a ready-to-use list of all dynamic fields within your template, streamlining your integration process.\n\n## Generate Documents\n\nThis is the final step in the process: generating your documents by dynamically injecting data using a JSON input. This allows you to programmatically create fully populated documents from your templates.\n\nThe JSON payload you send will contain variables that directly match the text tags within your template document. The values you provide for each variable will then be mapped onto the document, enabling comprehensive content generation.\n\n#### Example cURL Request:\n\nUse the following cURL request to generate a document. Remember to replace `\"xx5exx5xxfdxxbxx9xxxxxba8xx98xx\"` with your actual Bearer Token and `\"YOUR_DOCUMENT_BASE64_STRING\"` with your Base64 encoded template file string.\n\n```\ncurl --location 'https://na1.fusion.foxit.com/document-generation/api/GenerateDocumentBase64' \\\n--header 'client_id: 7bxxx0xx0dxx4xxdbxx5axx1axxf3xxe' \\\n--header 'client_secret: 9a8xxx4d0xx0xx2xx0xx9xx9xx90xxCx' \\\n--header 'Content-Type: application/json' \\\n--data '{\n  \"outputFormat\": \"pdf\",\n  \"currencyCulture\": \"en-US\",\n  \"documentValues\": {\n    \"ShowAgreement\": \"true\",\n    \"PaymentDueDate\": \"06/02/2025\",\n    \"AccountName\": \"Jordan O'\\''Connor\",\n    \"Name\": \"Jordan\",\n    \"OpportunityLineItems\": [\n    {\n        \"OpportunityLineItems.quantity\": \"1\",\n        \"OpportunityLineItems.unitprice\": \"3500.00\",\n        \"OpportunityLineItems.totalprice\": \"3500.00\"\n    },\n    {\n        \"OpportunityLineItems.quantity\": \"2\",\n        \"OpportunityLineItems.unitprice\": \"3500.00\",\n        \"OpportunityLineItems.totalprice\": \"7000.00\"\n    },\n    {\n        \"OpportunityLineItems.quantity\": \"1\",\n        \"OpportunityLineItems.unitprice\": \"2100.00\",\n        \"OpportunityLineItems.totalprice\": \"2100.00\"\n    }\n    ]\n  },\n  \"base64FileString\": \"YOUR_DOCUMENT_BASE64_STRING\"\n}'\n\n ```\n\nThis process allows you to effectively automate the creation of documents by programmatically populating their content.\n\n## ⚠️ Error Handling\n\nThe Foxit Document Generation API implements standard HTTP status codes to indicate the outcome of API requests. In the event of an error, a structured response is returned, making it easier for developers to diagnose and resolve issues.\n\n| Status Code | Meaning | Description |\n| --- | --- | --- |\n| `400` | Bad Request | The request parameters are missing or malformed. |\n| `401` | Unauthorized | The API key is missing or invalid. |\n| `404` | Not Found | The requested resource could not be located. |\n| `413` | Payload Too Large | The file exceeds the maximum allowed size. |\n| `500` | Internal Server Error | An unexpected error occurred on the server side. |\n\n### 🧾 Error Response Format\n\nEach error response includes the following fields:\n\n- **Error Code**: Identifies the type of error.\n    \n- **Message**: A human-readable explanation of what went wrong.\n    \n- **Details (optional)**: Additional technical information or context to assist with debugging.\n    \n\n---\n\n## File Size Limits\n\nThe initial template file must be less than **4 MB** in size to ensure optimal processing and performance.\n\n---\n\n## Next Steps\n\nTo get the most out of your integration, here's what we recommend:\n\n- **Dive into the API Reference:** For comprehensive details on every endpoint, request, and response, explore our full API documentation.\n    \n- **Try the Quick Start Example:** Get up and running fast by working through our Quick Start guide. It's the best way to see the API in action.\n    \n- **Contact Sales for Production Keys:** When you're ready to go live, reach out to our sales team to acquire your production API keys.  \n    [Contact Sales](https://mailto:jason_welch@foxitsoftware.com)\n    \n\n# 🔐 Authorization - Foxit eSign APIs\n\n### eSign APIs\n\nFoxit eSign APIs have OAuth2.0 based authentication. Generate an access token using your `client_id` and `client_secret` to access eSign APIs.\n\nThe client_id and client_secret for eSign APIs will be available on eSign Portal.  \n👉 **Foxit eSign Login**: [Foxit eSign Portal](https://login.foxitesign.foxit.com/)\n\nGenerate your access token using below cURL request\n\n```\ncurl --location '{BASEURI}/api/oauth2/access_token' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--data-urlencode 'grant_type=client_credentials' \\\n--data-urlencode 'client_id=YOUR_CLIENT_ID' \\\n--data-urlencode 'client_secret=YOUR_CLIENT_SECRET' \\\n--data-urlencode 'scope=read-write'\n\n ```\n\n> Replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with your actual credentials. Replace {endpoint} with the specific API endpoint you're calling. \n  \n\nThe bearer token is sent in the API request like this:\n\n```\ncurl {BASEURI} -H 'Authorization: Bearer {OAUTH_TOKEN}'\n\n ```\n\n# eSign APIs\n\nFoxit eSign is the #1 easiest and most collaborative contract management and eSignature software with the most robust functionality amongst its peers. This page will help you configure or install the Foxit eSign APIs and SDKs.\n\n## Prepare Documents\n\n### 📧 Creating an Envelope from PDF Files\n\nWith Foxit eSign API you can create a folder of documents and send them for signature right from your own application.\n\nTo create a folder of documents from PDF files you can either provide publicly accessible URLs to PDF documents or pass PDF documents as multipart form data and other parameters about the recipient parties, etc.\n\nWhile creating the documents from PDF files you can define various fields like text field or signature field within the document using simple Text Tags. You can assign various properties for these fields like party responsible for filling the data etc. These Text Tags will then be converted to Foxit eSign document fields.\n\nOr if you don't want to use Text Fields within the document, then you can also request to create an embedded document preparing session where you can manually drag and drop each field on the document itself without leaving your application. PDF documents with text tags.\n\n### 🔄 Preparing PDF documents with text tags\n\nHere is a PDF file with Text Tag samples: [Sample Document](https://developersguide.foxitesign.foxit.com/uploads/FoxiteSignAPISampleDoc.pdf).\n\nTo send a PDF document from your application for signature, you need to define the signature and other Foxit eSign fields in the documents, and who is allowed to fill in the data. Foxit eSign supports simple Text Tags.\n\nA Text Tag is a simple text block within your PDF document which defines the field type, the party who is responsible for it, and other field specific options.\n\nQuick Tip: When you apply Text Tags to the document, Foxit eSign does not remove or replace the Text Tags text. You can hide codified Text Tags by using the same font color as the background of the document. So the Text Tags can be used by Foxit eSign processes and it will not be visible on the document.\n\n<img src=\"https://content.pstmn.io/04314e84-d70e-4c01-9a24-5532409ddd1e/aW1hZ2UucG5n\" width=\"775\" height=\"157\">\n\n1. Field Type: One of 'textfield', 'formulafield', 'signfield', 'initialfield', 'datefield', 'checkboxfield', 'attachmentfield', 'imagefield', 'accept', 'decline' or short notations.\n    \n2. Party Number (optional): the sequence number of the recipient party from the parties list which will be responsible for filling this field.\n    \n3. Required/Optional Field: 'y' makes the field mandatory to be filled before signing while 'n' makes it optional.\n    \n4. Field Name: Optional. Assign a name to this field. Assigning names to fields is a good practice for better productivity as named fields are downloaded in the document form data report and all same named fields in a document will automatically take up the value typed once in any one of those fields. Please note not to include any space character for the name of field (or anywhere else in the Text Tag) as it will then not recognize that word as a proper Text Tag syntax, instead you can use underscore which will then be replaced with space character in the final Foxit eSign field.\n    \n5. Underscores: Optional. A way to increase the field's width.\n    \n\nThere are other options that you can add before underscores for various other properties as follows:\n\n### Sizing\n\nBy default, the new field has the same width and height as the original text tag, however it can be overridden by adding custom width as 90 and height as 20 (in pixels):\n\n`${textfield:1:y:field_name:90:20}`\n\n### Validation\n\nYou also can validation information for text fields inside the tags. For example, the max number of characters required are 12 and only Numbers:\n\n`${textfield:1:y:field_name:90:20:12:Numbers}`\n\nAnd if you want to stick to default height and width for the new field (which is the height and width of the text tag)\n\n`${textfield:1:y:field_name:::12:Numbers}`\n\nNOTE: validation inputs are currently only available for textfields\n\n### Font Style\n\nYou can also control the font style for each new field via their text tags. For example, the following tag creates a textfield with 14 font size and gray as font color\n\n`${textfield:1:y:field_name:90:20:12:Numbers:14:gray}`\n\nYou can pass pre-filled value to the textfields via its text tags as shown below. Please make to replace any space character with '_' (underscore) else the system may not recognize that text tag.\n\n`${textfield:1:y:field_name:90:20:12:Numbers:14:gray:default_value}`\n\n**NOTE**: pre-filled values are currently only available for textfields\n\n### Mark as Dependent Field\n\nYou can make a field dependent on any other field value. To set a field dependent on another field, select the values of the independent field that will enable the signer to see the dependent field.\n\n`${t:1:y:field_name:90:20:12:Numbers:14:gray:default_value:parent_field_name:value_of_parent_field:options}`\n\n| Column | Description |\n| --- | --- |\n| parent_field_name | Name of the parent field.  <br>NOTE: Only the following type of fields are allowed as the parent or independent field: `textfields`, `textbox, checkbox`, `radiobutton`, `dropdown` |\n| value_of_parent_field | Value of the parent field.  <br>NOTE: In the case of radio button and checkbox, the value can be either checked or unchecked |\n| options (optional) | In the case of textfield, the value can be either `isblank` or `allowNull` or `contains` |\n|  |  |\n\n### **The full list of Field Types is:**\n\nTextField - `textfield` or `t` (short notation)  \nTextBox - `textboxfield` or `tb` (short notation)  \nSignature - `signfield` or `s`  \nFormulaField - `formulafield` or `ff`  \nInitial - `initialfield` or `i`  \nDate - `datefield` or `d`  \nCheckbox - `checkboxfield` or `c` (recommended)  \nRadio Button - `radiobuttonfield` or `rb` (recommended)  \nSecured Field - `securedfield` or `sc`  \nAttachment Field - `attachmentfield` or `a`  \nImage Field - `imagefield` or `img`  \nSigner Name Field - `textfield` or `t`  \nDate Signed - `datefield` or `d`  \nAccept Button - `accept` or `ab`  \nDecline Button - `decline` or `db`  \nPayField - `payfield` or `pf`  \nExamples\n\n- `${textfield:1:y:client_name:________}` - A mandatory textfield which is assigned to party number 1 with field name as 'client name'.\n    \n- `${tb:1:n:________________}`\\- An optional textbox assinged to party 1.\n    \n- `${signfield:1:y:____}` - A mandatory signature field assigned to party number 1.\n    \n- `${i:2:n}` - An optional initial field assigned to party number 2.\n    \n- `${datefield:2:n::____}` - An optional date field assigned to party number 2 with empty field name.\n    \n- `${c:2:y:male:gender}` - A checkbox assigned to party number 2 with initial value as checked with name 'male' and group 'gender'.\n    \n- `${c:1:y:yes:group-y}` - A checkbox assigned to party number 1 with initial value as checked with name 'yes' and group 'group'. 'group-y' means group mandatory.\n    \n- `${rb:1:n:yes:grp1}` - An un-selected radio button assigned to party 1 with name yes and grp 'grp1'.\n    \n- `${rb:1:y:no:group2-y}` - A radio button assigned to party number 1 with initial value as checked with name 'no' and group 'group2'. 'group2-y' means group mandatory.\n    \n- `${sc:2:n:Credit_Card_Number:4:____}` - A secured field assigned to party 2 which is optional with name 'Credit Card Number' and only last 4 characters to remain unmasked.\n    \n- `${attachmentfield:1:y:____}` - A mandatory attachment field assigned to party number 1.\n    \n- `${img:1:n:stamp_image:120:50:__}` - An optional image field is field name as 'stamp image' with 120-pixel width and 50-pixels height which is assigned to party number 1.\n    \n- `${textfield:1:y:Signer_Name:________}` - A mandatory signer name field which is assigned to party number 1 with field name as 'Signer_Name'. This field is auto-populated once the document is opened by the signer.\n    \n- `${datefield:1:y:Date_Signed:_______}` - A mandatory date signed field assigned to party number 1 with field name as 'Date_Signed'. This field will auto populate once the document is opened by the signer.\n    \n- `${accept:1:90:20}` - A accept button field with 90-pixel width and 20-pixel height assigned to party number 1.\n    \n- `${decline:1:90:20}` - A decline button field with 90-pixel width and 20-pixel height assigned to party number 1.\n    \n- `${payfield:1:paymentType:payeeOptions:productAndService:paymentDescription:paymentAmount}` - Tag consolidates Payment Type, Product/Service, Payment Description, and Payment Amount to utilize the payment field.\n    \n\n**Personalized Fields:**\n\nWe can use the personalized field tag while sending it via API in place of process tags. Personalized field creation instructions can be seen in the help center.\n\nExamples:\n\n- `${field_7:1}` - Using this format, you can simply use the existing personalized field name and properties assigned to party #1.\n    \n- `${field_15:1:y:field_name:90:20}` - Using this format, you can simply use the existing personalized field name.\n    \n\n## 🧑‍🤝‍🧑 Preparing PDF documents with Recipient Party Tags\n\nTo send a PDF document from your application for signature, you can either define the recipient parties in the documents itself or send the recipients information via API call. Foxit eSign supports simple Text Tags for recipient party information. In case both API call and Tags on the PDF are provided with Recipient Party information, Foxit eSign will use API call values.\n\nA **Recipient Party Tag** is a simple text block within your PDF document that defines the party, who is responsible for filling the fields.\n\n**Quick Tip:** When you apply Recipient Party tags to the document, Foxit eSign does not remove or replace the Recipient Party Tags text. You can hide codified Recipient Party Tags by using the same font color as the background of the document, so the Recipient Party tags will be used by Foxit eSign to derive signers. Still, the tags will not be visible on the document.\n\n<img src=\"https://res.cloudinary.com/apimatic/image/upload/v1649285065/61dc3e7910159e19c2e42018/61dc3e7910159e19c2e42018--image.png\" alt=\"alt text\">\n\n1. **Tag Type:** Accepts only value as rp, which is an identifier of recipient party tags.\n    \n2. **Party First Name:** First name of the recipient party.\n    \n3. **Party Last Name:** Last name of the recipient party.\n    \n4. **Party email:** Email of the recipient party.\n    \n5. **Party permission:** Use this field to assign folder permissions to a recipient. Can be any one of the following values: FILL_FIELDS_AND_SIGN, FILL_FIELDS_ONLY, SIGN_ONLY, VIEW_ONLY\n    \n6. **Party workflow sequence:** If the document is signed in sequence, the recipient party will receive the notification as per the workflow sequence number. It should be starting with 1 like 1,2,3,4, etc.\n    \n7. **Party sequence:** Assign a sequence number to a recipient in the list of recipient parties. Use unique sequence numbers or party numbers for each party, starting with 1 like 1,2,3,4, etc.\n    \n\n## 💽 Adding Fields in Documents via API\n\nFields can also be added on the documents via an array of JSON objects in the input data for the API request. This way of adding fields gives you more control over the size of fields, their font color and font size, etc.\n\nWhile adding the fields on each document page, the position of the fields is relative to the top left corner of that page.\n\nEach field object must contain the following values:\n\n1. type - (string) the type of field to be added at this place. Can be one of these values: text|signature|initial|textbox|date|secure|checkbox|radiobutton|dropdown|attachment|image|accept|decline.\n    \n2. x - (int) the x location coordinate of the top left corner of the field in pixels\n    \n3. y - (int) the y location coordinate of the top left corner of the field in pixels\n    \n4. width - (int) the width of field in pixel\n    \n5. height - (int) the height of field in pixel\n    \n6. documentNumber - (int) the document index in the document files array starting from 1\n    \n7. pageNumber - (int) page in the document where field needs to be added\n    \n\nThere are other parameters which can be optional and different for different field types.\n\n`text` or `textbox` type\n\n- party - (int) party index from the parties submitted in this request starting from 1\n    \n- name - (string)\n    \n- tooltip - (string)\n    \n- value - (string)\n    \n- required - (boolean) value: either true or false\n    \n- textAlignment - (string) value: left, center, or right\n    \n- characterLimit - (int)\n    \n- fontSize - (int)\n    \n- fontColor (string) example: #0000FF for blue\n    \n- validation (string) value: any one from None(default) or Numbers or Letters or RegexValidation(in case of text type) or CanadianSin(Canadian SIN Number)\n    \n- hideFieldNameForRecipients - (boolean) value: either true or false\n    \n\n`formulafield` type\n\n- party - (int) party index from the parties submitted in this request starting from 1\n    \n- formulafieldName - (string)\n    \n- formula - (string)\n    \n- fontFamily - (string)\n    \n- documentNumber - (int)\n    \n- fontSize - (int)\n    \n- fontColor (string) example: #0000FF for blue\n    \n- x - (int) the x location coordinate of the top left corner of the field in pixels\n    \n- y - (int) the y location coordinate of the top left corner of the field in pixels\n    \n- width - (int) the width of the field in pixel\n    \n- height - (int) the height of the field in pixel\n    \n- pageNumber - (int) page in the document where field needs to be added\n    \n- tabOrder - (int)\n    \n- decimalPlaces - (int)\n    \n\n`payfield` type\n\n- payeeOptions - (string) Specify payment methods for the payee to choose from any of the following options:\\[\"CardPayment\"\\] or \\[\"AchBankPayment\"\\] or \\[\"CardPayment\", \"AchBankPayment\"\\]\n    \n- paymentType - (string) Determines payment amount type: \"Fixed\" or \"Payee decides\". Note: \"Payee_decides\" in case of text tag.\n    \n- paymentAmount - (string) Required for 'Fixed' payment type, must be an integer or have up to two decimal places\n    \n- paymentDescription - (string) Description of the payment (Character limit: 250)\n    \n- productAndService (string) Name of the product or service (Character limit: 75)\n    \n- documentNumber - (int)\n    \n- pageNumber - (int) page in the document where field needs to be added\n    \n- x - (int) the x location coordinate of the top left corner of the field in pixels\n    \n- y - (int) the y location coordinate of the top left corner of the field in pixels\n    \n- tabOrder - (int)\n    \n- width - (int) the width of the field in pixel\n    \n- height - (int) the height of the field in pixel\n    \n- party - (int) party index from the parties submitted in this request starting from 1  \n    **Note**:\n    \n    1. The Payment field is available exclusively in the US region and initially supports payments only in US Dollars.\n        \n    2. The Super Admin must create a merchant account to use the Payment field.\n        \n\n`signature` or `initial` type\n\n- party - (int)\n    \n- required - (boolean) value: either true or false\n    \n\n`date` type\n\n- party - (int) party index from the parties submitted in this request starting from 1\n    \n- name - (string)\n    \n- tooltip - (string)\n    \n- value - (string)\n    \n- required - (boolean) value: either true or false\n    \n- textAlignment - (string) value: left, center, or right\n    \n- fontSize - (int)\n    \n- fontColor (string) example: #0000FF for blue\n    \n- dateFormat (string) example: MM-DD-YYYY for 04-30-2019\n    \n\n`secure` type\n\n- party - (int) party index from the parties submitted in this request starting from 1\n    \n- name - (string)\n    \n- tooltip - (string)\n    \n- value - (string)\n    \n- required - (boolean) value: either true or false\n    \n- fontSize - (int)\n    \n- fontColor (string) example: #0000FF for blue\n    \n- charToDisplay (int)\n    \n- hideFieldNameForRecipients - (boolean) value: either true or false\n    \n\n`checkbox` type\n\n- party - (int) party index from the parties submitted in this request starting from 1\n    \n- name - (string)\n    \n- tooltip - (string)\n    \n- group - (string)\n    \n- required - (boolean) value: either true or false\n    \n- multicheck - (boolean) value: either true or false\n    \n- hideCheckboxBorder - (boolean) value: either true or false\n    \n\n`dropdown` type\n\n- party - (int) party index from the parties submitted in this request starting from 1\n    \n- name - (string)\n    \n- tooltip - (string)\n    \n- value - (string)\n    \n- required - (boolean) value: either true or false\n    \n- fontSize - (int)\n    \n- fontColor (string) example: #0000FF for blue\n    \n- options (array of strings)\n    \n\n`attachment` type\n\n- party - (int) party index from the parties submitted in this request starting from 1\n    \n- name - (string)\n    \n- tooltip - (string)\n    \n- required - (boolean) value: either true or false\n    \n\n`image` type\n\n- party - (int) party index from the parties submitted in this request starting from 1\n    \n- name - (string)\n    \n- tooltip - (string)\n    \n- required - (boolean) value: either true or false\n    \n- inputType - (string) value: either url or base64\n    \n- imageName - (string) image name with extension(png, jpg or jpeg)\n    \n- source - (string) value: either url or base64 value\n    \n\n`signer name` type\n\n- party - (int) party index from the parties submitted in this request starting from 1\n    \n- name - (string)\n    \n- tooltip - (string)\n    \n- required - (boolean) value: either true or false\n    \n- fontSize - (int)\n    \n- fontColor (string) example: #0000FF for blue\n    \n- readOnly - (boolean) value: either true or false\n    \n- systemField - (boolean) value: either true or false\n    \n\n`date signed` type\n\n- party - (int) party index from the parties submitted in this request starting from 1\n    \n- name - (string)\n    \n- tooltip - (string)\n    \n- required - (boolean) value: either true or false\n    \n- textAlignment - (string) value: left, center, or right\n    \n- fontSize - (int)\n    \n- fontColor (string) example: #0000FF for blue\n    \n- dateFormat (string) example: MM-DD-YYYY for 04-30-2019\n    \n- readOnly - (boolean) value: either true or false\n    \n- systemField - (boolean) value: either true or false\n    \n\n`accept` or `decline` type\n\n- party - (int)\n    \n\n## Apply a Template while uploading the documents\n\n- You can copy template fields to the document via API while using the call: /folders/createfolder\n    \n- To copy template fields while uploading the document, add the following to your document folder creation API call:\n    \n\n| Parameter | Description |\n| --- | --- |\n| applyTemplate (default: `false`) | Value can be either `true` or `false`.  <br>If `true`, It will process the copy template fields. |\n| templateIds | An array of template IDs you want to use to copy template fields into the documents for this folder. You can determine the template ID from the template URL.(https://{{HOST_NAME}}/templates/prepareimmutabletemplate?template.templateId={TEMPLATE_ID})  <br>  <br>  <br>  <br>  <br>  <br>  <br>  <br>  <br>  <br>  <br>  <br>  <br>  <br>  <br><br><img src=\"https://res.cloudinary.com/apimatic/image/upload/v1649285065/61dc3e7910159e19c2e42018/61dc3e7910159e19c2e42018--image.png\" alt=\"\"> |\n| templateFieldsValues (optional) | You may pass of the field values used in the templates to prefill them in the documents created from the template.`FIELD_NAME` is the name of the field used in the template. `FIELD_VALUE` is the document field value. |\n\n## Fields JSON Object Example\n\n```\n\"fields\":\n[\n    {\n        \"type\":\"text\",\n        \"x\":100,\n        \"y\":50,\n        \"width\":60,\n        \"height\":20,\n        \"documentNumber\":1,\n        \"pageNumber\":1,\n        \"tabOrder\":1,\n        \"party\":1,\n        \"name\":\"optional name\",\n        \"tooltip\":\"\",\n        \"value\":\"optional value\",\n        \"required\":true,\n        \"characterLimit\":100,\n        \"fontSize\":12,\n        \"fontColor\":\"#000000\",\n        \"validation\":\"Letters\",\n        \"hideFieldNameForRecipients\":false\n    },\n    {\n        \"type\":\"image\",\n        \"name\":\"Image_Field_Name\",\n        \"tooltip\":\"Image_Field_Description\",\n        \"party\":1,\n        \"required\":false,           \n        \"tabOrder\":1,\n        \"width\":220,\n        \"height\":150,\n        \"x\":350,\n        \"y\":350,\n        \"documentNumber\":1,\n        \"pageNumber\":1,\n        \"inputType\":\"url or base64\",\n        \"imageName\":\"logo.png\",\n        \"source\": \"URL or BASE64 String\"           \n    },\n    {\n        \"type\":\"text\",\n        \"x\":552,\n        \"y\":150,\n        \"width\":60,\n        \"height\":20,\n        \"documentNumber\":1,\n        \"pageNumber\":1,\n        \"tabOrder\":1,\n        \"party\":1,\n        \"fontSize\":8,\n        \"fontColor\":\"#eee\",\n        \"validation\":\"Numbers\"\n    },\n    {\n        \"type\":\"signature\",\n        \"x\":200,\n        \"y\":150,\n        \"width\":100,\n        \"height\":50,\n        \"documentNumber\":1,\n        \"pageNumber\":1,\n        \"party\":1\n    },\n    {\n        \"type\":\"dropdown\",\n        \"x\":200,\n        \"y\":250,\n        \"width\":80,\n        \"height\":20,\n        \"documentNumber\":1,\n        \"pageNumber\":1,\n        \"party\":1,\n        \"value\":\"US\",\n        \"options\":[\"UK\",\"Canada\",\"Australia\",\"US\",\"France\"]\n    },\n        \"type\":\"accept\",\n        \"party\":1,\n        \"documentNumber\":1,\n        \"pageNumber\":1,\n        \"x\":350,\n        \"y\":505,\n        \"width\":90,\n        \"height\":15\n    },\n    {\n        \"type\":\"decline\",\n        \"party\":1,\n        \"documentNumber\":1,\n        \"pageNumber\":1,\n        \"x\":450,\n        \"y\":505,\n        \"width\":90,\n        \"height\":15\n    },\n    {\n        \"type\":\"attachment\",\n        \"x\":200,\n        \"y\":250,\n        \"width\":80,\n        \"height\":20,\n        \"documentNumber\":1,\n        \"pageNumber\":1,\n        \"party\":1,\n        \"required\":true,\n        \"name\":\"optional name\"\n    },\n    {\n        \"type\":\"text\",\n        \"textfieldName\": \"Signer Name\",\n        \"x\":300,\n        \"y\":250,\n        \"width\":60,\n        \"height\":20,\n        \"documentNumber\":1,\n        \"pageNumber\":1,\n        \"tabOrder\":1,\n        \"party\":1,\n        \"name\":\"Signer Name\",\n        \"characterLimit\":100,\n        \"partyResponsible\": 1,\n        \"required\": true,\n        \"fontSize\": 12,\n        \"fontFamily\": \"default\",\n        \"fontColor\": \"#000000\",\n        \"readOnly\": true,\n        \"systemField\": true\n    },        \n    {\n        \"type\": \"date\",\n        \"x\":220,\n        \"y\":150,\n        \"width\":60,\n        \"height\":20,\n        \"documentNumber\":1,\n        \"pageNumber\":1,\n        \"tabOrder\":1,\n        \"party\":1,\n        \"name\":\"Date Signed\",\n        \"required\":true,\n        \"fontSize\":12,\n        \"dateFormat\": \"MM-DD-YYYY\",\n        \"readOnly\": true,\n        \"systemField\": true            \n    }\n\n ```\n\n## Embed Foxit eSign within your application\n\nThere are two different ways to embed a Foxit eSign view into an application or website.\n\n- Embedded Signing View\n    \n- Embedded Sending View\n    \n\n**Note:** In both Embedded Signing View and Embedded Sending view, please include the following script within your HTML for a better user experience:\n\n```\n<script type=\"text/javascript\" src=\"https://{{HOST_NAME}}/js/esignGeniePostMessageParent.js\">\n</script>\n\n ```\n\nPlease also set the iFrame ID as: `esignIframe`\n\n## Create embedded signing view\n\nWhen embedded signing view is enabled, you can show a document within your application.\n\nThe embedded signing view URL obtained via embeddedSessionURL will look like the following:  \n`https://{{HOST_NAME}}/embedded/embeddedsign?eetid={URL-ENCODED EMBEDDED-TOKEN}`\n\nYou can embed Foxit eSign in your application using iFrame like:\n\n``` html\n<divstyle=\"height: 100%; width: 100%; overflow: auto;\" data-role=\"content\">\n<iframe id=\"esignIframe\" src=\"[EMBED_SESSION_URL]\" style=\"width: 99% !important;height: 99% !important;position: absolute;\" frameborder=\"0\"></iframe>\n</div>\n\n ```\n\nYou can style the outer div element as per your application look and feel.\n\nFoxit eSign adds the following two more parameters to the original success url:\n\n| Parameter | Description |\n| --- | --- |\n| folderId | This is the id of the folder that was sent by the party in the embedded session. You can use this id to further query our API to get the document status, etc. |\n| event | Its value is `signing_success`, if the user successfully signs the document. Or `signing_declined`, if the user declines to sign the document. |\n\n## Create embedded sending view\n\nWhen embedded sending view is enabled, you can prepare a document within your application where you can drag and drop various fields on your document.\n\nThe embedded sending view URL obtained via embeddedSessionURL will look like the following:  \n`https://{{HOST_NAME}}/embedded/embeddedsend?eetid={URL-ENCODED-EMBEDDED-TOKEN}`\n\nYou can embed Foxit eSign in your application using iFrame like:\n\n``` html\n<divstyle=\"height: 100%; width: 100%; overflow: auto;\" data-role=\"content\">\n<iframe src=\"[EMBED_SESSION_URL]\" style=\"width: 99% !important;height: 99% !important;position: absolute;\" frameborder=\"0\"></iframe>\n</div>\n\n ```\n\nYou can style the outer div element as per your application look and feel.\n\nIn the iframe, you will see the document which the User needs to sign.\n\nOnce the user successfully sends the folder, he/she will be redirected to application success URL which you submitted in the request.\n\nFoxit eSign adds the following two more parameters to the original success url:\n\n| Parameter | Description |\n| --- | --- |\n| folderId | This is the id of the folder that was sent by the party in the embedded session. You can use this id to further query our API to get the document status, etc. |\n| event | If the user successfully sends the document, Its value is sending_success, if the user successfully sends the document. |\n\n## Reusable Templates\n\n## What is a Template?\n\nA template is a reusable form that may be used multiple times to send a document to recipients. The only changes are the signatures and data collected. Templates will only need to be set up once. Next time the form is used, it will be located under the Templates tab and contain all fields that have already been placed and saved.\n\nFoxit eSign supports multiple formats including DOC, DOCX, PDF, XLSX, XLS, PPT, PPTX, CSV, TXT, RTF, and PNG. Select a file from a device, or from cloud storage systems such as Google Drive, Box, Dropbox or OneDrive.\n\n## Preparing a Template for Reuse\n\n### Adding Parties/Roles\n\nWhen creating a template, party roles may be added under the Recipient Parties tab on the right side of the application. With a template, there are two types of parties and a few ways to add party roles.\n\n### Dynamic and Static Party Roles\n\nA dynamic party role can be assigned if the recipient’s information changes each time a document is sent out. A party can be left blank displaying Role (optional), or it can be identified with a label. For example, a common label for a party role would be ‘Client’ or ‘Patient’.\n\nA static party includes mandatory recipient information such as first name, last name, and email when added. This information does not change and is used each time a template is used to send out a document. A common use case for a static party could be a coworker that will always counter-sign or receive a copy each time a document is completed.\n\n### Add Recipient\n\nBy typing underneath , a static party can be added to the template using the name or email address of a recipient from the account's address book.\n\n### Party/Role\n\nSelect Party/Role to add an additional dynamic party role. Dynamic party roles will be labeled as PN1, PN2, etc.\n\nOptional: Name the type of role the recipient has. For example; Patient, student, legal guardian, employee, client.\n\n### Address Book\n\nSearch for a recipients name or e-mail address under the Add Recipient section allowing you to quickly add a recipient you have sent an envelope to previously.\n\n### Others\n\nYou can click Add Others to add a new recipient.\n\n### Add Yourself\n\nYou can click Add Me to add yourself as a recipient.\n\n### Permission Levels\n\nChoose different permission levels for each party.\n\n‘Fill out fields and sign’  \n‘Fill out fields only’  \n‘CC/View only’  \n‘Edit and sign’ the document  \n‘Fill out fields and sign’ is the default for all parties.\n\n### Fields\n\nThe fields will automatically be assigned to the party that is highlighted and will have a color-coded tag next to it and the color of the field corresponds with the party who is responsible for it. You can easily reassign a field to another party by clicking on the field, go to ‘Field properties’ and reassign the party.\n\nOn the left-hand side you will see your toolbox.\n\n- ‘Signature fields’ are pre-populated fields\n    \n- ‘Data entry fields’ require input from a signer\n    \n- ‘Advanced fields’ includes secured fields to use for sensitive data (SSN or bank account information for example). - Use Attachment and Image Fields for uploading files and photos\n    \n\n### Resize Field\n\nDrag the bottom corner arrow of a field to adjust the size.\n\n### Field Properties\n\nUnder Field Properties, there are various ways to customize a field. Fields can be made mandatory, checkboxes can be grouped together, text alignment can be changed, add conditional logic, set a format for input values, change font size and color.\n\n### Create an Envelope\n\nTemplates will be stored as documents inside an envelope. More templates may be added to the envelope before sending. Click the add template button and select another document.\n\n### Assign Recipients\n\nRecipients information will be added inside each party role box.\n\n### Address Book\n\nYou can search for a name or e-mail address of a recipient you have sent a document to previously and add them as a party.\n\n### Others\n\nYou can click ‘Add Others’ to add a new recipient.\n\n### Add Yourself\n\nYou can click ‘Add Me’ to add yourself as a recipient.\n\n### Authentication Levels\n\nAdditional security may be added to verify a recipients identity by using different authentication levels.\n\nNo Authentication  \nSMS Document Link  \nEmail Two-Factor Authentication  \nMobile Two-Factor Authentication  \nPhone Two-Factor Authentication  \nUser-defined Access Code  \nKnowledge Based Authentication  \nWorkflows  \nSigning sequence forces the recipients to sign in a specific order the sender set. By default all recipients can sign in parallels with each other.\n\nIn-person signing is recommended when recipients are signing physically in-person and the recipients do not have access to an email address.\n\n## 🔌 Webhooks\n\nOur webhooks enable you to monitor changes in your document folders without polling the Foxit eSign platform.\n\nWebhook is a URL handled by your application which will be called by Foxit eSign, based on certain events.  \nAs Foxit eSign is calling your application, your application should be publicly accessible on the internet.\n\nYou can add your webhook in Foxit eSign API Settings page. Also you can define the events that will cause Foxit eSign to call your webhook. Eg, you can decide whether the webhook should be called when any party signs your folder, or only when the folder is finally executed.\n\nFoxit eSign posts JSON data to your webhook. Every JSON payload posted contains event name (event_name), event date (event_date) and data related to that particular event (data).\n\n##### Configuration Page\n\nWebhooks can be configured by accessing:\n\n1. Settings tab\n    \n2. API from the left panel\n    \n3. Configure Webhooks section at the bottom of API page\n    \n\n<img src=\"https://res.cloudinary.com/apimatic/image/upload/v1664908882/61dc3e7910159e19c2e42018/61dc3e7910159e19c2e42018--webhooks11ex.png\" alt=\"alt text\">\n\n##### Webhook Access Level\n\n| Event Name | Description |\n| --- | --- |\n| Account Level | Foxit eSign calls your webhook events whenever an envelope is sent out from your account via application or API |\n| App Level | Foxit eSign calls your webhook events whenever an envelope is sent out from your account via API only |\n\n##### Webhook Events\n\n| Event Name | Description |\n| --- | --- |\n| folder_sent | Foxit eSign calls your Webhook for this event whenever any document folder is sent out from your account for signature.  <br>  <br>The `data` field in this case consists of the folder (`folder`) field, which contains the data for the folder which was sent. This webhook call is in realtime |\n| folder_viewed | Foxit eSign calls your Webhook for this event whenever any party first time opens your document folder which was sent out to them from your account.  <br>  <br>The `data` field in this case consists of the folder (`folder`) field, which contains the data for the folder which was viewed, and also a `viewing_party` field which contains the data for the party which viewed the document folder. This webhook call is in realtime. |\n| folder_signed | Foxit eSign calls your Webhook for this event whenever any party signs your document folder which was sent out to them from your account.  <br>  <br>The `data` field in this case consists of the folder (`folder`) field, which contains the data for the folder which was signed, and also a `signing_party` field which contains the data for the party which signed the document folder. This webhook call is in realtime. |\n| folder_cancelled | Foxit eSign calls your Webhook for this event whenever any party cancels or declines to sign your document folder which was sent out to them from your account.  <br>  <br>The `data` field in this case consists of the folder (`folder`) field, which contains the data for the folder which was cancelled, and also a `cancelling_party` field which contains the data for the party which cancelled/declined to sign the document folder, and a `reason_for_cancelling` field which contains the reason given for cancelling/declining to sign the document. This webhook call is in realtime. |\n|  |  |\n| folder_completed | Foxit eSign calls your Webhook for this event whenever any document folder which was sent out from your account has been completed with all the required parties signatures.  <br>  <br>The `data` field in this case consists of the folder (`folder`) field, which contains the data for the folder which was completed. This webhook call is in realtime. |\n| folder_executed | Foxit eSign calls your Webhook for this event whenever any document folder which was sent out from your account has been completed with all the required parties signatures.  <br>  <br>The `data` field in this case consists of the folder (`folder`) field, which contains the data for the folder which was completed. This webhook is invoked within 5-10 seconds after folder completion webhook as it waits for the digital signature on the completed document(s). |\n|  |  |\n| folder_deleted | Foxit eSign calls your Webhook for this event whenever any document folder from your account is deleted.  <br>  <br>The `data` field in this case consists of the folder (`folder`) field, which contains the data for the folder which was deleted, and also a `deleting_party` field which contains the data for the party which deleted the document folder. This webhook call is in realtime. |\n\n## 📝 Sample Webhook Request Body\n\n```\n{\n    \"event_name\":\"folder_signed\",\n    \"event_date\":1464237988093,\n    \"data\":{\n      \"folder\":{\n        \"folderId\":649,\n        \"folderName\":\"NDA\",\n        \"folderAuthorId\":1,\n        \"folderAuthorFirstName\": \"ABC\",\n        \"folderAuthorLastName\": \"XYZ\",\n        \"folderAuthorEmail\": \"abc@xyz.com\",\n        \"folderAuthorRole\": \"admin\",\n        \"folderCompanyId\":11,\n        \"folderCreationDate\":1456385855000,\n        \"folderSentDate\":1464237650000,\n        \"folderStatus\":\"SHARED\",\n        \"folderDocumentIds\":[1239,1240],\n        \"custom_field1\":{\n              \"name\":\"NAME\",\n              \"value\":\"VALUE\"\n         },\n    \"custom_field2\":{\n              \"name\":\"NAME\",\n              \"value\":\"VALUE\"\n         },\n        \"documentsList\":[\n          {\n            \"documentId\":1239,\n            \"companyId\":11,\n            \"contractCreatedBy\":1,\n            \"contractCreatedOn\":1456385853000,\n            \"contractType\":\"NDA\",\n            \"contractStatus\":\"WAITING_FOR_SIGNATURE\",\n            \"editable\":false,\n            \"contractVersionId\":1307,\n            \"contractVersionName\":\"NDA\",\n            \"contractVersionDesc\":\"NDA\",\n            \"versionCreatedby\":1,\n            \"versionCreatedOn\":1456385853000,\n            \"contractVersionNumber\":1\n          },\n          {\n            \"documentId\":1240,\n            \"companyId\":11,\n            \"contractCreatedBy\":1,\n            \"contractCreatedOn\":1456385871000,\n            \"contractType\":\"IRS\",\n            \"contractStatus\":\"WAITING_FOR_SIGNATURE\",\n            \"editable\":false,\n            \"contractVersionId\":1308,\n            \"contractVersionName\":\"Form W9 copy\",\n            \"contractVersionDesc\":\"Pdf sample template\",\n            \"versionCreatedby\":1,\n            \"versionCreatedOn\":1456385871000,\n            \"contractVersionNumber\":1\n          }\n        ],\n        \"folderRecipientParties\":[\n          {\n            \"partyId\":1,\n            \"partyDetails\":{\n              \"partyId\":1,\n              \"firstName\":\"John\",\n              \"lastName\":\"Doe\",\n              \"emailId\":\"johndoe@example.com\",\n              \"address\":\"New Delhi, India\",\n              \"dateCreated\":1404837207000\n            },\n            \"contractPermissions\":\"FILL_FIELDS_AND_SIGN\",\n            \"partySequence\":1,\n            \"workflowSignSequence\":1,\n            \"envelopeId\":649,\n            \"sharingMode\":\"email\",\n            \"folderAccessURL\":null,\n            \"securityMode\":\"none\"\n          },\n          {\n            \"partyId\":52,\n            \"partyDetails\":{\n              \"partyId\":52,\n              \"firstName\":\"John\",\n              \"lastName\":\"Doe\",\n              \"emailId\":\"johndoe@example.com\",\n              \"address\":\"\",\n              \"dateCreated\":1413058300000\n            },\n            \"contractPermissions\":\"FILL_FIELDS_AND_SIGN\",\n            \"partySequence\":2,\n            \"workflowSignSequence\":2,\n            \"envelopeId\":649,\n            \"sharingMode\":\"email\",\n            \"folderAccessURL\":null,\n            \"securityMode\":\"none\"\n            }\n          ],\n          \"bulkId\":0,\n          \"enforceSignWorkflow\":false,\n          \"currentWorkflowStep\":1,\n          \"transactionSource\":\"API-1-via_templates:[46]\",\n          \"editable\":false,\n          \"inPersonSignable\":false\n        },\n        \"signing_party\":{\n          \"partyId\":1,\n          \"firstName\":\"John\",\n          \"lastName\":\"Doe\",\n          \"emailId\":\"johndoe@example.com\",\n          \"address\":\"New Delhi, India\",\n          \"dateCreated\":1404837207000\n        }\n      }\n    }\n\n ```\n\n## Webhook Security\n\nIt is recommended to use HTTPS for the webhook urls at your application end to avoid any kind of tampering with your webhook request data.\n\n### Signature verification\n\nYou can enable extra security around your Webhooks by providing a Webhook Secret (in API settings page, under section of webhooks) which will enable Foxit eSign to sign each of the webhook post request with a signature using your Webhook Secret.\n\nThe signature is generated using an HMAC-SHA-256 base64 digest of the raw HTTP Body of the Webhook post using this Webhook secret.\n\n> Using your Webhook Secret a `signature` is calculated and sent with each Webhook (as a query string parameter signature). You can thus verify the contents of Webhook as being authentic and un-tampered. \n  \n\nYou can generate the signature in php as follows:\n\n``` php\n$request_body = file_get_contents('php://input');\n$s = hash_hmac('sha256', $request_body, 'mySecret', true);\necho base64_encode($s);\n\n ```\n\nThis Signature is sent with each Webhook post as a query parameter signature in your URL.  \nFor example, for the following URL you registered as a Webhook:\n\n[https://www.test.com/WebhookHandler](https://www.test.com/WebhookHandler)\n\nFoxit eSign will post to the following webhook URL:\n\n[https://www.test.com/WebhookHandler?signature=XXXXXXXXXXXXXXXXXXXXX](https://www.test.com/WebhookHandler?signature=XXXXXXXXXXXXXXXXXXXXX)\n\nYou can thus verify the contents of the POST by taking the same hash yourself and comparing with a signature you got in request.\n\n**IMPORTANT:** Keep your Webhook secret safe with you as you would your password, since anyone with your Webhook secret could generate Webhooks that pass the signature validation.\n\n## Creating Multiple Webhook Channels\n\nChoose which notification types are sent to each channel. Plus, monitor individual channels through our developer portal.\n\nWith Foxit eSign's Various Advanced APIs for Managing your Webhooks:\n\n- [Create a Webhook Channel](https://developers.foxitesign.foxit.com/v/1_0_0#/rest/api-endpoints/webhooks-api/create-webhook-channel)\n    \n- [Update a Webhook Channel](https://developers.foxitesign.foxit.com/v/1_0_0#/rest/api-endpoints/webhooks-api/update-webhook-channel)\n    \n- [Deactivate a Webhook Channel](https://developers.foxitesign.foxit.com/v/1_0_0#/rest/api-endpoints/webhooks-api/deactivate-webhook-channel)\n    \n\n## Next Steps\n\nTo get the most out of your integration, here's what we recommend:\n\n- **Dive into the API Reference:** For comprehensive details on every endpoint, request, and response, explore our full API documentation.\n    \n- **Contact Sales for Production Keys:** When you're ready to go live, reach out to our sales team to acquire your production API keys.  \n    [Contact Sales](https://mailto:jason_welch@foxitsoftware.com)\n    \n\n# PDF Embed API\n\n### Foxit PDF Embed API Overview\n\nThe **Foxit PDF Embed API** offers a streamlined way to integrate a powerful PDF viewer into your web applications with minimal coding. This cloud-based solution enables fast deployment without requiring complex server configurations or reliance on third-party PDF tools. It eliminates the need for download prompts or additional plugins, allowing users to view and edit PDFs directly within the browser.\n\n### Customizable and Developer-Friendly\n\nThe viewer is fully customizable, giving developers the flexibility to adjust its appearance and behavior to match specific design and branding needs, no design expertise required.\n\n### Powered by Foxit’s Trusted PDF Engine\n\nAt its core, the Embed API uses **Foxit’s industry-leading PDF rendering engine**, trusted by major enterprises worldwide for its speed and reliability. This robust foundation ensures smooth and consistent document rendering across platforms. Additionally, Foxit provides dedicated technical support and routine performance and security updates, available through optional support and maintenance plans.\n\n## Copy, Paste, and Run\n\nTo launch the PDF viewer on your local web server (e.g., `localhost`), you’ll need a valid **Client ID** and **Client Secret** from the Foxit Developer Console. Simply replace `'REPLACE_YOUR_CLIENT_ID'` and `'REPLACE_YOUR_CLIENT_SECRET'` in the provided code snippet with your actual Client ID and Client Secret. Then, run the webpage to initialize the viewer.\n\nYou can also modify the `previewFile` function to load a PDF from your server.\n\n> 💡 Note: Make sure your local web server is properly configured. If you're using Node.js, learn more about setup [here](https://placeholder). \n  \n\n``` javascript\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n  <title>Foxit Embed - Full Window</title>\n  <style>\n    html, body, #foxit-embed-view { height: 100%; }\n  </style>\n</head>\n<body>\n  <divid=\"foxit-embed-view\"></div>\n  <script src=\"https://embed.developer-api.foxit.com/service/api/embview-sdk/js?clientId=REPLACE_YOUR_CLIENT_ID\"></script>\n  <script>\n    new FoxitEmbed.View({\n      clientId: 'REPLACE_YOUR_CLIENT_ID',\n      clientSecret: 'REPLACE_YOUR_CLIENT_SECRET',\n      divId: 'foxit-embed-view',\n    }).previewFile({\n      content: 'https://embed.developer-api.foxit.com/product/embedviewer/view-sdk-demo/Embed API Demo.pdf',\n      metaData: { fileName: 'Embed API Demo.pdf' },\n    }, {\n      showToolControls: true,\n      showLeftHandPanel: true,\n      showDownloadPDF: true,\n      showPrintPDF: true,\n      defalutViewColorStyle: { primaryColor: '#f36b16', secondaryColor: '#333333', textActiveColor: '#FFFFFF' },\n    });\n  </script>\n</body>\n</html>\n\n ```\n\n## Supported Browsers\n\nFoxit Embed API is supported on the latest versions of the following browsers:\n\n- **Windows**: Microsoft Edge, Google Chrome, Mozilla Firefox.\n    \n- **macOS**: Safari, Google Chrome, Microsoft Edge, Mozilla Firefox.\n    \n- **Android**: Google Chrome.\n    \n- **iOS**: Safari, Google Chrome.\n    \n\n## [Read more about PDF APIs](#8690e041-8274-459e-b4f2-5bd64f1463e7)\n\n## Next Steps\n\nTo get the most out of your integration, here's what we recommend:\n\n- **Dive into the API Reference:** For comprehensive details on every endpoint, request, and response, explore our full API documentation.\n    \n- **Contact Sales for Production Keys:** When you're ready to go live, reach out to our sales team to acquire your production API keys.  \n    [Contact Sales](https://mailto:jason_welch@foxitsoftware.com)","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"44535549","team":7584739,"collectionId":"7d62b4ae-0caa-4e42-b477-b1c22f5fac99","publishedId":"2sB2xEB91P","public":true,"publicUrl":"https://docs.developer-api.foxit.com","privateUrl":"https://go.postman.co/documentation/44535549-7d62b4ae-0caa-4e42-b477-b1c22f5fac99","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":"Foxit APIs, powerful RESTful APIs.\nFoxit PDF APIs, Foxit PDF Services APIs\nFoxit Document Generation APIs\nFoxit eSign APIs\nFoxit Embed Services APIs"},{"name":"title","value":""}],"appearance":{"default":"light","themes":[{"name":"dark","logo":"https://content.pstmn.io/e8e2a077-ec37-4ca7-a56a-aa84f911e094/bG9nby1vcmFuZ2UucG5n","colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":"https://content.pstmn.io/e8e2a077-ec37-4ca7-a56a-aa84f911e094/bG9nby1vcmFuZ2UucG5n","colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.11.4","publishDate":"2025-06-30T09:33:38.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":"Foxit APIs, powerful RESTful APIs.\nFoxit PDF APIs, Foxit PDF Services APIs\nFoxit Document Generation APIs\nFoxit eSign APIs\nFoxit Embed Services APIs"},"logos":{"logoLight":"https://content.pstmn.io/e8e2a077-ec37-4ca7-a56a-aa84f911e094/bG9nby1vcmFuZ2UucG5n","logoDark":"https://content.pstmn.io/e8e2a077-ec37-4ca7-a56a-aa84f911e094/bG9nby1vcmFuZ2UucG5n"}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/60a9666f9174ce97448b259fd00dbcb2718323da7192764b0b863ac8c797711c","favicon":"https://res.cloudinary.com/postman/image/upload/v1745937690/team/b63690e62b75d758cc11193d0ab8f143.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://docs.developer-api.foxit.com/view/metadata/2sB2xEB91P"}