Provider GL Sync Estimate
GET/api/ledger/reconciliation/inventory/sync-estimate
A pre-flight, zero-API estimate for the unified provider GL sync (Lane 2): how many Xero calls the operation would cost for the chosen window against how many remain in today's API budget, so the user can weigh it before spending any of it. Computed locally from the cached journal cadence (distinct journals over their date span) plus the one Trial Balance anchor call — it makes no calls to the provider.
Any valid API token can call this endpoint — no specific scope required. Manage tokens.
Authentication: Requires Bearer token.
Query parameters:
connection_id(integer, required): accounting connection id whose journals/budget are estimated.from(date, optional): window start (Y-m-d). Clamped up to the Inventory Start Date — an earlier value never lowers the window below the opening-balance anchor. Defaults to the Inventory Start Date.to(date, optional,after_or_equal:from): window end (Y-m-d). Defaults to today.
Response (data):
can_sync(boolean): false when the Inventory Start Date is unset (no lower bound to anchor against);reasonexplains why.reason(string|null): why the sync can't run, whencan_syncis false.cadence_known(boolean): false on a first-ever sync (nothing cached to extrapolate from) — thenestimated_callsis null.estimated_calls(integer|null): total projected Xero calls (pages + probes + anchor). Null when cadence is unknown.estimated_pages(integer|null): projected forward Journals pages (incl. the terminating empty page).estimated_probe_calls(integer): binary-search probe calls to locate a start offset below the cache (0 when resuming above the cache or from empty).anchor_calls(integer): 0 or 1 — the metered Trial Balance call, charged only when no anchor has been captured for the opening day yet.journals_per_day(number|null): the cached cadence the page count is extrapolated from.daily_remaining(integer|null): Xero calls left in today's budget (from the connection's tracked usage; null if not tracked yet).daily_limit(integer): Xero's per-organisation daily API cap (5000).daily_reset_at(string|null): ISO8601 timestamp when the daily budget resets.over_budget(boolean): true whenestimated_callsexceedsdaily_remaining.inventory_start_date(string|null): Y-m-d lower bound of the window.window_from(string|null): Y-m-d clamped window start actually estimated.window_to(string): Y-m-d window end actually estimated.cached_from/cached_to(string|null): Y-m-d span of journals already cached.
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 Content
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.