Update
client.transactions.update(stringtransactionRef, TransactionUpdateParams { current_transaction_version, allocations, tags } body, RequestOptionsoptions?): TransactionUpdateResponse { data }
PATCH/transactions/{transaction_ref}
Updates a transaction (tags, allocations, or both)
Parameters
transactionRef: string
Transaction reference. Accepts either an encoded Fragment ID (txn_xxx) or an external ID.
Returns
Update
import Fragment from '@fragment-dev/ts-node';
const client = new Fragment();
const transaction = await client.transactions.update('txn_abc123', {
current_transaction_version: 0,
});
console.log(transaction.data);{
"data": {
"id": "txn_dHhuX2ZyYWdfMDAx",
"account": {
"id": "ext_account_YWJjMTIz",
"external_id": "acct_external_123"
},
"allocations": [
{
"amount": "1000",
"invoice_id": "inv_abc123",
"type": "invoice_payin",
"user": {
"id": "user_abc123",
"external_id": "user-ext-001"
}
}
],
"amount": "-1000",
"created": "2026-02-12T00:00:00.000Z",
"currency": "USD",
"external_id": "bank_txn_123",
"posted": "2026-02-12T00:00:00.000Z",
"tags": [
{
"key": "region",
"value": "us-east"
}
],
"unallocated_amount": "-1000",
"version": 1,
"modified": "2026-02-12T01:00:00.000Z"
}
}Returns Examples
{
"data": {
"id": "txn_dHhuX2ZyYWdfMDAx",
"account": {
"id": "ext_account_YWJjMTIz",
"external_id": "acct_external_123"
},
"allocations": [
{
"amount": "1000",
"invoice_id": "inv_abc123",
"type": "invoice_payin",
"user": {
"id": "user_abc123",
"external_id": "user-ext-001"
}
}
],
"amount": "-1000",
"created": "2026-02-12T00:00:00.000Z",
"currency": "USD",
"external_id": "bank_txn_123",
"posted": "2026-02-12T00:00:00.000Z",
"tags": [
{
"key": "region",
"value": "us-east"
}
],
"unallocated_amount": "-1000",
"version": 1,
"modified": "2026-02-12T01:00:00.000Z"
}
}