#326 — Facade API to serve Transactions and Payment Links widgets

Repo: Twill-AI/facade State: closed | Status: done Assignee: sparsh-twillpayments

Created: 2025-04-16 · Updated: 2025-05-23

Description

Request

Caused by conversations about Flexible Widgets We want to support P0 version of transactions table, payment links table, and customer table in a way that is compatible with the future implementation of Flexible widgets.

The idea is to create only one endpoint that replaces the 3 temporary endpoints proposed in https://github.com/Twill-AI/facade/issues/309, https://github.com/Twill-AI/facade/issues/310, https://github.com/Twill-AI/facade/issues/311. This will also be a temporary endpoint because some changes will be needed to fully support the future feature “Flexible Widgets” but the developed code will be mostly reusable, especially on front-end.

Proposed endpoint: POST /api/v1/widgets/static with request body:

{
  "type": str, // One of ["transactions", "customers", "paymentLinks"].
  "code": {
    "filters": object | null, // Filter parameters according to "schema".
    "pagination": { // Pagination parameters.
      "afterId": str | null, // Either this or beforeId.
      "beforeId": str | null,
      "size": str | null // Page ("values_rows") size.
    }
  }
} 

and returning:

{
  "code": {
    "schema": object, // JSON schema declaring columns (type, etc.; matching values_headers) and filters (type, boundaries, etc.; matching values_headers).
  },
  "values_headers": [str, ...], // Human-friendly header names.
  "values_rows": [[object, ...], ...]  // Da

## Notes

_Add implementation notes, blockers, and context here_

## Related

_Add wikilinks to related people, meetings, or other tickets_