Retrieve Bills
View .mdOpen in ClaudeOpen in ChatGPT

Retrieve Bills

Fetch bills for linked accounts, filter by date and status, check sync progress, and trigger on-demand synchronization.

1

Fetch Bills for a Linked Account

Once link exchange returns an account_link_id, call GET /v1/bills with the account_link_id to retrieve bills. Because this is a billable read, send an Idempotency-Key. Reuse it only when retrying the same page.

GET /v1/bills
const response = await fetch(
  'https://sandbox.api.billerapi.com/v1/bills?account_link_id=' + linkId,
  {
    headers: {
      'Authorization': `Bearer ${process.env.BILLERAPI_API_KEY}`,
      'Idempotency-Key': crypto.randomUUID(),
    },
  }
);
const data = await response.json();
console.log(data.bills);
// Returns: array of bills with merchant_name, status, canonical total_amount
// ({ value, currency }) and due_date_iso (YYYY-MM-DD).
// This REST endpoint also still returns the deprecated amount/currency/due_date
// trio; read the canonical fields (the 2.0 Node SDK no longer exposes the trio).
// Pagination: has_more, next_cursor

Note

Listing bills is a server-to-server operation: authenticate with your API key and scope the query with the durable account_link_id. Link-scoped access tokens are accepted only by supported single-resource operations such as bill detail and statements. See the Getting Started guide for the full Link flow.
2

Filter by Date and Status

Narrow results using query parameters. All filters are optional and can be combined.

Query Parameters

FieldTypeDescription
account_link_id*stringID of the linked account
start_datestringISO 8601 date — only return bills on or after this date
end_datestringISO 8601 date — only return bills on or before this date
statusstringFilter by bill status: PENDING, PAID, OVERDUE, CANCELLED
sourcestringFilter by data source: BILLER_DIRECT, SCRAPING, OCR, EMAIL
limitnumberMax bills per page (default 25, max 100)
cursorstringPagination cursor from a previous response
Filtered request
const params = new URLSearchParams({
  account_link_id: linkId,
  start_date: '2026-01-01',
  end_date: '2026-03-31',
  status: 'PENDING',
  limit: '50',
});

const response = await fetch(
  `https://sandbox.api.billerapi.com/v1/bills?${params}`,
  {
    headers: {
      'Authorization': `Bearer ${process.env.BILLERAPI_API_KEY}`,
    },
  }
);
const { bills, has_more, next_cursor } = await response.json();

Tip

Use cursor-based pagination for large result sets. When has_more is true, pass next_cursor as the cursor parameter in the next request.
3

Check Sync Status

The Bill Sync API this step used to walk through — GET /v1/bills/sync and POST /v1/bills/sync/trigger — is not callable on either host today, so this guide no longer shows it. The sandbox host matches /v1/bills/sync against its single-bill route and answers 404, and on production both operations reach a backend gap rather than a working handler. The two per-link routes below do the same jobs and are served.

To see what changed on a link since your last read, call GET /v1/account-links/{link_id}/bills/sync. It answers with three buckets — added, modified and removed — plus next_cursor and has_more, so you can reconcile without diffing your whole store. The webhooks guide walks the full reconciliation loop with runnable samples.

4

Trigger a Sync

To force an out-of-cadence retrieval for one link, call POST /v1/account-links/{link_id}/refresh. It answers 202 with a refresh_id and a status_url to poll, and it is idempotent under load: a duplicate refresh while one is already in flight is a safe no-op. It is rate limited to roughly twelve refreshes per link per minute, and answers 429 RATE_LIMITED over that.

Note

Prefer webhooks to polling. A refresh is for the case where a user is watching and wants their bills now.
5

Webhook Events

Instead of polling, register a webhook to receive real-time notifications when bills change. The key bill-related events are:

  • bill.created — a new bill was retrieved
  • bill.updated — an existing bill changed (status, amount, due date)
  • connection.ready — a linked account finished its first sync; the payload carries first_sync_completed_at
  • link.disconnected — the link stopped syncing and needs attention. This is the event to watch for expired credentials and for links dropped by the biller; data.change says which
  • sync.started — a sync cycle began for a linked account
  • sync.completed — a sync cycle finished. This fires on every terminal cycle, including one that found nothing new, so it doubles as a heartbeat; bills_created, bills_updated and bills_deleted tell you whether anything actually changed, and status is success, partial or failed
  • sync.failed — a sync cycle could not run. error_code carries the reason, such as CREDENTIALS_UNAVAILABLE or BILLER_UNHEALTHY

Note

For full webhook documentation including registration, signature verification, retry policy, and all event types, see the Webhooks guide.

Related

Was this page helpful?