DOCS Live

Banks and agents

Statements and reconciliation

Send the statements of your receiving accounts, so deposits are credited and payments reconciled.

Your statements are what turn a reported deposit into money in a KulPay account, and what reconcile the bills you were trusted to pay. You declare each statement you send in a statement profile: its format, how it is delivered, how often, by when, and the accounts it covers. Then you send the files; KulPay stores each one unchanged, reads it into lines and matches them.

Before you start

The flow at a glance

#WhoWhat happens
1Your systemPreviews a sample file with a profile; KulPay answers the lines it reads from it.
2Your systemSaves the profile with that sample; it is active at once.
3Your systemSends each statement under the profile, by API, KulPay's SFTP or per entry.
4KulPayStores it unchanged, reads it into lines, and matches them to deposits and payments.

1. Preview a sample

Your system or your team, once.

POST /v1/psps/{id}/statement-profiles/preview · API reference

Send the profile and a real sample file. KulPay answers the lines it reads (line ID, dates, amount in minor units, direction, references, depositor) before anything is saved, so you see whether the mapping is right. A sample that reads is kept, and its sample_file_id goes in the profile.

Formats: camt.053 (recommended), camt.052, camt.054, MT940, MT942, BAI2, CSV, XLSX and JSON. A CSV names its columns in mapping, for example:

Request

{
  "profile": {
    "id": "eod",
    "standard": "csv",
    "direction": "push",
    "channel": "api_upload",
    "frequency": "daily",
    "cutoff": "23:00",
    "timezone": "Africa/Maputo",
    "arrival_window": "2h",
    "granularity": "transaction",
    "security": {
      "checksum": "none"
    },
    "acknowledgement": "api",
    "currency": "MZN",
    "accounts": [
      "MZ59000800000000123456789"
    ],
    "mapping": {
      "line_id": "line_id",
      "account": "account",
      "value_date": "value_date",
      "booking_date": "booking_date",
      "amount": "amount",
      "currency": "currency",
      "direction": "direction",
      "psp_reference": "provider_reference",
      "kulpay_reference": "kulpay_reference",
      "end_to_end_id": "end_to_end_id",
      "counterparty": "counterparty",
      "depositor_ref": "depositor_reference",
      "fee": "fee"
    }
  },
  "sample": "bGluZV9pZCxhY2NvdW50LHZhbHVlX2RhdGUs…",
  "filename": "sample.csv"
}

With that mapping, a CSV statement reads like this (one line per entry, amounts with a point and two decimals):

line_id,account,value_date,booking_date,amount,currency,direction,provider_reference,kulpay_reference,end_to_end_id,counterparty,depositor_reference,fee

AG001-20261022-0000457,MZ59000800000000123456789,2026-10-22,2026-10-22,1500.00,MZN,credit,,,,João Sitoe,258841234567,0.00

2. Save the profile

Your system or your team, once (and on every change).

PUT /v1/psps/{id}/statement-profiles · API reference

Save your profiles, each citing its sample_file_id. A PSP may declare several, for example an intraday per-entry feed and an end-of-day file. Every change is a new, audited version.

Request

{
  "profiles": [
    {
      "id": "eod",
      "standard": "camt.053",
      "direction": "push",
      "channel": "api_upload",
      "frequency": "daily",
      "cutoff": "23:00",
      "timezone": "Africa/Maputo",
      "arrival_window": "2h",
      "granularity": "transaction",
      "security": {
        "checksum": "sha256"
      },
      "acknowledgement": "api",
      "sample_file_id": "3KWPr5AUvVJpugmIt8dBVHit0KE",
      "accounts": [
        "MZ59000800000000123456789"
      ]
    }
  ],
  "reason": "end-of-day camt.053"
}

Response

{
  "approval": null,
  "version": {
    "id": "3KWPrAnaCx5mmnq8rkGpK4AocSM",
    "kind": "statement_profile",
    "version": 1,
    "status": "active",
    "reason": "end-of-day camt.053",
    "activated_at": "2026-10-10T22:15:46Z"
  }
}

arrival_window is how long after the cut-off KulPay waits for the file: a deposit whose line has not arrived by then becomes an unconfirmed_deposit exception, and a missing file is chased with your contacts.

3. Send a statement

Your system, on the profile's schedule.

POST /v1/statements · API reference

Multipart with file and profile_id, and checksum (hex SHA-256, or a Content-Digest header) when the profile asks for one. The same file twice is recognised and not imported again (duplicate: true).

Other channels: KulPay's SFTP (your own write-only folder; a <file>.sha256 sidecar carries the checksum) and per-entry notifications such as camt.054 posted to your webhook path. GET /v1/psps/{id}/statement-endpoints gives the SFTP address, its host key, KulPay's PGP key for encrypted files and the paths.

Response

{
  "file": {
    "id": "3KWPrOa2OznFbpDMmWuxdPEcGGI",
    "profile_id": "eod",
    "profile_version": 1,
    "standard": "camt.053",
    "channel": "api_upload",
    "filename": "BANK_20261022.xml",
    "sha256": "9efc248a730f0c5e4dc9f55c3e5df8ea8f94a2ecd8266d5bb2e7a7adb3ea0afc",
    "statement_id": "BANK-20261022-0001",
    "account": "MZ59000800000000123456789",
    "sequence": "281",
    "status": "ingested",
    "line_count": 2,
    "skipped_lines": 0,
    "received_at": "2026-10-22T23:15:48Z"
  }
}

4. Check what was read

Your system or your team.

GET /v1/statements/{id}/lines · API reference

A file is ingested or rejected with the reason (GET /v1/statements lists them). Its lines are the canonical lines as read, each linked to the file and its line number; they are never edited. After a mapping fix, a stored file can be read again (POST /v1/statements/{id}/reparse), keeping the earlier reading.

States

StateWhat it means
ingested

Stored unchanged and read into lines; matching runs on them.

rejected

Refused: checksum missing or wrong, PGP failure, unreadable, balances that do not add up, or an account the profile does not cover. Fix and send again.

When the money moves

A cash deposit is credited when its line matches: same line ID as the entry_id, the same account, direction credit, the same amount and currency. A bill paid at the counter was paid on confirmation; its line only reconciles it. Matched lines are never matched twice.

Errors that matter here

Every error is application/problem+json with a stable code; branch on the code, not the message. The full list is in the error catalogue.

ErrorWhenWhat to do
400 invalid_request

The profile or the file is malformed; the detail names the problem.

Fix it; preview the profile again with the sample.

403 insufficient_scope

The key lacks psp:configure (profiles) or reconciliation:write (files).

Use a key with the scope, or a restricted key that lists it.

Testing it

Preview your profile with a real sample first: the answer shows exactly how each line is read. Then send a statement in test mode with the line of a deposit you confirmed, and read the deposit: it should be confirmed. Change the amount on the line to see a deposit_amount_mismatch.


All flows · API reference · Error catalogue