Skip to content

Transfer Groups

Methods for creating and managing transfer groups.

Quick Reference

MethodDescription
createContractCreate a contract like transferGroup
createExchangeCreate an exchange transfer group - change one token in certain amount for another token of certain amount.
The transfers are connected and either fail or succeed both
createTransferGroupCreate a TransferGroup entity to group transfers into a logical or status locked group.
Can include the transfers in the same call or if non 'closed' TransferGroup, add the transfers later.
Can also include child TransferGroups to create a hierarchy.
findTransferGroupsSearch for TransferGroups using either a simple filter or queryBuilder
getTransferGroupGet information about a specific TransferGroup
reverseTransferGroupSimilar to reverseTransfer will reverse value transfers, however it will reverse the whole
group with its children by creating a new group with opposite transfers.
updateTransferGroupUpdate a TransferGroup
updateTransferGroupsUpdate multiple TransferGroup objects

createContract

Create a contract like transferGroup

ts
await client.createContract({
  foreign: 'MYContract',
  metadata: {
    cool: true,
  },
  value_token: 'EUR',
  value_amount: 100,
  owner: 'oppo',
  buyer: {
    wallet: TEST.INFO.WALLETS.withEURFunds0.foreign,
    metadata: {
      buying: true,
    },
    amount: 101,
    token: 'EUR',
  },
});
ts
{
  token: {
    id: 6,
    foreign: 'MYContract',
    public: true,
    belongs_to: 22,
    created_at: '2026-01-01T10:00:00.000Z',
    updated_at: '2026-01-01T10:00:00.000Z',
    metadata: {
      cool: true
    },
    divisor: 1,
    limit: 1,
    type: 'contract',
    status: 'active'
  },
  exchange: {
    transfer_group: {
      id: 1,
      identifier: '7a38374a-c675-46cb-8acc-b132ef63bbc1',
      status: 'closed',
      transfer_status: 'pending',
      metadata: null,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      transfer_status_finalized_at: null,
      type: 'regular',
      validate_final_balance_only: false
    },
    transfers: [
      {
        id: 10,
        identifier: '9cc89c81-14e6-4838-bb0f-f7c51c6bb57b',
        control_hash: null,
        from_wallet_id: 16,
        to_wallet_id: 21,
        token_id: 1,
        amount: 101,
        type: 'transfer',
        status: 'pending',
        force: false,
        auto_hash: false,
        created_at: '2026-01-01T10:00:00.000Z',
        updated_at: '2026-01-01T10:00:00.000Z',
        metadata: {
          buying: true
        },
        transfer_group_id: 1,
        reverses_id: null,
        status_finalized_at: null,
        group_validate: false,
        from_wallet_foreign: '2026-01-01T10:00:00.000Z',
        to_wallet_foreign: 'oppo',
        token_foreign: 'EUR',
        transfer_group_identifier: '7a38374a-c675-46cb-8acc-b132ef63bbc1',
        reverses_identifier: null
      },
      {
        id: 11,
        identifier: 'dc689ae4-c48a-4cf9-ba36-4ccb4f1f3270',
        control_hash: null,
        from_wallet_id: 21,
        to_wallet_id: 16,
        token_id: 6,
        amount: 1,
        type: 'transfer',
        status: 'pending',
        force: false,
        auto_hash: false,
        created_at: '2026-01-01T10:00:00.000Z',
        updated_at: '2026-01-01T10:00:00.000Z',
        metadata: {
          buying: true
        },
        transfer_group_id: 1,
        reverses_id: null,
        status_finalized_at: null,
        group_validate: false,
        from_wallet_foreign: 'oppo',
        to_wallet_foreign: '2026-01-01T10:00:00.000Z',
        token_foreign: 'MYContract',
        transfer_group_identifier: '7a38374a-c675-46cb-8acc-b132ef63bbc1',
        reverses_identifier: null
      }
    ]
  }
};

createContractFnInput

