#1099 — Create API to review and select processor for Master
Repo: Twill-AI/facade State: closed | Status: done Assignee: nadddder, sparsh-twillpayments
Created: 2026-03-05 · Updated: 2026-03-12
Description
Context
After a merchant’s application is submitted, it enters in_review status. Master needs an API to review the merchant’s pricing, select a processor, and trigger the underwriting flow — which updates status and sends a signing link to the merchant.
New field on DbMerchant
processor(enum):luqra,ems,prioritydocuseal_submission_id(text, nullable) — needed by #1102 to look up the merchant from the Docuseal webhook payload
Endpoint
PATCH /master/merchants/{merchant_id}/processor
Request body:
{ "processor": "luqra" | "ems" | "priority" }Behavior:
- Validate merchant is in
in_reviewstatus - Set
processoron merchant record - Generate a Docuseal signing link via Docuseal API (pre-populate template with merchant + fee data)
- Store
signing_urlanddocuseal_submission_idon merchant - Update merchant status →
SENT_FOR_SIGNATURE - Send email to merchant with login link, inviting to sign (whitelabeled)
- Log activity: “Processor selected: {processor}. Sent for Signature.”
AC
-
processoranddocuseal_submission_idfields added toDbMerchant - PATCH endpoint validates status, sets processor, generates Docuseal link, updates status, sends email
-
signing_urlanddocuseal_submission_idstored on merchant - Activity logged on status change
- Unit tests for status transition and Docuseal link generation
Notes
Add implementation notes, blockers, and context here
Related
Add wikilinks to related people, meetings, or other tickets