Skip to main content
POST
Connect a token-based accounting provider (NetSuite, Tally)
Creates or refreshes an accounting connection for providers that do not use the browser OAuth flow of Initiate Accounting OAuth. netsuite takes a NetSuite account id and a SuiteTalk OAuth 2.0 access token minted in NetSuite’s own UI (experimental). tally takes no credentials at all — connecting simply enables the local JSONL export sync that Tally’s import tooling reads. If a row for the provider already exists — active, or inactive because Disconnect Accounting Integration cleared is_active (the row is kept) or a sync deactivated it after the provider rejected its token — it is updated in place and reactivated with sync_status reset to idle and last_error cleared; otherwise a new one is created. The lookup does not filter on is_active, so any earlier connection for the provider is refreshed rather than duplicated. Trigger a push afterwards with Trigger Accounting Sync.

Path Parameters

Body Parameters

Optional for tally; required for netsuite.

Example Request

Response

Returns 201 Created for a new connection, or 200 OK when an existing connection for the provider was refreshed. Tokens are never serialized; token_expires_at, realm_id, last_sync_at, and last_error are omitted while unset. The AccountingConnection schema the playground renders was written for the OAuth providers: it lists provider as quickbooks/xero, describes realm_id as a QuickBooks company or Xero organisation id, and types token_expires_at/last_sync_at as nullable. This endpoint returns netsuite or tally, stores the NetSuite account id in realm_id, and omits unset fields rather than sending null — the shape below is what the API actually sends.

Fields

Errors

Errors use the standard envelope — see Errors.

Authorizations

Authorization
string
header
required

Tenant API key obtained from POST /auth/register or POST /v1/developer/keys.

Path Parameters

provider
enum<string>
required
Available options:
netsuite,
tally

Body

application/json
account_id
string

NetSuite account id (required for netsuite).

access_token
string

SuiteTalk OAuth 2.0 access token (required for netsuite).

Response

Existing connection refreshed.

data
object

OAuth access/refresh tokens are stored server-side and never serialized.