#1096 — Create Backend API to handle all fees.
Repo: Twill-AI/facade State: closed | Status: done Assignee: sparsh-twillpayments
Created: 2026-03-05 · Updated: 2026-03-10
Description
Use above for APIs
Changes to DbFeeConfig
Extend the existing fee_config table. Do not drop old columns yet — they will be migrated and dropped in a follow-up.
Add the following:
Application type & controls
application_type(enum, replacestype):interchange,cash_discount,flat_rate,surcharge,tiered,dual_pricing_passthrough,dual_pricing_flat_rate,cnp_v_cpdiscount_duration(enum):daily,monthly(Luqra only)
Fixed fees — both processors
monthly_minimum_fee,avs_fee,monthly_access_fee,semi_annual_tech_fee
Fixed fees — Luqra only
luqra_chargeback_fee,luqra_retrieval_fee,luqra_batch_fee,luqra_debit_access_fee,luqra_additional_service_fees,luqra_early_deconversion_fee,luqra_regulatory_fee,luqra_monthly_wireless_fee,luqra_setup_fee
Rate fields — per pricing type, per card network
See HTML reference for full field list. Column naming convention: {type_prefix}_{network}_{rate|fee} (e.g. ic_vmd_credit_rate, tiered_amex_mid_fee, cnp_vmd_ecom_rate).
Migration
Write a Piccolo migration that:
- Adds all new columns as nullable
- Backfills
application_typefrom existingtypevalues - Backfills rate fields from old columns where mapping is clear (e.g.
fr_vmd_debit_rate ← processing_rate_percent,monthly_minimum_fee ← monthly_fee, etc.) - Does NOT drop old
Notes
Add implementation notes, blockers, and context here
Related
Add wikilinks to related people, meetings, or other tickets