#1105 — Docuseal document download API
Repo: Twill-AI/facade State: open | Status: open Assignee: sparsh-twillpayments
Created: 2026-03-06 · Updated: 2026-03-06
Description
Context
After a merchant signs their agreement via Docuseal, all three parties — master, partner, and merchant — need to be able to download the signed PDF.
Docuseal stores completed submissions and exposes a document download endpoint. This ticket wires that through Twill’s API.
Endpoint
GET /merchants/{merchant_id}/signed-document
Behavior:
- Verify the requesting user has access to this merchant (master, partner owner/rep, or the merchant themselves)
- Check
merchant.signed_atis set — return404with a clear message if not yet signed - Call Docuseal API using
merchant.docuseal_submission_idto fetch the signed PDF - Stream the PDF back to the caller with
Content-Disposition: attachment
AC
- Endpoint accessible to master, partner, and merchant roles
- Returns
404if document not yet signed - PDF streamed from Docuseal using
docuseal_submission_id - Unauthorized access rejected
Notes
Add implementation notes, blockers, and context here
Related
Add wikilinks to related people, meetings, or other tickets