Setup

Point your statement mailbox at the relay

Four steps: credentials, the inbound webhook, bank source rules, and the retry schedule.

1. Credentials

Two secrets power the Light connection. They live server-side and are never exposed to the browser.

  • LIGHT_API_KEY

    Sent to Light as an HTTP Basic authorization header on every batch.

  • LIGHT_API_BASE_URL

    Point this at the sandbox while testing; leave it unset to use production.

There is no default bank account setting. Every statement is routed to its Light bank account by the account number and currency in its filename, so a file can never land in the wrong ledger.

2. Simulate before you automate

Add a bank source for each account and currency, then drop a sample CSV into Simulate a statement in the console. You'll see the routing decision, the parser used and every transaction that would be created — with nothing stored until you press Post to Light.

3. Email forwarding

Statements can be forwarded to a dedicated mailbox such as premialab@bankstatement.light-app.co. Create an inbound route for the bankstatement.light-app.co subdomain at your DNS/mail provider (Cloudflare Email Routing, SendGrid Inbound Parse, Postmark or Mailgun) and point it at the endpoint below — the console shows the ready-to-paste URL with the token already in it. It accepts SendGrid multipart payloads as well as Postmark/Mailgun JSON, and reads the first attachment whose name or content type says CSV.

POST https://<your-app-domain>/api/public/inbound-email?token=<INBOUND_EMAIL_WEBHOOK_TOKEN>

The token may instead be sent as Authorization: Bearer … or as the password half of HTTP Basic auth. Requests without it get a 401 and are never stored.

3. Bank source rules

Routing is driven by the statement filename. Three conventions are recognised:

  • 788718993_HKD_20260702.csv — HSBC Hong Kong: account, currency, statement date.
  • Light_HSBC_USD_023-746993-100_July_2026.csv — Light's normalized template: bank, currency, account, statement month.
  • CITI_USD_7_26.csv — Citibank: bank, currency, month and year. The name carries no account number, so it is read from the account/IBAN column inside the file.

Add one source per account-and-currency pair and enter the account number; the file then lands in the right Light bank account no matter which mailbox forwarded it. Account numbers are compared ignoring dashes and leading zeros, and an IBAN matches the account number embedded in it. The same account across HKD, USD and GBP is three separate sources pointing at three Light bank accounts.

If a filename does not follow any convention, the sender and subject rules are used instead. Dedicated parsers ship for the Light template, Citibank, HSBC Hong Kong, HSBC UK, Chase and Wise; anything else falls back to the generic parser, which auto-detects common date, description, amount and debit/credit columns.

Every parsed row gets a fingerprint built from the account, date, amount, currency and description. That fingerprint is both the local de-duplication key and the transactionId sent to Light, so a re-forwarded email can never double-post.

4. Scheduled retries

A scheduled job re-runs any statement that hasn't fully landed in Light — for example when the API was briefly unavailable. You can also trigger the same pass from the console with Sync now.

POST https://<your-app-domain>/api/public/reprocess
apikey: <project publishable key>

Amounts and dates

Light expects amounts as integers in minor units, so 128.40 is posted as 12840. The parsers handle both Anglo (1,234.56) and European (1.234,56) number formats, bracketed negatives, separate debit/credit columns, and ISO, DMY or MDY dates.