Skip to content
Portal

Files and SFTP

Bulk exchanges (blocks sent by the bank, authorization journal, accounting report, the networks’ clearing, manufacturing) go through files. Each file is checked line by line against its format, integrated in the background, and followed until its acknowledgement.

Fenêtre de terminal
curl -s -X POST "http://localhost:3000/files?file_type=UBO_CARD_STATUS&name=CARD_STATUS_20261127.csv&source=api" \
-H "Authorization: Bearer $TOKEN" --data-binary @CARD_STATUS_20261127.csv

The answer gives the file, its status (validated or rejected) and its anomalies. Then follow GET /files/{id} until integrated (or partially_integrated, with the detail per line in GET /files/{id}/records), or subscribe to the file.* events.

Type Direction Content
UBO_CARD_STATUS Bank → UBO Blocks, unblocks, losses, thefts, cancellations (delimited, with the last 4 digits as a check)
UBO_AUTH_JOURNAL UBO → bank Daily journal of the authorizations (fixed positions, control totals)
Accounting report UBO → bank The day’s accounting report
Clearing Network → UBO Presentments, withdrawals, refunds, reversals (BASE II)

GET /files/types gives the current list and GET /files/formats/{code}/{version} a format’s definition.

  1. Your access: the bank opens an exchange point for you. You receive the server, the port (2222 in development), your identifier and the fingerprint of the server’s key, to check at the first connection.
  2. Your key: generate a pair (ssh-keygen -t ed25519 -f ubo_sftp) and send only the public key. Accepted keys: Ed25519, ECDSA, RSA of at least 3,072 bits. Only SFTP is open.
  3. Connect: sftp -P 2222 -i ubo_sftp <identifier>@<server>.
Folder You can Content
in/ drop, rename the files you send
out/ read, download the files prepared for you
ack/ read, download the acknowledgements of your drops
error/ read, download your refused files, with the reason
  1. Name the file per the agreed pattern (CARD_STATUS_<date>.csv…), with a unique name.
  2. Write it under a temporary name (.part, .tmp, .filepart) then rename it: a temporary file is never read.
  3. If agreed, drop its fingerprint <name>.sha256 first (sha256sum format), or the encrypted file <name>.pgp (encrypted for the bank’s public key, signed with yours).

Once the file is processed, the platform writes the acknowledgement ack/<name>.ack.json:

{ "file": "CARD_STATUS_20261120.csv", "sha256": "9f86d0…", "status": "integrated", "status_label": "Intégré",
"records": { "details": 120, "valid": 119, "rejected": 1, "integrated": 119, "failed": 0 },
"issues": [ { "code": "…", "message": "…" } ] }
status Meaning
integrated All the lines were taken into account
partially_integrated Only some; the detail is in issues
rejected File refused: wrong format or totals, different fingerprint, duplicate, unknown type
integration_failed Platform error, taken back without action from you

A refused file is also returned in error/ with <name>.reason.txt. Fix it and drop it again under another name: the same content is recognised as a duplicate.

The files prepared for you arrive in out/ (with <name>.sha256 if agreed). After the download, check the fingerprint (sha256sum -c <name>.sha256) then acknowledge by dropping an empty file <name>.ok into in/, or refuse with <name>.ko containing the reason.