Input for createContract

AttributeTypeRequiredDescription
foreignstring | numberUnique foreign of the created Contract
metadata Metadata Key/value object describing the token
value_tokenstring | numberForeign of the token this contract is valued in
value_amountnumberAmount of value this Contract has
ownerstring | numberForeign of the wallet this contract should initially belong to
buyer{}The properties of the contract from buyer side
options{}Optional flags for input

createContractFnOutput

Output of createContract

AttributeTypeAlwaysDescription
token{}Units of value which can be transferred in this system
exchange{}Output of createTransferGroup

createExchange

Create an exchange transfer group - change one token in certain amount for another token of certain amount. The transfers are connected and either fail or succeed both

ts
await client.createExchange(
  {
    identifier: 'exchange',
    from_identifier: 'exchange1',
    from_wallet: TEST.INFO.WALLETS.withEURFunds0.foreign,
    from_token: 'EUR',
    from_amount: 10,
    to_identifier: 'exchange2',
    to_token: 'USD',
    to_wallet: TEST.INFO.WALLETS.withUSDFunds0.foreign,
    to_amount: 20,
    status: 'finished',
    metadata: {
      exchangeRate: 2,
    },
  },
  {
    tracking_id: 'mylogId',
    // transaction_id: Transaction.identifier, // created transaction identifier
  },
);
ts
{
  transfer_group: {
    id: 2,
    identifier: 'exchange',
    status: 'closed',
    transfer_status: 'finished',
    metadata: {
      exchangeRate: 2
    },
    created_at: '2026-01-01T10:00:00.000Z',
    updated_at: '2026-01-01T10:00:00.000Z',
    reverses_id: null,
    status_finalized_at: '2026-01-01T10:00:00.000Z',
    transfer_status_finalized_at: '2026-01-01T10:00:00.000Z',
    type: 'regular',
    validate_final_balance_only: false
  },
  transfers: [
    {
      id: 12,
      identifier: 'exchange1',
      control_hash: null,
      from_wallet_id: 21,
      to_wallet_id: 15,
      token_id: 1,
      amount: 10,
      type: 'transfer',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: {
        exchangeRate: 2
      },
      transfer_group_id: 2,
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: '2026-01-01T10:00:00.000Z',
      to_wallet_foreign: '2026-01-01T10:00:00.000Z',
      token_foreign: 'EUR',
      transfer_group_identifier: 'exchange',
      reverses_identifier: null
    },
    {
      id: 13,
      identifier: 'exchange2',
      control_hash: null,
      from_wallet_id: 15,
      to_wallet_id: 21,
      token_id: 2,
      amount: 20,
      type: 'transfer',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: {
        exchangeRate: 2
      },
      transfer_group_id: 2,
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: '2026-01-01T10:00:00.000Z',
      to_wallet_foreign: '2026-01-01T10:00:00.000Z',
      token_foreign: 'USD',
      transfer_group_identifier: 'exchange',
      reverses_identifier: null
    }
  ]
};

createExchangeFnInput

Input for createExchange

AttributeTypeRequiredDescription
identifierstringIdentifier for this transfer group. Must be unique
from_identifierstringIdentifier for this transfer. Must be unique
from_walletstring | numberForeign of Wallet where from_token is debited from/to_token is credited to
from_tokenstring | numberForeign of Token that is transferred from->to
from_amountnumberAmount of from_token transferred
to_identifierstringIdentifier for this transfer. Must be unique
to_walletstring | numberForeign of Wallet where from_token is credited to/to_token is debited from. If not specified then to_token.belongs_to is used
to_tokenstring | numberForeign of Token that is transferred to->from
to_amountnumberAmount of to_token transferred. If not specified then from_amount is used
statusStatus The state at which the exchange is created
forcebooleanSet to true to force transfer without checking for negative balance constraints
metadata Metadata Key/value object describing this transfer
options{}Optional flags for input

createExchangeFnOutput

Output of createExchange

AttributeTypeAlwaysDescription
transfer_group{}TransferGroup|An entity collecting transfers into a group locked by status
transfers({})[]Created transfer objects

createTransferGroup

Create a TransferGroup entity to group transfers into a logical or status locked group. Can include the transfers in the same call or if non 'closed' TransferGroup, add the transfers later. Can also include child TransferGroups to create a hierarchy.

ts
await client.createTransferGroup(
  {
    identifier: 'mytgIdentifier',
    status: 'closed',
    metadata: {
      customJSON: true,
    },
    transfer_status: 'finished',
    children: [
      {
        identifier: 'txIdentifier',
        from_wallet: TEST.INFO.WALLETS.withEURFunds0.foreign,
        to_wallet: 'newWalletForeign',
        token: 'EUR',
        amount: 10,
        type: 'transfer',
      },
      {
        identifier: 'childTgTransferId',
        from_wallet: 'newWalletForeign',
        to_wallet: TEST.INFO.WALLETS.withEURFunds0.foreign,
        token: 'EUR',
        amount: 9,
        type: 'transfer',
      },
    ],
  },
  {
    validate_final_balance_only: true,
    create_to_wallet_if_not_exists: true,
    // GENERALOPTIONS
  },
);
ts
{
  transfer_group: {
    id: 3,
    identifier: 'mytgIdentifier',
    status: 'closed',
    transfer_status: 'finished',
    metadata: {
      customJSON: true
    },
    created_at: '2026-01-01T10:00:00.000Z',
    updated_at: '2026-01-01T10:00:00.000Z',
    reverses_id: null,
    status_finalized_at: '2026-01-01T10:00:00.000Z',
    transfer_status_finalized_at: '2026-01-01T10:00:00.000Z',
    type: 'regular',
    validate_final_balance_only: true
  },
  transfers: [
    {
      id: 8,
      identifier: 'txIdentifier',
      control_hash: null,
      from_wallet_id: 16,
      to_wallet_id: 18,
      token_id: 1,
      amount: 10,
      type: 'transfer',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: null,
      transfer_group_id: 3,
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: '2026-01-01T10:00:00.000Z',
      to_wallet_foreign: 'newWalletForeign',
      token_foreign: 'EUR',
      transfer_group_identifier: 'mytgIdentifier',
      reverses_identifier: null
    },
    {
      id: 9,
      identifier: 'childTgTransferId',
      control_hash: null,
      from_wallet_id: 18,
      to_wallet_id: 16,
      token_id: 1,
      amount: 9,
      type: 'transfer',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: null,
      transfer_group_id: 3,
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: 'newWalletForeign',
      to_wallet_foreign: '2026-01-01T10:00:00.000Z',
      token_foreign: 'EUR',
      transfer_group_identifier: 'mytgIdentifier',
      reverses_identifier: null
    }
  ]
};

createTransferGroupFnInput

Input for createTransferGroup

AttributeTypeRequiredDescription
identifierstringIdentifier for this transfer group. Must be unique
statusStatus Lifecycle status for transfer group
transfer_statusTransfer_status Status of the transfers
metadata Metadata Key/value object describing this transfer_group
childrencreateTransferFnInput[]
options{}Optional flags for input

createTransferGroupFnOutput

Output of createTransferGroup

AttributeTypeAlwaysDescription
transfer_group{}TransferGroup|An entity collecting transfers into a group locked by status
transfers({})[]Created transfer objects

findTransferGroups

Search for TransferGroups using either a simple filter or queryBuilder

ts
await client
  .findTransferGroups()
  .where({
    metadata: {
      even: true,
      example: 'test',
    },
  })
  .orWhere({
    identifier: 'reverser-example',
  })
  .orWhere((builder) => {
    builder
      .where({
        metadata: {
          kak: true,
        },
      })
      .where('created_at', '>', '2020-01-01');
  })
  .limit(5)
  .offset(0)
  .orderBy('id', 'desc')
  .select('id', 'type', 'identifier')
  .options({
    tracking_id: 'hello',
    return_metadata_total: true,
    return_transfers_count: true,
  });
ts
{
  transfer_groups: [
    {
      id: 22,
      type: 'regular',
      identifier: 'reverser-example',
      transfers_count: 0
    },
    {
      id: 20,
      type: 'regular',
      identifier: 'group-example8',
      transfers_count: 1
    },
    {
      id: 18,
      type: 'regular',
      identifier: 'group-example6',
      transfers_count: 0
    },
    {
      id: 16,
      type: 'regular',
      identifier: 'group-example4',
      transfers_count: 0
    },
    {
      id: 14,
      type: 'regular',
      identifier: 'group-example2',
      transfers_count: 0
    }
  ],
  metadata: {
    limit: 5,
    offset: 0,
    total: 6,
    more_rows: true,
    order: [
      {
        field: 'id',
        direction: 'desc'
      }
    ]
  }
};

findTransferGroupsFnInput

Input for findTransferGroups

AttributeTypeRequiredDescription
identifierstring | numberIdentifier of the transfer_group
transfer_statusTransfer_status Status of the transfers
statusTransfer_groupStatus Status of the transfer_group
reversesstring | numberIdentifier of the transfer_group the transfer_group reverses
typeTransfer GroupType Type of the transfer group
metadata MetadataSearch Metadata filter for custom properties
options{}Optional flags for input

findTransferGroupsFnOutput

Output of findTransferGroups

AttributeTypeAlwaysDescription
transfer_groups({})[]Found transfers
metadata{}Metadata about the search

getTransferGroup

Get information about a specific TransferGroup

ts
await client.getTransferGroup(
  {
    transfer_group: GROUP_IDENTIFIER,
  },
  {
    create_if_not_exists: true,
    return_transfers: true,
    return_reversed_by: true,
    // return_only_id: true, // example requires more than just ID
    // GENERALOPTIONS
  },
);
ts
{
  transfer_group: {
    id: 1,
    identifier: '5914bec1047eec0c0600492254054831',
    status: 'open',
    transfer_status: 'pending',
    metadata: null,
    created_at: '2026-01-01T10:00:00.000Z',
    updated_at: '2026-01-01T10:00:00.000Z',
    reverses_id: null,
    status_finalized_at: null,
    transfer_status_finalized_at: null,
    type: 'regular',
    validate_final_balance_only: false,
    reverses_identifier: null,
    reversed_by_identifier: null,
    transfers: [
      {
        id: 4,
        identifier: '326121d5-9013-41d0-8822-cb51c7c784c2',
        control_hash: null,
        from_wallet_id: 1,
        to_wallet_id: 18,
        token_id: 1,
        amount: 10,
        type: 'deposit',
        status: 'pending',
        force: false,
        auto_hash: false,
        created_at: '2026-01-01T10:00:00.000Z',
        updated_at: '2026-01-01T10:00:00.000Z',
        metadata: null,
        transfer_group_id: 1,
        reverses_id: null,
        status_finalized_at: null,
        group_validate: false,
        from_wallet_foreign: 'EUR',
        to_wallet_foreign: '8b23a02aa95d53362c607750d1f8db70',
        token_foreign: 'EUR',
        transfer_group_identifier: '5914bec1047eec0c0600492254054831',
        reverses_identifier: null
      },
      {
        id: 5,
        identifier: 'ddc03532-9914-4f48-a0cf-4b47405a43b3',
        control_hash: null,
        from_wallet_id: 18,
        to_wallet_id: 19,
        token_id: 1,
        amount: 5,
        type: 'transfer',
        status: 'pending',
        force: false,
        auto_hash: false,
        created_at: '2026-01-01T10:00:00.000Z',
        updated_at: '2026-01-01T10:00:00.000Z',
        metadata: null,
        transfer_group_id: 1,
        reverses_id: null,
        status_finalized_at: null,
        group_validate: false,
        from_wallet_foreign: '8b23a02aa95d53362c607750d1f8db70',
        to_wallet_foreign: 'f9272c22dbe11889eca8bfbe8787c219',
        token_foreign: 'EUR',
        transfer_group_identifier: '5914bec1047eec0c0600492254054831',
        reverses_identifier: null
      }
    ]
  }
};

getTransferGroupFnInput

Input for getTransferGroup

AttributeTypeRequiredDescription
transfer_groupstring | numberidentifier of the transfer group to reverse
options{}Optional flags for input

getTransferGroupFnOutput

Output of getTransferGroup

AttributeTypeAlwaysDescription
transfer_group{}requested transfer_group

reverseTransferGroup

Similar to reverseTransfer will reverse value transfers, however it will reverse the whole group with its children by creating a new group with opposite transfers.

ts
await TEST.client.reverseTransferGroup(
  {
    transfer_group: 'myCustom',
    identifier: 'myCustomReverse',
    metadata: {
      extraCustomJSON: true,
    },
    transfer_status: 'finished',
  },
  {
    validate_final_balance_only: true,
    reverse_deposit: true,
    reverse_withdrawal: true,
    return_transfers: true,
    metadata_action: 'extend',
    transfer_metadata_action: 'extend',
    // GENERALOPTIONS
  },
);
ts
{
  transfer_group: {
    id: 7,
    identifier: 'myCustomReverse',
    status: 'closed',
    transfer_status: 'finished',
    metadata: {
      customJSON: true,
      extraCustomJSON: true
    },
    created_at: '2026-01-01T10:00:00.000Z',
    updated_at: '2026-01-01T10:00:00.000Z',
    reverses_id: 6,
    status_finalized_at: '2026-01-01T10:00:00.000Z',
    transfer_status_finalized_at: '2026-01-01T10:00:00.000Z',
    type: 'regular',
    validate_final_balance_only: false
  },
  transfers: [
    {
      id: 18,
      identifier: 'b0b777a9-1073-4c96-b990-367a50fdb04c',
      control_hash: null,
      from_wallet_id: 19,
      to_wallet_id: 18,
      token_id: 1,
      amount: 8,
      type: 'transfer',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: {},
      transfer_group_id: 7,
      reverses_id: 17,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: 'myWallet2',
      to_wallet_foreign: 'myWallet1',
      token_foreign: 'EUR',
      transfer_group_identifier: 'myCustomReverse',
      reverses_identifier: 'transferB'
    },
    {
      id: 19,
      identifier: '54e8d2dd-b6c2-4de5-8396-133e070c3a22',
      control_hash: null,
      from_wallet_id: 18,
      to_wallet_id: 1,
      token_id: 1,
      amount: 10,
      type: 'withdrawal',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: {},
      transfer_group_id: 7,
      reverses_id: 16,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: 'myWallet1',
      to_wallet_foreign: 'EUR',
      token_foreign: 'EUR',
      transfer_group_identifier: 'myCustomReverse',
      reverses_identifier: 'transferA'
    }
  ]
};

reverseTransferGroupFnInput

Input for reverseTransferGroup

AttributeTypeRequiredDescription
transfer_groupstring | numberidentifier of the transfer group to reverse
transfer_statusTransfer_status Status of the transfer
identifierstringIdentifier for this transfer group. Must be unique
forcebooleanSet to true to force transfer without checking for negative balance constraints
metadata Metadata Key/value object describing this transfer_group
transfer_metadata{[key:string]: string | boolean | number | null | undefined | unknown | (string | boolean | number | null | undefined | unknown)[]}Key/value object describing this transfer
extend_metadata{[key:string]: string | boolean | number | null | undefined | unknown | (string | boolean | number | null | undefined | unknown)[]}Key value object to extend metadata with on created transfer
transfer_extend_metadata{[key:string]: string | boolean | number | null | undefined | unknown | (string | boolean | number | null | undefined | unknown)[]}Key value object to extend metadata with on created transfer
options{}Optional flags for input

