Open app

Transaction extract format schema

JSON v1.0

The JSON schema below is defined using zod. For an alternative Rust definition, see scrooje-core crate documentation.

JSON zod schemats
// Amount number with unit of account.
const Amount = z.strictObject({
    // Number represented as a string, e.g. 1000.
    number: z.string(),
    // Amount unit, e.g. EUR.
    unit: z.string(),
});

// Cost basis specification.
const Cost = Amount.extend({
  // Date of the acquisition of the inventory lot.
  date: z.iso.date(),
});

// Transaction leg.
const Posting = z.strictObject({
  // Account name, e.g. Assets:Cash.
  account: z.string(),
  // The amount, e.g. 1000 EUR.
  amount: Amount,
  // Optional cost basis of this leg.
  cost: Cost.nullable(),
  // Optional amount in the foreign unit per unit of posting amount.
  // For example, 1.1 USD.
  // Mutually exclusive with foreign_amount.
  exchange_amount: Amount.nullable(),
  // Optional total amount in the foreign unit.
  // For example, 1100 USD.
  // Mutually exclusive with exchange_amount.
  foreign_amount: Amount.nullable(),
});

// The transaction itself.
const Transaction = z.strictObject({
  // Randomly-generated ID.
  // This is used for overwriting transactions during
  // extract / load workflow.
  id: z.nanoid(),
  // A numeric ID of a transaction.
  // For new entries, this can be anything, just not repeating
  // across all transactions being imported.
  numeric_id: z.uint32(),
  // Transaction date, e.g. 2026-08-24.
  date: z.iso.date(),
  // Transaction description.
  description: z.string(),
  // A set of tags by their name, all lower-case, e.g. trip-paris-2025.
  tags: z.array(z.string()),
  // The legs of the transaction.
  postings: z.array(Posting),
  // Optional transaction comment.
  comment: z.string().nullable(),
});

// The full extracted format schema.
const Transactions = z.strictObject({
    // Version of the extracted data.
    version: z.literal("1.0"),
    // Date and time when this dataset was processed.
    // When extracting from the app, it is set to the current time.
    processed_at: z.iso.datetime(),
    // A list of the transactions.
    transactions: z.array(Transaction),
});

CSV

The CSV table is a flattened representation of transactions and their postings. It has the same fields as the JSON schema, except that optional fields are left empty.

CSV columnstext
// Randomly-generated ID.
// Used for overwriting transactions during extract / load workflow.
// It is a 21-character string built from the A-Za-z0-9_- alphabet.
id
// Numeric ID of a transaction. For new entries, this can be
// any number above 0, just not repeating across all transactions
// being imported.
numeric_id

// A date in ISO format, e.g. 2026-08-24.
date
// Transaction description.
description
// Comma-separated list of tag names, each name in lowercase.
tags

// The number of postings in this transaction.
posting_count
// The numeric index of the posting, starting from 1.
posting_index

// Account name, e.g. Assets:Cash.
account

// Amount number for this posting, e.g. 1000.
amount_number
// Amount unit for this posting, e.g. EUR.
amount_unit

// Optional cost basis. If provided, all three cost_* fields
// must be present.
// Cost basis date in ISO format, e.g. 2026-08-24.
cost_date
// Optional cost amount number, e.g. 10.
cost_number
// Optional cost amount unit, e.g. VTI.
cost_unit

// Optional amount in the foreign unit per unit of posting amount.
// Mutually exclusive with foreign_amount_*.
// If provided, all two exchange_amount_* values must be present.
// Exchange amount number, e.g. 1.1.
exchange_amount_number
// Exchange amount unit, e.g. USD.
exchange_amount_unit

// Optional total amount in the foreign unit.
// Mutually exclusive with exchange_amount_*.
// If provided, all two foreign_amount_* values must be present.
// Foreign amount number, e.g. 1100.
foreign_amount_number
// Foreign amount unit, e.g. USD.
foreign_amount_unit

// Optional transaction comment.
comment

Example table

Example transactioncsv
id,numeric_id,date,description,tags,posting_count,posting_index,account,amount_number,amount_unit,cost_date,cost_number,cost_unit,exchange_amount_number,exchange_amount_unit,foreign_amount_number,foreign_amount_unit,comment
fB-kzqSgRKw7lGpi6HMfv,14676,2026-08-26,Monthly subscription,"recurring,recurring-monthly",2,1,Expenses:Software,15,USD,,,,,,,,
fB-kzqSgRKw7lGpi6HMfv,14676,2026-08-26,Monthly subscription,"recurring,recurring-monthly",2,2,Assets:UK:Bank:Checking,-11,GBP,,,,,,15,USD,

You can always extract a CSV from the transactions table in the app, and then modify it to your requirements.

© 2026 Scrooje Software Limited.
Client-side encrypted, always.