Map opening balance accounts

PATCH https://app.speybooks.com/api/v1/opening-balances/{id}/map

Update account mappings for unmapped or incorrectly mapped rows. Accepts an array of source label → target account ID overrides and an optional cutover date. Re-runs the OBCE engine and returns a full updated preview with lines, mappings, unmapped, balanceProof, errors, and canConfirm.

Use this endpoint after reviewing the auto-mapped results from upload to correct any mismatches before confirming. The response is the complete preview — there is no need for a subsequent GET call after remapping.

Path parameters

id string required
Data import ID (e.g. dimp_2). Must be in pending status.

Body parameters

cutoverDate string optional
Optional cutover date override (YYYY-MM-DD).
date
mappings array<object> optional
Source label to target account ID overrides.
Show child parameters
sourceLabel string required
Account label from the CSV (e.g. "Office Equipment").
targetAccountId string required
Target account ID (e.g. acc_1030).

Response

200 Mappings updated, OBCE re-run. Returns full preview with lines, balance proof, and canConfirm.
Show response fields
balanceProof object
Show child attributes
balanced boolean
delta string
roundingAmount string
roundingInjected boolean
totalCredit string
totalDebit string
canConfirm boolean
cutoverDate string
errors array<object>
importId string
lines array<object>
Show child attributes
accountCode string
accountId string
accountName string
accountType string
credit string
debit string
isRounding boolean
sourceLabel string
mappings array<object>
Show child attributes
confidence integer
method string
sourceLabel string
targetAccountId string
targetCode string
targetName string
targetType string
stats object
Show child attributes
errorRows integer
ignoredRows integer
totalRows integer
validRows integer
unmapped array<object>

Error codes

404 Pending opening balance import not found.