E-Signature Integrations
CaseSolo supports live DocuSign and Adobe Acrobat Sign flows for launch integration work.
Provider Coverage
DocuSign implementation:
src/lib/integrations/docusign.tssrc/app/api/integrations/docusign/route.tssrc/app/api/integrations/docusign/callback/route.tssrc/app/api/webhooks/docusign/route.ts
Adobe Acrobat Sign implementation:
src/lib/integrations/adobe-sign.tssrc/app/api/integrations/adobe-sign/route.tssrc/app/api/integrations/adobe-sign/callback/route.tssrc/app/api/webhooks/adobe-sign/route.ts
Both providers support OAuth, token refresh, live send/create actions, status reads, cancellation/voiding, reminders or resend, template listing, embedded signing links, webhook processing, and signed-document download.
Signed Document Capture
Completed provider webhooks now call captureSignedProviderDocument() from src/lib/integrations/e-signature-document-capture.ts.
The capture flow:
- Download the combined signed PDF from the provider.
- Upload the PDF to R2 with
uploadObject(). - Create a CaseSolo
Documentrecord withuploadStatus: completedanduploadFlow: provider_signed_document. - Attach provider metadata such as
provider,providerRecordId, status, and signed timestamp. - Write an activity event such as
docusign_signed_document_capturedoradobe_sign_signed_document_captured. - Mark any existing retry record for the provider envelope/agreement as completed.
DocuSign envelopes include hidden custom fields for casesolo_firmId, casesolo_userId, and optional casesolo_caseId. Adobe agreements include a CaseSolo externalId in the format casesolo:{firmId}:{caseId|general}:{userId}. These fields let webhook processing attach signed documents back to the right case and user where the provider includes the metadata.
Retry Records
If download, R2 upload, or document creation fails, the helper stores a retry record in firm.settings.eSignatureDocumentCaptureRetries.
Retry fields include:
providerproviderRecordIdsubjectcaseIduserIdreasonattemptsmaxAttemptsstatusnextAttemptAtmetadata
The current retry queue is intentionally metadata-backed for the launch slice so failed webhook captures are not lost. A later worker can replay pending records using the provider ID and provider record ID.
Provider References
- DocuSign envelope custom fields: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopecustomfields/
- DocuSign envelope document download: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopedocuments/get/
- DocuSign Connect webhooks: https://developers.docusign.com/platform/webhooks/connect/
- Adobe Acrobat Sign API usage, webhooks, agreement creation, and combined document download: https://opensource.adobe.com/acrobat-sign/developer_guide/apiusage.html
Launch Gate
Before launch, this slice must keep passing:
npm run test:run -- docusign adobe-sign e-signature-document-capture- ESLint on touched provider, route, helper, and test files.
npm run typecheck