Create a reconciliation period
Opens a draft period on a bank account from a statement's end date and closing balance. Requires the reconciliations:write permission.
Authorization
AuthorizationstringrequiredBody
application/json
Whether periodStart and openingBalance are allowed depends on history. On the account's very first period both are required. Once any period has been locked both are forbidden — the start is the day after the last locked period ended and the opening balance is that period's closing balance.
bankAccountIdstringrequiredThe bank account to open the period on.
periodEndstring · daterequiredLast day of the period, read in the company's timezone. It must be before today in the company's timezone.
closingBalancenumberrequiredThe balance the bank statement ends on, as a decimal.
periodStartstring · dateFirst day of the period. Required on the account's first period, forbidden afterwards.
openingBalancenumberThe balance the statement starts from, as a decimal. Required on the account's first period, forbidden afterwards.
Response
200 · The period that was created, as a `draft`.
idstringSnowflake id of the period.
bankAccountIdstringThe bank account this period covers.
periodStartstring · dateFirst day of the period, in the company's timezone.
periodEndstring · dateLast day of the period, in the company's timezone.
openingBalancenumberThe bank's balance at the start of the period, as a decimal.
closingBalancenumberThe bank's balance at the end of the period, as a decimal, taken from the statement.
statusenum<string>draft while being prepared, locked once closed, reopened after a locked period has been opened up again. Both draft and reopened are editable.
validityStatusenum<string>Only meaningful once locked. valid when nothing outstanding affects it; invalidated when it has an unacknowledged disposition of its own; impacted when an earlier period is invalidated, so this one's numbers are indirectly in doubt. A draft or reopened period is always valid.
dispositionsDisposition[]Things that changed after this period was locked and are waiting to be acknowledged.
lockedstring · date-timeWhen the period was locked, in the company's timezone. Absent while it is draft or reopened.
createdstring · date-timeWhen the period was created, in the company's timezone.
updatedstring · date-timeWhen it last changed, in the company's timezone.
401 · The access token is missing, expired, or not for this company.
403 · The caller does not hold the `reconciliations:write` permission.
404 · No bank account with this id belongs to the caller's company.
422 · `periodEnd` is today or later; the account already has a `draft` or `reopened` period; the range overlaps an existing period; or `periodStart` or `openingBalance` was required and missing, or supplied when it should have been derived. The `detail` says which.
A period is one bank statement's worth of time on one bank account. You create it as a draft with the statement's closing balance, work through the reconciliation items inside it, and lock it once the bank's figures and MagicDoor's agree. Periods sit end to end: each one starts the day after the last locked one ended and opens with that period's closing balance.
status | What it means | What you can do |
|---|---|---|
draft | Being prepared. Nothing is frozen. | Edit it, delete it, or lock it. |
locked | Closed. Its items are frozen into a snapshot and can no longer be resolved or rematched. | Reopen it — but only if no later period is still locked. |
reopened | Was locked, then opened up again. Editable like a draft, and its items are free again. | Edit it, delete it, or lock it again. |
A bank account can have at most one draft or reopened period. Creating a second one is rejected until the existing one is locked or deleted.