#646 — MCA endpoints

Repo: Twill-AI/facade State: closed | Status: done Assignee: meliascosta, nadddder

Created: 2025-10-08 · Updated: 2025-10-29

Description

We should track two fields on the merchant table (total_mca_amount and total_mca_paid).

  • Create a table to host historical data (@meliascosta to provide more detail)
  • These two should be included in POST/api/v1/partner/merchants and POST/api/v1/master/merchants (to create an mca)
  • PUT /api/v1/partner/merchants/{merchant_id} has been modified to allow creation/modification of an MCA (amount, initial_amount_paid)
  • To edit an mca we need to create PATCH /api/v1/partner/merchants/{merchant_id}/mca/{mca_id}
  • Paid amount should be updated at MCA nightly update job
  • List Merchants and get merchant details endpoints should provide these values when called by partner and master
  • Route data ingestion separately for Staging and Prod
  • Reflect changes in force update and caching
  • Confirm tracking the gateway MID source in force update

Partner should separately be able to get MCA details on a single merchant (expansion of https://github.com/Twill-AI/facade/issues/542)

  • GET /api/v1/partner/merchants/mca should provide the aggregated historical mca data on all partner’s merchants
  • GET /api/v1/partner/merchants/{merchant_id}/mca should provide the historical mca data on a merchant

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets