Account

Canonical contract for persisted account payloads.

Identity source_id, connection_id

Attributes

Field
Type
Description
id
string
Canonical ID — Backfill canonical record ID assigned after persistence. This is distinct from the source-system ID.
source_idrequiredidentity
string
Source ID — Stable external record ID from the source system. Backfill uses this with source_system and, when present, connection_id for idempotent imports and upserts.
source_system
string
Source System — Connector or provider that supplied the record, such as stripe, shopify, qbo, csv_upload, or manual.
connection_ididentity
string
Connection ID — Backfill tenant connection ID that scopes records to a specific external account, store, realm, or integration instance. It may participate in source identity without being required on every create payload.
namerequired
string
Name
code
string
Code
typerequired
string
Type
assetliabilityequityrevenueexpense
sub_type
string
Sub Type
slot
string
Slot
subsidiary_id
string
Subsidiary ID — Business entity or subsidiary identifier for multi-entity accounting. Leave blank when the tenant does not use subsidiaries.
normal_balance
string
Normal Balance
debitcredit
parent_account_id
string
Parent Account ID — Backfill account identifier for a related account record. Use account_id for lookups; account_code is display-only when referring to general ledger accounts and may be absent.
description
string
Description
active
boolean
Active
currency
string
Currency
metadata
map
Metadata
default: %{}

TypeScript SDK

Import

Every canonical resource is exposed as a top-level entity global on @backfill-io/sdk.

import { Account } from "@backfill-io/sdk";

Create

Pass an object matching AccountCreateInput. Required fields are shown below.

const account = Account.create({
  source_id: "source_id_123",
  name: "Acme Corp",
  type: "asset",
});

Get and query

Look up a single record by canonical ID, or query with filters and pagination.

const account = Account.get("account_123");

const results = Account.query({
  where: { },
  orderBy: [{ field: "inserted_at", direction: "desc" }],
  limit: 50,
});

Update

Partial update — pass only the fields you want to change.

Account.update("account_123", {
  // …fields to update
});

Delete

Account.delete("account_123");