Skip to content

Exports ​

Methods related to exporting data from WAPI to CSV files for download.

Quick Reference ​

MethodDescription
exportBalanceHistoryOutput balanceHistory query to an Export
exportBalancesSearch for Balances using either a simple filter or queryBuilder and save the results to an Export
exportTokensSearch for Tokens using either a simple filter or queryBuilder and save the results to an Export
exportTransferGroupsSearch for TransferGroups using either a simple filter or queryBuilder and save the results to an Export
exportTransfersSearch for Transfers using either a simple filter or queryBuilder and save the results to an Export
exportWalletsSearch for Wallets using either a simple filter or queryBuilder and save the results to an Export
getExportGet an Export file description
listExportsList Export entities by type or time

exportBalanceHistory ​

Output balanceHistory query to an Export

ts
await TEST.client.exportBalanceHistory(
  {
    wallet: 'newWallet',
    token: 'USD',
  },
  {
    limit: 0,
    select: [
      'transfer_identifier',
      'pending_amount',
      'finished_amount',
      'pending_amount_from',
      'pending_amount_to',
      'amount',
    ],
    offset: 0,
    order: 'desc',
    // GENERALOPTIONS
  },
);
ts
{
  export: {
    identifier: 'b-2026-01-26T134618414Z-9084.csv',
    type: 'balances',
    created_at: '2026-01-01T10:00:00.000Z',
    status: 'started',
    fields: [
      'transfer_identifier',
      'pending_amount',
      'pending_amount_to',
      'pending_amount_from',
      'finished_amount',
      'amount'
    ]
  }
};

exportBalanceHistoryFnInput ​

Input for exportBalanceHistory

AttributeTypeRequiredDescription
tokenstring | numberId of the token to withdrawal as
walletstring | number✓Id of the wallet to withdraw from
▶options{}Optional flags for input

exportBalanceHistoryFnOutput ​

Output of exportBalanceHistory

AttributeTypeAlwaysDescription
▶export{}Information about exported file

exportBalances ​

Search for Balances using either a simple filter or queryBuilder and save the results to an Export

ts
await client
  .exportBalances()
  // .whereIn('wallet', ['test-1', 'test-2'])
  .where('wallet', 'like', 'test-%')
  .limit(5)
  .offset(0)
  .orderBy('available_balance')
  .select('wallet_foreign', 'token_foreign', 'available_balance')
  .options({
    tracking_id: 'hello',
  });
ts
{
  export: {
    identifier: 'b-2026-01-26T134616979Z-bda6.csv',
    type: 'balances',
    created_at: '2026-01-01T10:00:00.000Z',
    status: 'started',
    fields: [
      'wallet_foreign',
      'token_foreign',
      'available_balance'
    ]
  }
};

exportBalancesFnInput ​

Input for exportBalances

AttributeTypeRequiredDescription
tokenstring | numberToken to get balance for
walletstring | numberWallet to get balance for
amountstring | numberBalance amount
available_balancestring | numberBalance amount available
pending_amountstring | numberBalance pending_amount
finished_amountstring | numberBalance finished_amount
metadata MetadataSearch ▶Metadata filter for custom properties
▶options{}Optional flags for input

exportBalancesFnOutput ​

Output of exportBalances

AttributeTypeAlwaysDescription
▶export{}Information about exported file

exportTokens ​

Search for Tokens using either a simple filter or queryBuilder and save the results to an Export

ts
await client
  .exportTokens()
  .whereMetadata('meta', '>', 2)
  .where((builder) => {
    builder.where('status', 'active').orWhere('type', 'value');
  })
  .limit(5)
  .offset(0)
  .orderBy('foreign')
  .select('id', 'foreign', 'metadata', 'balance_available_balance')
  .options({
    tracking_id: 'hello',
    include_balance: true,
  });
ts
{
  export: {
    identifier: 't-2026-01-26T134617581Z-77a1.csv',
    type: 'tokens',
    created_at: '2026-01-01T10:00:00.000Z',
    status: 'started',
    fields: [
      'id',
      'foreign',
      'metadata',
      'balance_available_balance'
    ]
  }
};

