Skip to content

Mercury: Get treasury transactions

Mercury treasury.getTreasuryTransactions: arguments, response, policy and SDK examples.

← Treasury operations · Get started

Operation mercury.gettreasurytransactions

Provider route: GET /treasury/{treasuryId}/transactions. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/mercury with npm, or alter-sdk-mercury with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { MercuryIntegration } from "@alter-ai/mercury";
async function execute(input: Parameters<MercuryIntegration["treasury"]["getTreasuryTransactions"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new MercuryIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.treasury.getTreasuryTransactions(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_mercury import MercuryIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = MercuryIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.treasury.get_treasury_transactions(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.treasuryIdstringRequired within parentID for a Mercury account.
Format: uuid
queryobjectOptionalAdditional keys: not allowed
query.limitintegerOptionalMaximum number of results to return. Defaults to 100
Default: 100
Format: int64
Maximum: 1000
Minimum: 1
query.orderstringOptionalSort order for transactions. Can be ‘asc’ or ‘desc’. Defaults to ‘desc’
Default: desc
One of: asc, desc
query.cursorintegerOptionalPagination cursor for retrieving next batch of transactions. Must be an integer >= 0
Minimum: 0

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get treasury transactions — response body

Referenced models: Get treasury transactions — response body

Get treasury transactions — response body
FieldTypePresenceDescription and constraints
$objectRootResponse type for treasury transactions API endpoint
cursorJSONOptional
cursor (anyOf 1)JSONAlternative
cursor (anyOf 1) (allOf 1)ModelAll variants applyExpand Get treasury transactions — response body — cursor value value
cursor (anyOf 1) (allOf 2)JSONAll variants applyPagination cursor for retrieving next batch of transactions
cursor (anyOf 2)nullAlternative
transactionsarrayRequired within parentList of treasury transactions in the response
transactions[]ModelEach itemExpand Get treasury transactions — response body — transactions item

Referenced models: Get treasury transactions — response body — cursor value value, Get treasury transactions — response body — transactions item

Get treasury transactions — response body — cursor value value
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)integerAlternativePagination cursor for retrieving next batch of transactions
Minimum: 0
$ (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
Get treasury transactions — response body — transactions item
FieldTypePresenceDescription and constraints
$objectRootTreasury transaction data for external API consumption
accountIdJSONRequired within parent
accountId (allOf 1)stringAll variants applyID for a Mercury account.
Format: uuid
additionalDetailsJSONOptional
additionalDetails (anyOf 1)stringAlternative
additionalDetails (anyOf 2)nullAlternative
amountJSONRequired within parent
amount (anyOf 1)numberAlternativeMultiple of: 0.01
amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
balanceJSONRequired within parent
balance (anyOf 1)numberAlternativeMultiple of: 0.01
balance (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
canonicalDayJSONRequired within parent
canonicalDay (allOf 1)stringAll variants applyFormat: date
descriptionstringRequired within parent
detailsJSONOptional
details (anyOf 1)JSONAlternative
details (anyOf 1) (allOf 1)ModelAll variants applyExpand Get treasury transactions — response body — transactions item details credit Description, deposit Counterparty Id, fee Description, manual Amendment Description, security, sweep Direction, trade Action, withdrawal Counterparty Id credit Description, deposit Counterparty Id, fee Description, manual Amendment Description, security, sweep Direction, trade Action, withdrawal Counterparty Id
details (anyOf 2)nullAlternative
idJSONRequired within parent
id (allOf 1)stringAll variants applyID for this treasury transaction
Format: uuid
securityJSONOptional
security (anyOf 1)stringAlternative
security (anyOf 2)nullAlternative
typeJSONRequired within parent
type (allOf 1)ModelAll variants applyExpand Get treasury transactions — response body — transactions item type string

Referenced models: Get treasury transactions — response body — transactions item details credit Description, deposit Counterparty Id, fee Description, manual Amendment Description, security, sweep Direction, trade Action, withdrawal Counterparty Id credit Description, deposit Counterparty Id, fee Description, manual Amendment Description, security, sweep Direction, trade Action, withdrawal Counterparty Id, Get treasury transactions — response body — transactions item type string

Get treasury transactions — response body — transactions item details credit Description, deposit Counterparty Id, fee Description, manual Amendment Description, security, sweep Direction, trade Action, withdrawal Counterparty Id credit Description, deposit Counterparty Id, fee Description, manual Amendment Description, security, sweep Direction, trade Action, withdrawal Counterparty Id
FieldTypePresenceDescription and constraints
$objectRoot
creditDescriptionJSONOptional
creditDescription (anyOf 1)stringAlternative
creditDescription (anyOf 2)nullAlternative
depositCounterpartyIdJSONOptional
depositCounterpartyId (anyOf 1)JSONAlternative
depositCounterpartyId (anyOf 1) (allOf 1)stringAll variants applyID for a Mercury account.
Format: uuid
depositCounterpartyId (anyOf 2)nullAlternative
feeDescriptionJSONOptional
feeDescription (anyOf 1)stringAlternative
feeDescription (anyOf 2)nullAlternative
manualAmendmentDescriptionJSONOptional
manualAmendmentDescription (anyOf 1)stringAlternative
manualAmendmentDescription (anyOf 2)nullAlternative
securityJSONOptional
security (anyOf 1)stringAlternative
security (anyOf 2)nullAlternative
sweepDirectionJSONOptional
sweepDirection (anyOf 1)stringAlternative
sweepDirection (anyOf 2)nullAlternative
tradeActionJSONOptional
tradeAction (anyOf 1)stringAlternative
tradeAction (anyOf 2)nullAlternative
withdrawalCounterpartyIdJSONOptional
withdrawalCounterpartyId (anyOf 1)JSONAlternative
withdrawalCounterpartyId (anyOf 1) (allOf 1)stringAll variants applyID for a Mercury account.
Format: uuid
withdrawalCounterpartyId (anyOf 2)nullAlternative
Get treasury transactions — response body — transactions item type string
FieldTypePresenceDescription and constraints
$stringRootKnown values: depositCanceled, depositComplete, depositFailed, depositReturned, mercuryFeePosted, mercuryFeeFailed, mercuryFeeRefunded, mercuryFeeCanceled, withdrawalPosted, withdrawalFailed, withdrawalCanceled, withdrawalReturned, revertTxn, interestPosted, interestCanceled, manualAmendmentPosted, mercuryCreditPosted, mercuryCreditFailed, dividendPosted, dividendCanceled, dividendReinvestmentPosted, mutualFundTradeFailed, mutualFundTradePosted, sweepInPosted, sweepOutPosted, sweepReconcilePosted, valuationChangePosted, oemsMutualFundOrderSettled, oemsMutualFundOrderCanceled, oemsMutualFundOrderRejected, oemsFixedIncomeOrderSettled, oemsFixedIncomeOrderCanceled, oemsFixedIncomeOrderRejected, couponPosted, couponCanceled, maturityPosted, maturityCanceled

SDK function policy ID: mercury.gettreasurytransactions. Catalog operation: mercury:getTreasuryTransactions. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["read"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.