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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.treasuryId | string | Required within parent | ID for a Mercury account. Format: uuid |
query | object | Optional | Additional keys: not allowed |
query.limit | integer | Optional | Maximum number of results to return. Defaults to 100 Default: 100 Format: int64 Maximum: 1000 Minimum: 1 |
query.order | string | Optional | Sort order for transactions. Can be ‘asc’ or ‘desc’. Defaults to ‘desc’ Default: desc One of: asc, desc |
query.cursor | integer | Optional | Pagination cursor for retrieving next batch of transactions. Must be an integer >= 0 Minimum: 0 |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Get treasury transactions — response body |
Referenced models: Get treasury transactions — response body
Schemas
Section titled “Schemas”Get treasury transactions — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Response type for treasury transactions API endpoint |
cursor | JSON | Optional | |
cursor (anyOf 1) | JSON | Alternative | |
cursor (anyOf 1) (allOf 1) | Model | All variants apply | Expand Get treasury transactions — response body — cursor value value |
cursor (anyOf 1) (allOf 2) | JSON | All variants apply | Pagination cursor for retrieving next batch of transactions |
cursor (anyOf 2) | null | Alternative | |
transactions | array | Required within parent | List of treasury transactions in the response |
transactions[] | Model | Each item | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | integer | Alternative | Pagination cursor for retrieving next batch of transactions Minimum: 0 |
$ (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Get treasury transactions — response body — transactions item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Treasury transaction data for external API consumption |
accountId | JSON | Required within parent | |
accountId (allOf 1) | string | All variants apply | ID for a Mercury account. Format: uuid |
additionalDetails | JSON | Optional | |
additionalDetails (anyOf 1) | string | Alternative | |
additionalDetails (anyOf 2) | null | Alternative | |
amount | JSON | Required within parent | |
amount (anyOf 1) | number | Alternative | Multiple of: 0.01 |
amount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
balance | JSON | Required within parent | |
balance (anyOf 1) | number | Alternative | Multiple of: 0.01 |
balance (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
canonicalDay | JSON | Required within parent | |
canonicalDay (allOf 1) | string | All variants apply | Format: date |
description | string | Required within parent | |
details | JSON | Optional | |
details (anyOf 1) | JSON | Alternative | |
details (anyOf 1) (allOf 1) | Model | All variants apply | Expand 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) | null | Alternative | |
id | JSON | Required within parent | |
id (allOf 1) | string | All variants apply | ID for this treasury transaction Format: uuid |
security | JSON | Optional | |
security (anyOf 1) | string | Alternative | |
security (anyOf 2) | null | Alternative | |
type | JSON | Required within parent | |
type (allOf 1) | Model | All variants apply | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
creditDescription | JSON | Optional | |
creditDescription (anyOf 1) | string | Alternative | |
creditDescription (anyOf 2) | null | Alternative | |
depositCounterpartyId | JSON | Optional | |
depositCounterpartyId (anyOf 1) | JSON | Alternative | |
depositCounterpartyId (anyOf 1) (allOf 1) | string | All variants apply | ID for a Mercury account. Format: uuid |
depositCounterpartyId (anyOf 2) | null | Alternative | |
feeDescription | JSON | Optional | |
feeDescription (anyOf 1) | string | Alternative | |
feeDescription (anyOf 2) | null | Alternative | |
manualAmendmentDescription | JSON | Optional | |
manualAmendmentDescription (anyOf 1) | string | Alternative | |
manualAmendmentDescription (anyOf 2) | null | Alternative | |
security | JSON | Optional | |
security (anyOf 1) | string | Alternative | |
security (anyOf 2) | null | Alternative | |
sweepDirection | JSON | Optional | |
sweepDirection (anyOf 1) | string | Alternative | |
sweepDirection (anyOf 2) | null | Alternative | |
tradeAction | JSON | Optional | |
tradeAction (anyOf 1) | string | Alternative | |
tradeAction (anyOf 2) | null | Alternative | |
withdrawalCounterpartyId | JSON | Optional | |
withdrawalCounterpartyId (anyOf 1) | JSON | Alternative | |
withdrawalCounterpartyId (anyOf 1) (allOf 1) | string | All variants apply | ID for a Mercury account. Format: uuid |
withdrawalCounterpartyId (anyOf 2) | null | Alternative |
Get treasury transactions — response body — transactions item type string
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | Known 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 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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"]