exportTokensFnInput ​

Input for exportTokens

AttributeTypeRequiredDescription
foreignstring | numberForeign of the token
typeTokenType ▶Type of the token
belongs_tostring | numberForeign of the wallet connected to token
metadata MetadataSearch ▶Metadata filter for custom properties
▶options{}Optional flags for input

exportTokensFnOutput ​

Output of exportTokens

AttributeTypeAlwaysDescription
▶export{}Information about exported file

exportTransferGroups ​

Search for TransferGroups using either a simple filter or queryBuilder and save the results to an Export

ts
await client
  .exportTransferGroups()
  .whereMetadata('even', true)
  .where((builder) => {
    builder
      .where('status', 'closed')
      .orWhere('transfer_status', 'pending');
  })
  .limit(5)
  .offset(0)
  .orderBy('identifier')
  .select('id', 'identifier', 'metadata', 'reverses_identifier')
  .options({
    tracking_id: 'hello',
    return_transfers_count: true,
  });
ts
{
  export: {
    identifier: 'tg-2026-01-26T134615682Z-06a2.csv',
    type: 'transfer_groups',
    created_at: '2026-01-01T10:00:00.000Z',
    status: 'started',
    fields: [
      'id',
      'identifier',
      'metadata',
      'reverses_identifier',
      'transfers_count'
    ]
  }
};

exportTransferGroupsFnInput ​

Input for exportTransferGroups

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

exportTransferGroupsFnOutput ​

Output of exportTransferGroups

AttributeTypeAlwaysDescription
▶export{}Information about exported file

exportTransfers ​

Search for Transfers using either a simple filter or queryBuilder and save the results to an Export

ts
await client
  .exportTransfers()
  .where({
    metadata: {
      example: true,
    },
  })
  .where('id', '>', 1)
  .where((builder) => {
    builder.where('status', 'finished').orWhere('type', 'deposit');
  })
  .limit(5)
  .offset(0)
  .orderBy(['token_id', { column: 'id', order: 'desc' }])
  .select(
    'id',
    'type',
    'from_wallet_foreign',
    'to_wallet_foreign',
    'amount',
  )
  .options({
    tracking_id: 'hello',
  });
ts
{
  export: {
    identifier: 'tx-2026-01-26T134611648Z-ae75.csv',
    type: 'transfers',
    created_at: '2026-01-01T10:00:00.000Z',
    status: 'started',
    fields: [
      'id',
      'type',
      'from_wallet_foreign',
      'to_wallet_foreign',
      'amount'
    ]
  }
};

exportTransfersFnInput ​

Input for exportTransfers

AttributeTypeRequiredDescription
walletstring | numberForeign of the wallet connected to transfers
tokenstring | numberForeign of the token transferred
from_walletstring | numberForeign of the wallet transfers are made from
to_walletstring | numberForeign of the wallet transfers are made to
transfer_groupstring | numberForeign of the transfer_group the transfers are a part of
typeTransferType ▶Type of the transfer
statusTransfersStatus ▶Status of the transfers
metadata MetadataSearch ▶Metadata filter for custom properties
▶options{}Optional flags for input

exportTransfersFnOutput ​

Output of exportTransfers

AttributeTypeAlwaysDescription
▶export{}Information about exported file

exportWallets ​

Search for Wallets using either a simple filter or queryBuilder and save the results to an Export

ts
await client
  .exportWallets()
  .whereMetadata('meta', '>', 2)
  .where((builder) => {
    builder.where('status', 'active').orWhere('type', 'regular');
  })
  .limit(5)
  .offset(0)
  .orderBy('foreign')
  .select('id', 'foreign', 'metadata', 'balance_available_balance')
  .options({
    tracking_id: 'hello',
    include_balance_for_token: 'EUR',
  });
