#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:

  1. Verify the requesting user has access to this merchant (master, partner owner/rep, or the merchant themselves)
  2. Check merchant.signed_at is set — return 404 with a clear message if not yet signed
  3. Call Docuseal API using merchant.docuseal_submission_id to fetch the signed PDF
  4. Stream the PDF back to the caller with Content-Disposition: attachment

AC

  • Endpoint accessible to master, partner, and merchant roles
  • Returns 404 if document not yet signed
  • PDF streamed from Docuseal using docuseal_submission_id
  • Unauthorized access rejected

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets