propose_write
finance

Push one bank statement (camt.053 as JSON): its lines are staged as bank lines and its balances checked. Books nothing.

Changed on

The statement of one bank account, camt.053 flattened: iban and currency (Acct), statement_id (Stmt/Id), opening_date/opening_balance (the opening booked balance, at the start of that day), closing_date/closing_balance (the closing booked balance, at the end of that day) and entries (Ntry, amount signed: CdtDbtInd folded into the sign; every booking_date between the two balance dates). Amounts are decimal strings in the account's precision. Answers 201 with push_id, import_id, inserted, duplicate and chain (ok or breaks). Requires an Idempotency-Key header (8 to 200 characters): a retry with the same key and the same statement answers the first result with replayed: true; the same key over another statement is refused with idempotency_conflict. Refused whole, with reason, when the opening plus the entries is not the closing (fin.bank_push_unbalanced), when the opening does not continue the account's newest balance (fin.bank_push_opening_mismatch) or starts before it (fin.bank_push_overlaps), when entries taken for lines the account already holds leave the period unbalanced (fin.bank_push_duplicates_unbalanced), or when the iban or currency is another account's. An entry's external_id is read as this app's own, and this statement's when statement_id is given. Only an app Magistry reviewed for finance may push. Nothing is booked: a person classifies and reconciles the lines in Books.

post/api/v1/finance/bank-statements

Request

  • Base URL
    https://app.magistry.io
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization codehttps://app.magistry.io/api/oauth/authorize
      Token URLhttps://app.magistry.io/api/oauth/token
      Scopesfinance:write

Headers

Idempotency-Key, string

Required, here or as idempotency_key in the body. A unique string you choose for this request; send the SAME key when retrying and the first answer is returned instead of writing twice (idempotent-replayed: true). The same key with other arguments is 409 idempotency_conflict. If the header and idempotency_key are both sent they must be equal.

Request body

object required
entity_id, string uuid required

The entity, one of those this app was granted (GET /api/v1/finance/entities lists them). In a GET query string entity is accepted too.

bank_account_id, string uuid required

The bank account (GET /api/v1/finance/bank-accounts lists them).

iban, string

The account's IBAN as the statement states it (Acct/Id/IBAN).

currency, string required

The account's currency, ISO 4217 (Acct/Ccy).

statement_id, string

The statement's own id (Stmt/Id).

opening_date, string date required

Bal OPBD: the day whose opening balance this is.

opening_balance, string required

Bal OPBD: the balance at the start of opening_date, signed.

closing_date, string date required

Bal CLBD: the day whose closing balance this is.

closing_balance, string required

Bal CLBD: the balance at the end of closing_date, signed.

entries, object[] required

Ntry: the lines, at most 5000.

idempotency_key, string required

Same as the Idempotency-Key header; give one of the two.

Response

Result

object required
ok, boolean required
result, unknown required

Changes

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    11 more changes in this revision