ts
{
  export: {
    identifier: 'w-2026-01-26T134617326Z-1a5b.csv',
    type: 'wallets',
    created_at: '2026-01-01T10:00:00.000Z',
    status: 'started',
    fields: [
      'id',
      'foreign',
      'metadata',
      'balance_available_balance'
    ]
  }
};

exportWalletsFnInput ​

Input for exportWallets

AttributeTypeRequiredDescription
foreignstring | numberWallet foreign
namestring | numberWallet name
typeWalletType ▶Type of the wallet
statusWalletStatus ▶Current status for the wallet
metadata MetadataSearch ▶Metadata filter for custom properties
▶options{}Optional flags for input

exportWalletsFnOutput ​

Output of exportWallets

AttributeTypeAlwaysDescription
▶export{}Information about exported file

getExport ​

Get an Export file description

ts
await client.getExport(
  {
    identifier: exportingResult.export!.identifier,
  },
  {
    return_signed_url: true,
    tracking_id: 'myLogId',
  },
);
ts
{
  export: {
    identifier: 'tx-2026-01-26T134610834Z-26e9.csv',
    status: 'completed',
    type: 'transfers',
    created_at: '2026-01-01T10:00:00.000Z',
    completed_at: '2026-01-01T10:00:00.000Z',
    size: '345',
    fields: [
      'id',
      'identifier',
      'from_wallet_foreign',
      'to_wallet_foreign',
      'amount',
      'token_foreign',
      'metadata',
      'status',
      'created_at',
      'updated_at',
      'status_finalized_at'
    ],
    count: 1,
    signed_url: 'https://storage.googleapis.com/wapi-test-exports/test/wapi_8a616d/tx-2026-01-26T134610834Z-26e9.csv?GoogleAccessId=wapi-api-test%40wapi-general-2024.iam.gserviceaccount.com&Expires=1769435471&Signature=PnFW7CUaDKmAAMqwWqCG9kEIXR%2B1mjB%2Fu9rK8%2BZaCLjzY4jnaaHDOWgica5W5sH5411aG3hPVuBW4yMN8h6iGCr3slIUtS5t7PFydAkLGGwcaOi%2Btrz9CZnjy3Tdg5VzuIaCw%2F9EUhuSUr9U9R2OxRU97J%2Fgeuw5VeFVlVNe42x8oAwylpGXf2LkOvEHYgcHouypWt0EiV3cWaIZjBRhPOXT%2FIhnIQ5SffqXxc9g7ScOCJUSxSXiGecHYUORbddzJfGxGjvWyvvPebzb27Iic2pJQgSqxQA%2Fyr6BKV5HQK8LDaHawdMQiew15TduCDBNUey27eKplVThQc1jBs8Iqw%3D%3D'
  }
};

getExportFnInput ​

Input for getExport

AttributeTypeRequiredDescription
identifierstring✓File name of the export to get
▶options{}Optional flags for input

getExportFnOutput ​

Output of getExport

AttributeTypeAlwaysDescription
▶export{}Information about exported file

listExports ​

List Export entities by type or time

ts
await client.listExports(
  {
    type: 'transfers',
  },
  {
    order_by: 'created_at desc',
    tracking_id: 'myLogId',
  },
);
ts
{
  exports: [
    {
      identifier: 'tx-2026-01-26T134613506Z-edda.csv',
      type: 'transfers',
      status: 'completed',
      size: '366',
      created_at: '2026-01-01T10:00:00.000Z',
      completed_at: '2026-01-01T10:00:00.000Z'
    },
    {
      identifier: 'tx-2026-01-26T134613235Z-1957.csv',
      type: 'transfers',
      status: 'completed',
      size: '345',
      created_at: '2026-01-01T10:00:00.000Z',
      completed_at: '2026-01-01T10:00:00.000Z'
    }
  ]
};

listExportsFnInput ​

Input for listExports

AttributeTypeRequiredDescription
typeExportType ▶type of the export
datestringDate of the export
▶options{}Optional flags for input

listExportsFnOutput ​

Output of listExports

AttributeTypeAlwaysDescription
▶exports({})[]✓