Skip to content

Transaction methods: attach, categorize, reconcile

The Transaction Verbs attach, categorize, reconcile as typed SDK methods, with inputs, result, refusals and an example.

Reference for Transaction, one group of Transaction methods.

Transaction.attach

Attach matches a receipt File to a card Transaction, or flags the Transaction when no receipt arrives in time. Verb page.

TypeScript
interface TransactionVerbs {
  attach(input: TransactionAttachInput, options?: SB.CallOptions): SB.Call<Transaction>
}

Emits Transaction.attached.

Inputs

InputTypeRequiredDescription
transactionTransactionrequiredThe card Transaction.
fileFileThe receipt; empty to match from the Startup’s Mailboxes.

Returns

OutputTypeRequiredDescription
transactionTransactionrequiredThe Transaction with its receipt.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const transaction = await $.Transaction.attach({ transaction: 'txn_XoxtZe3CQI' })

Transaction.categorize

Categorize codes a Transaction to an account in the chart by the Startup’s Policy and flags a low-confidence code for review. Verb page.

TypeScript
interface TransactionVerbs {
  categorize(input: TransactionCategorizeInput, options?: SB.CallOptions): SB.Call<TransactionCategorizeOutput>
}

Emits Transaction.categorized.

Inputs

InputTypeRequiredDescription
transactionTransactionrequiredThe Transaction to code.
accountstringThe account code to use in place of the Policy’s choice.

Returns

OutputTypeRequiredDescription
transactionTransactionrequiredThe coded Transaction.
accountstringrequiredThe account code it was coded to.
confidencenumberrequiredHow sure the code is, from 0 to 1.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const { transaction, account, confidence } = await $.Transaction.categorize({ transaction: 'txn_XoxtZe3CQI' })

Transaction.reconcile

Reconcile matches a Transaction on a payment rail to the ledger Entries it settles. Verb page.

TypeScript
interface TransactionVerbs {
  reconcile(input: TransactionReconcileInput, options?: SB.CallOptions): SB.Call<Transaction>
}

Emits Transaction.reconciled.

Inputs

InputTypeRequiredDescription
transactionTransactionrequiredThe Transaction to match.

Returns

OutputTypeRequiredDescription
transactionTransactionrequiredThe reconciled Transaction.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
The record is not in a state that allows this Verb, so the call is refused.refusedRead the record, run the Verb that moves it to an allowed state, then retry.None.

Example

TypeScript
import { $ } from 'startup-builder'

const transaction = await $.Transaction.reconcile({ transaction: 'txn_XoxtZe3CQI' })