Creates a transaction.
const response = await client.transactions.create(
{
account: {
external_id: 'acct_external_123',
id: 'ext_account_YWJjMTIz'
},
allocations: [],
amount: '-1000',
currency: 'USD',
external_id: 'bank_txn_123',
posted: '2024-01-13T00:00:00Z'
}
);| Name | Description |
|---|---|
external_idstring, required | User-provided unique ID. |
accountobject, required | External account for the transaction. Identify it by |
posteddatetime, required | Timestamp when the transaction was posted. Uses ISO 8601 format. |
currencyADA | BTC | DAI | ..., required | ISO 4217 or crypto currency code. |
amountInt64, required | Transaction amount, as a string in the smallest currency unit, such as cents for USD. Can be positive or negative. |
allocationsobject[], required | Allocations for the transaction. An empty array indicates unreconciled funds. |
tagsobject[] | Tags for the transaction. |
| Name | Description |
|---|---|
dataobject | Transaction object. |
{
"data": {
"id": "txn_dHhuX2ZyYWdfMDAx",
"external_id": "bank_txn_123",
"account": {
"id": "ext_account_YWJjMTIz",
"external_id": "acct_external_123"
},
"posted": "2024-01-13T00:00:00Z",
"currency": "USD",
"amount": "-1000",
"allocations": [
{
"invoice_id": "inv_abc123",
"amount": "1000",
"type": "invoice_payin",
"user": {
"id": "user_abc123",
"external_id": "user_ext_001"
}
}
],
"tags": [
{
"key": "department",
"value": "engineering"
}
],
"unallocated_amount": "-1000",
"created": "2024-01-13T00:00:00Z",
"modified": "2024-01-13T00:00:00Z",
"version": 1
}
}Lists all transactions.
const response = await client.transactions.list(
{
account: 'ext_account_YWJjMTIz',
reconciliation_status: 'reconciled'
}
);| Name | Description |
|---|---|
reconciliation_statusreconciled | unreconciled | Filter by reconciliation status. |
accountstring | Filter by account |
| Name | Description |
|---|---|
dataobject[] | List of transaction objects matching the filter criteria. |
{
"data": [
{
"id": "txn_dHhuX2ZyYWdfMDAx",
"external_id": "bank_txn_123",
"account": {
"id": "ext_account_YWJjMTIz",
"external_id": "acct_external_123"
},
"posted": "2024-01-13T00:00:00Z",
"currency": "USD",
"amount": "-1000",
"allocations": [
{
"invoice_id": "inv_abc123",
"amount": "1000",
"type": "invoice_payin",
"user": {
"id": "user_abc123",
"external_id": "user_ext_001"
}
}
],
"tags": [
{
"key": "department",
"value": "engineering"
}
],
"unallocated_amount": "-1000",
"created": "2024-01-13T00:00:00Z",
"modified": "2024-01-13T00:00:00Z",
"version": 1
}
]
}Retrieves the version history of a transaction.
const response = await client.transactions.listHistory('txn_abc123');| Name | Description |
|---|---|
transaction_refstring, required | Transaction |
| Name | Description |
|---|---|
dataobject[] | List of transaction versions over time, ordered by version, oldest first. |
{
"data": [
{
"id": "txn_dHhuX2ZyYWdfMDAx",
"external_id": "bank_txn_123",
"account": {
"id": "ext_account_YWJjMTIz",
"external_id": "acct_external_123"
},
"posted": "2024-01-13T00:00:00Z",
"currency": "USD",
"amount": "-1000",
"allocations": [
{
"invoice_id": "inv_abc123",
"amount": "1000",
"type": "invoice_payin",
"user": {
"id": "user_abc123",
"external_id": "user_ext_001"
}
}
],
"tags": [
{
"key": "department",
"value": "engineering"
}
],
"unallocated_amount": "-1000",
"created": "2024-01-13T00:00:00Z",
"modified": "2024-01-13T00:00:00Z",
"version": 1
}
]
}Retrieves a transaction by ID or external ID.
const response = await client.transactions.retrieve('txn_abc123');| Name | Description |
|---|---|
transaction_refstring, required | Transaction |
| Name | Description |
|---|---|
dataobject | Transaction object. |
{
"data": {
"id": "txn_dHhuX2ZyYWdfMDAx",
"external_id": "bank_txn_123",
"account": {
"id": "ext_account_YWJjMTIz",
"external_id": "acct_external_123"
},
"posted": "2024-01-13T00:00:00Z",
"currency": "USD",
"amount": "-1000",
"allocations": [
{
"invoice_id": "inv_abc123",
"amount": "1000",
"type": "invoice_payin",
"user": {
"id": "user_abc123",
"external_id": "user_ext_001"
}
}
],
"tags": [
{
"key": "department",
"value": "engineering"
}
],
"unallocated_amount": "-1000",
"created": "2024-01-13T00:00:00Z",
"modified": "2024-01-13T00:00:00Z",
"version": 1
}
}Updates a transaction.
const response = await client.transactions.update(
'txn_abc123',
{
current_transaction_version: 1,
tags: { set: [{ key: 'department', value: 'engineering' }] }
}
);| Name | Description |
|---|---|
transaction_refstring, required | Transaction |
current_transaction_versioninteger, required | Current version of the transaction. Must match the stored version. |
tagsobject | Tag updates. |
allocationsobject | Allocation updates. |
| Name | Description |
|---|---|
dataobject | Transaction object. |
{
"data": {
"id": "txn_dHhuX2ZyYWdfMDAx",
"external_id": "bank_txn_123",
"account": {
"id": "ext_account_YWJjMTIz",
"external_id": "acct_external_123"
},
"posted": "2024-01-13T00:00:00Z",
"currency": "USD",
"amount": "-1000",
"allocations": [
{
"invoice_id": "inv_abc123",
"amount": "1000",
"type": "invoice_payin",
"user": {
"id": "user_abc123",
"external_id": "user_ext_001"
}
}
],
"tags": [
{
"key": "department",
"value": "engineering"
}
],
"unallocated_amount": "-1000",
"created": "2024-01-13T00:00:00Z",
"modified": "2024-01-13T00:00:00Z",
"version": 1
}
}Searches transactions.
const response = await client.transactions.search(
{ filter: {} }
);| Name | Description |
|---|---|
filterobject, required | Filter for searching transactions. |
page_infoobject | Pagination parameters. |
| Name | Description |
|---|---|
data_v2object |
{
"data_v2": {
"transactions": [
{
"id": "txn_dHhuX2ZyYWdfMDAx",
"external_id": "bank_txn_123",
"account": {
"id": "ext_account_YWJjMTIz",
"external_id": "acct_external_123"
},
"posted": "2024-01-13T00:00:00Z",
"currency": "USD",
"amount": "-1000",
"allocations": [
{
"invoice_id": "inv_abc123",
"amount": "1000",
"type": "invoice_payin",
"user": {
"id": "user_abc123",
"external_id": "user_ext_001"
}
}
],
"tags": [
{
"key": "department",
"value": "engineering"
}
],
"unallocated_amount": "-1000",
"created": "2024-01-13T00:00:00Z",
"modified": "2024-01-13T00:00:00Z",
"version": 1
}
],
"page_info": {
"next_cursor": "string"
}
}
}Searches transaction allocations.
const response = await client.transactions.searchAllocations(
{ filter: { invoice_id: { any: ['inv_abc123'] } } }
);| Name | Description |
|---|---|
filterobject, required | Filter for searching transaction allocations. |
| Name | Description |
|---|---|
dataobject[] | List of allocation search results. |
{
"data": [
{
"invoice_id": "inv_abc123",
"amount": "1000",
"type": "invoice_payin",
"user": {
"id": "user_abc123",
"external_id": "user_ext_001"
},
"id": "alloc_abc123",
"posted": "2024-01-13T00:00:00Z",
"transaction": {
"id": "txn_dHhuX2ZyYWdfMDAx",
"external_id": "bank_txn_123"
}
}
]
}