GET /v1/merchants

Merchants as they are shown, with alias names applied, most spending first. Transfers are excluded.

Each row groups the bank's variants of one merchant under its display name. raw_names lists up to 20 of the bank text variants behind it, which is what to match when writing an alias.

Auth. Send the token in the X-Ledger-Token header.

Parameters

NameInTypeRequiredDescription
sincequerystring (date)optionalOnly rows on or after this date
untilquerystring (date)optional
account_idquerystringoptional
limitqueryintegeroptional

Responses

StatusMeaningBody
200Merchantsobject[]
400Request rejectedError
429Too many requests from this client address. Wait the number of seconds in Retry-After, then try again.Error

Example response

[
  {
    "merchant": "string",
    "transactions": 0,
    "spent_cents": 0,
    "received_cents": 0,
    "raw_names": [
      "string"
    ],
    "raw_name_count": 0
  }
]

Code samples

Set KEY to your own token first.

curl

curl \
  -H X-Ledger-Token:$KEY \
  "https://api.sasek.org/ledger/v1/merchants"

JavaScript

const res = await fetch("https://api.sasek.org/ledger/v1/merchants", {
  headers: { "X-Ledger-Token": KEY },
});
const data = await res.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://api.sasek.org/ledger/v1/merchants",
    method="GET",
    headers={
        "X-Ledger-Token": os.environ["KEY"],
    },
)
with urllib.request.urlopen(request) as response:
    print(json.load(response))