reverseTransferGroupFnOutput

Output of reverseTransferGroup

AttributeTypeAlwaysDescription
transfer_group{}TransferGroup|An entity collecting transfers into a group locked by status
transfers({})[]Updated transfers

updateTransferGroup

Update a TransferGroup

ts
await client.updateTransferGroup(
  {
    transfer_group: 'myCustom',
    status: 'closed',
    transfer_status: 'finished',
    metadata: {
      newCustomJson: true,
    },
    transfer_metadata: {
      myfield: 1,
    },
  },
  {
    return_transfers: true,
    return_when_not_updated: true,
    metadata_action: 'extend',
    transfer_metadata_action: 'replace',
    // GENERALOPTIONS
  },
);
ts
{
  transfer_group: {
    id: 3,
    identifier: 'myCustom',
    status: 'closed',
    transfer_status: 'finished',
    metadata: {
      customJSON: true,
      newCustomJson: true
    },
    created_at: '2026-01-01T10:00:00.000Z',
    updated_at: '2026-01-01T10:00:00.000Z',
    reverses_id: null,
    status_finalized_at: '2026-01-01T10:00:00.000Z',
    transfer_status_finalized_at: '2026-01-01T10:00:00.000Z',
    type: 'regular',
    validate_final_balance_only: false
  },
  transfers: [
    {
      id: 4,
      identifier: 'transferA',
      control_hash: null,
      from_wallet_id: 1,
      to_wallet_id: 18,
      token_id: 1,
      amount: 10,
      type: 'deposit',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: {
        myfield: 1
      },
      transfer_group_id: 3,
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: 'EUR',
      to_wallet_foreign: 'myWallet1',
      token_foreign: 'EUR',
      transfer_group_identifier: 'myCustom',
      reverses_identifier: null
    },
    {
      id: 5,
      identifier: 'transferB',
      control_hash: null,
      from_wallet_id: 18,
      to_wallet_id: 19,
      token_id: 1,
      amount: 8,
      type: 'transfer',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: {
        myfield: 1
      },
      transfer_group_id: 3,
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: 'myWallet1',
      to_wallet_foreign: 'myWallet2',
      token_foreign: 'EUR',
      transfer_group_identifier: 'myCustom',
      reverses_identifier: null
    }
  ],
  updated: true
};

updateTransferGroupFnInput

Input for updateTransferGroup

AttributeTypeRequiredDescription
transfer_groupstring | numberTransferGroup identifier
statusclosedLifecycle status of the TransferGroup
transfer_statusTransfer_status Status all the transfers should be set at.
metadata Metadata Key value object to replace or extend with existing TransferGroup metadata
transfer_metadata{[key:string]: string | boolean | number | null | undefined | unknown | (string | boolean | number | null | undefined | unknown)[]}Key value object to be replace or extend existing Transfers metadata
options{}Optional flags for input

updateTransferGroupFnOutput

Output of updateTransferGroup

AttributeTypeAlwaysDescription
transfer_group{}TransferGroup|An entity collecting transfers into a group locked by status
updatedbooleanBoolean showing if the transfer_group was updated
transfers({})[]Updated transfers

updateTransferGroups

Update multiple TransferGroup objects

ts
await client
  .updateTransferGroups()
  .where({
    status: 'open',
  })
  .whereIn('identifier', ['transferGroup1', 'transferGroup2'])
  .whereMetadata('old', 'data')
  .update({
    transfer_status: 'finished',
    transfer_metadata: {
      myfield: 2,
    },
  })
  .options({
    return_transfers: true,
    transfer_metadata_action: 'extend',
  });
ts
{
  transfer_groups: [
    {
      id: 10,
      identifier: 'transferGroup1',
      status: 'closed',
      transfer_status: 'finished',
      metadata: {
        old: 'data'
      },
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      transfer_status_finalized_at: '2026-01-01T10:00:00.000Z',
      type: 'regular',
      validate_final_balance_only: false,
      reverses_identifier: null
    },
    {
      id: 11,
      identifier: 'transferGroup2',
      status: 'closed',
      transfer_status: 'finished',
      metadata: {
        old: 'data'
      },
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      transfer_status_finalized_at: '2026-01-01T10:00:00.000Z',
      type: 'regular',
      validate_final_balance_only: false,
      reverses_identifier: null
    }
  ],
  updated: true,
  transfers: [
    {
      id: 22,
      identifier: '28f3ae59-6caf-415f-ba3a-a6435dc7134c',
      control_hash: null,
      from_wallet_id: 1,
      to_wallet_id: 21,
      token_id: 1,
      amount: 10,
      type: 'deposit',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: {
        old: 'data',
        myfield: 2
      },
      transfer_group_id: 10,
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: 'EUR',
      to_wallet_foreign: 'myWallet3',
      token_foreign: 'EUR',
      transfer_group_identifier: 'transferGroup1',
      reverses_identifier: null
    },
    {
      id: 23,
      identifier: '8ffc5006-00f8-4acf-965b-2d11ff3a5e61',
      control_hash: null,
      from_wallet_id: 1,
      to_wallet_id: 22,
      token_id: 1,
      amount: 2,
      type: 'deposit',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: {
        old: 'data',
        myfield: 2
      },
      transfer_group_id: 10,
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: 'EUR',
      to_wallet_foreign: 'myWallet4',
      token_foreign: 'EUR',
      transfer_group_identifier: 'transferGroup1',
      reverses_identifier: null
    },
    {
      id: 24,
      identifier: '2ae5b665-502d-4362-aa02-550d80b0611b',
      control_hash: null,
      from_wallet_id: 1,
      to_wallet_id: 21,
      token_id: 1,
      amount: 10,
      type: 'deposit',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: {
        old: 'data',
        myfield: 2
      },
      transfer_group_id: 11,
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: 'EUR',
      to_wallet_foreign: 'myWallet3',
      token_foreign: 'EUR',
      transfer_group_identifier: 'transferGroup2',
      reverses_identifier: null
    },
    {
      id: 26,
      identifier: 'ae9cd4bb-b23c-4e42-8269-2fe53c86584b',
      control_hash: null,
      from_wallet_id: 1,
      to_wallet_id: 22,
      token_id: 1,
      amount: 2,
      type: 'deposit',
      status: 'finished',
      force: false,
      auto_hash: false,
      created_at: '2026-01-01T10:00:00.000Z',
      updated_at: '2026-01-01T10:00:00.000Z',
      metadata: {
        old: 'data',
        myfield: 2
      },
      transfer_group_id: 11,
      reverses_id: null,
      status_finalized_at: '2026-01-01T10:00:00.000Z',
      group_validate: false,
      from_wallet_foreign: 'EUR',
      to_wallet_foreign: 'myWallet4',
      token_foreign: 'EUR',
      transfer_group_identifier: 'transferGroup2',
      reverses_identifier: null
    }
  ]
};

updateTransferGroupsFnInput

Input for updateTransferGroups

AttributeTypeRequiredDescription
identifierstring | numberIdentifier of the transfer_group
transfer_statusTransfer_status Status of the transfers
statusTransfer_groupStatus Status of the transfer_group
reversesstring | numberIdentifier of the transfer_group the transfer_group reverses
typeTransfer GroupType Type of the transfer group
metadata MetadataSearch Metadata filter for custom properties
update{}
options{}Optional flags for input

updateTransferGroupsFnOutput

Output of updateTransferGroups

AttributeTypeAlwaysDescription
transfer_groups({})[]Updated transfer groups
transfers({})[]Updated transfers
updatedbooleanBoolean showing if the transfer_group were updated