Save Reconciliation Baselines
PUT/api/ledger/close/baselines
Save the full set of baselines for one kind (and, for trial_balance, one accounting connection) under one written reason. Baselines record differences between SKU.io and the accounting provider (or between A/R / A/P and their open documents) that were already there before SKU.io's books started, each with a written reason, so the month-end close checks flag only new differences. They are reporting only: nothing is posted, and nothing sent to the provider changes.
accounting:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Body:
kind(required) —trial_balanceorcontrol_account.connection_id(integer) — required fortrial_balance: an accounting connection that supports trial-balance reconciliation. Ignored forcontrol_account.reason(required, string, 3–2000 chars) — why these differences are carried; kept with each baseline, and with any baseline this save clears.as_of_date(optional,Y-m-d,trial_balanceonly) — the day the amounts were measured at; send theas_of_datethe proposal returned. Defaults to the day before your first open month. Saving the same amount at a different day re-records it at that day.accounts(required, array, may be empty, max 500) — the baselines to hold:accounts.*.account_code(required, string, max 64, distinct) — the account code, orreceivable/payableforcontrol_account.accounts.*.account_name(nullable string, max 255).accounts.*.amount(required, number) — the carried difference, SKU.io minus provider (or ledger minus documents). 0 clears the account.
Accounts left out are cleared; an empty list clears them all. An unchanged amount keeps its existing row; a changed one supersedes it. The as-of date is set by the server (the day before the accounting start date, or the payment-posting start date). A baseline only applies to periods ending after its as-of date. Returns the refreshed overview (same shape as List Reconciliation Baselines).
Authentication: Bearer token. Requires the accounting settings permission.
Request
Responses
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.