HubSpot & PandaDocs Custom Integration Success Story

featureimage

Problem Statement

 

Our client wanted to streamline their document signing process without requiring direct customer interaction. Instead of manually sending documents and waiting for customers to engage, the client requested an automated flow where PandaDocs could generate, send, and update the document status directly inside HubSpot.

 

Additionally, they needed visibility into the entire document lifecycle — from generation to signing and expiration — tracked inside HubSpot CRM for reporting and follow-ups.

The integration scope included:

  • Automated document generation from HubSpot records (deals, contacts, and custom objects).
  • Real-time status tracking of documents (sent, viewed, signed, completed, expired).
  • Elimination of duplicate customer records when syncing between HubSpot and PandaDocs.
  • Document expiration reminders for customers via mail.

 

Challenges

 

Webhook-Based Document Tracking

  • PandaDocs sends document lifecycle updates via webhooks, but ensuring reliable delivery and mapping to the correct HubSpot records required a robust handling mechanism.
  • Failed or delayed webhooks could lead to outdated statuses in HubSpot.

 

Duplicate Customer Creation

  • PandaDocs automatically attempted to create customers during document generation, causing duplicate records in HubSpot. 

  • A deduplication logic was required to ensure a single source of truth for customer records.
  • Document Expiration Management
  • A proactive reminder system had to be implemented to notify customers before documents expired, preventing lost deals.

 

Integration Approach / Steps

 

We implemented a custom HubSpot–PandaDocs integration using HubSpot custom code actions, AWS Lambda, and EC2 for scalability and reliability. Following steps:

 

Predefined PandaDoc Templates

  • As a one-time setup process, we created predefined PandaDoc templates based on the client’s requested structure.
  • Templates were designed to ensure documents matched the client’s branding, layout, and compliance requirements.
  • Required fields, sections, and placeholders were pre-configured so that document generation could happen automatically without manual editing.
  • This initial setup ensured consistency and efficiency for all future document creation processes.

 

Automated Document Generation

  • Custom workflows in HubSpot trigger PandaDocs templates whenever a deal stage changes or a custom object meets predefined conditions.
  • Customer and deal data (name, email, deal value, and product line items) are dynamically pre-filled into PandaDocs templates.
  • Once the document is successfully created in PandaDocs, the pandaDoc_document_id is written back into the associated HubSpot deal or custom object record.
  • This creates a direct link between HubSpot and PandaDocs, enabling future webhook events to be mapped reliably to the right HubSpot record.

 

Webhook Handling & CRM Updates

  • Implemented a webhook listener service to capture PandaDocs status updates (sent, viewed, signed, completed, expired).
  • Mapped each webhook event back to the corresponding HubSpot record using unique document IDs, ensuring real-time synchronization.

 

Duplicate Prevention Logic

  • Since one contact in HubSpot can be associated with multiple deals or customer objects, we implemented a deduplication mechanism that prevents redundant PandaDocs customer creation.
  • Each contact record in HubSpot stores a PandaDoc_customer_id once it has been synced to PandaDoc.
  • When generating a new document from HubSpot, the integration checks if the associated contact already has a PandaDoc_customer_id.
  • If it exists, the existing PandaDocs customer is reused instead of creating a new one.
  • If not, a new PandaDocs customer is created, and the pandaDoc_customer_id is stored back in the HubSpot contact record.
  • Unique records were synced, maintaining data cleanliness.

 

Expiration Reminder Via PandaDoc

  • PandaDoc automatically sends reminder emails directly to customers before a document expires.
  • Meanwhile, HubSpot is updated with the document status changes (e.g., expired), giving sales teams visibility without needing to manually send follow-ups.

 

Results & Outcomes

  • Seamless Document Management: Sales teams can now send and track documents directly from HubSpot without leaving the CRM.
  • Real-Time Visibility: Document statuses update instantly in HubSpot, improving pipeline tracking and reporting accuracy.
  • No Duplicate Records: Customer deduplication ensured a clean, single source of truth across HubSpot and PandaDocs.
  • Proactive Expiration Handling: Automated reminders reduced the risk of lost opportunities due to expired documents.
  • Time Savings & Efficiency: Eliminated manual steps in document generation and follow-ups, saving sales teams hours per week.