Transactions
List, create and delete transactions. The JSON:API type of each transaction names its kind and fixes its attributes and relationships.
Data model
The relationship to the instrument a transaction affects is named asset, with type asset.
Account interest transaction
account-interest-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commentstringA brief text note or explanation related to the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
Bond coupon transaction
bond-coupon-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commentstringA brief text note or explanation related to the transaction.
grossAmountnumberRequiredTotal coupon amount. Denominated in instrument currency.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
assetassetThe instrument affected by the transaction.
depositorydepositoryThe depository the instrument is held in.
Bond redemption transaction
bond-redemption-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commentstringA brief text note or explanation related to the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
unitPricenumberRequiredPrice per instrument unit.
unitsnumberRequiredNumber of units redeemed.
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
assetassetThe instrument affected by the transaction.
depositorydepositoryThe depository affected by the transaction.
Bond trade transaction
bond-trade-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
accruedInterestnumberRequiredInterest accumulated on the bond from the latest repayment date to the transaction date. Denominated in instrument currency.
commissionnumberRequiredCommission charged by the bank or custodian. Denominated in account currency. A positive number means commission paid.
commentstringA brief text note or explanation related to the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
unitPricenumberRequiredPrice per instrument unit.
unitsnumberRequiredNumber of units bought or sold.
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
assetassetThe instrument affected by the transaction.
depositorydepositoryThe depository affected by the transaction.
Cash transfer transaction
cash-transfer-transaction
A cash transfer can be an external transfer to an outside account or an internal transfer between accounts. An internal transfer is made by setting the counterparty-transaction relationship to the id of the related counterparty transaction; see Internal cash transfer.
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commentstringA brief text note or explanation related to the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
counterparty-transactioncash-transfer-transactionThe linked transaction associated with this transaction.
Dividend transaction
dividend-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commentstringA brief text note or explanation related to the transaction.
commissionnumberCommission charged by the bank or custodian. Denominated in account currency. A positive number means commission paid. Defaults to zero if not specified.
grossAmountnumberRequiredTotal dividend amount before any deductions. Denominated in instrument currency.
taxnumberRequiredTax charged as part of the transaction. Denominated in instrument currency.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
assetassetThe instrument affected by the transaction.
depositorydepositoryThe depository the instrument is held in.
Equity trade transaction
equity-trade-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commissionnumberRequiredCommission charged by the bank or custodian. Denominated in account currency. A positive number means commission paid.
commentstringA brief text note or explanation related to the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
unitPricenumberRequiredPrice per instrument unit.
unitsnumberRequiredNumber of units bought or sold.
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
assetassetThe instrument affected by the transaction.
depositorydepositoryThe depository affected by the transaction.
Fee transaction
fee-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commentstringA brief text note or explanation related to the transaction.
categorystringType of fee. Possible values:
custody,management,other. Default isother.tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
Futures trade transaction
futures-trade-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commissionnumberRequiredCommission charged by the bank or custodian. Denominated in account currency. A positive number means commission paid.
commentstringA brief text note or explanation related to the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
unitPricenumberRequiredPrice per instrument unit.
unitsnumberRequiredNumber of units bought or sold.
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
assetassetThe instrument affected by the transaction.
depositorydepositoryThe depository affected by the transaction.
Futures execution transaction
futures-execution-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commissionnumberRequiredCommission charged by the bank or custodian. Denominated in account currency. A positive number means commission paid.
commentstringA brief text note or explanation related to the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
unitPricenumberRequiredPrice per instrument unit.
unitsnumberRequiredNumber of units bought or sold.
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
assetassetThe instrument affected by the transaction.
openingTransactiontransactionThe futures trade transaction associated with this transaction.
depositorydepositoryThe depository affected by the transaction.
FX forward cash settlement transaction
fx-forward-cash-settlement-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
fxForwardassetThe FX forward agreement that is being settled.
FX forward physical delivery transaction
fx-forward-physical-delivery-transaction
primaryAccountAmountnumberRequiredAmount deposited or withdrawn from the related account
primaryAccount. Denominated in the currency of the primary account.secondaryAccountAmountnumberRequiredAmount deposited or withdrawn from the related account
secondaryAccount. Denominated in the currency of the secondary account.tradeDatestringRequiredISO 8601 representation of the transaction's trade date.
valueDatestringRequiredISO 8601 representation of the transaction's value date.
Relationships:
primaryAccountaccountThe bank account affected by the primary currency of the FX pair.
secondaryAccountaccountThe bank account affected by the secondary currency of the FX pair.
fxForwardfx-forward-physical-delivery-assetThe FX forward agreement that is being settled.
FX spot transaction
fx-spot-transaction
commentstringA brief text note or explanation related to the transaction.
inflowAccountAmountnumberRequiredAmount deposited to the related account
inflowAccount. The amount must be positive and is denominated in the currency of the inflow account.outflowAccountAmountnumberRequiredAmount withdrawn from the related account
outflowAccount. The amount must be negative and is denominated in the currency of the outflow account.tradeDatestringRequiredISO 8601 representation of the transaction's trade date.
valueDatestringRequiredISO 8601 representation of the transaction's value date.
Relationships:
inflowAccountaccountAccount to which the inflow currency of the FX pair is deposited.
outflowAccountaccountAccount from which the outflow currency of the FX pair is withdrawn.
Index-linked bond coupon transaction
index-linked-bond-coupon-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commentstringA brief text note or explanation related to the transaction.
grossAmountnumberRequiredTotal coupon amount. Denominated in instrument currency.
indexFactornumberRequiredThe index factor to use for the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
assetassetThe instrument affected by the transaction.
depositorydepositoryThe depository the instrument is held in.
Index-linked bond redemption transaction
index-linked-bond-redemption-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commentstringA brief text note or explanation related to the transaction.
indexFactornumberRequiredThe index factor to use for the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
unitPricenumberRequiredPrice per instrument unit.
unitsnumberRequiredNumber of units redeemed.
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
assetassetThe instrument affected by the transaction.
depositorydepositoryThe depository affected by the transaction.
Index-linked bond trade transaction
index-linked-bond-trade-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
accruedInterestnumberRequiredInterest accumulated on the bond from the latest repayment date to the transaction date. Denominated in instrument currency.
commissionnumberRequiredCommission charged by the bank or custodian. Denominated in account currency. A positive number means commission paid.
commentstringA brief text note or explanation related to the transaction.
indexFactornumberThe index factor to use for the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
unitPricenumberRequiredPrice per instrument unit.
unitsnumberRequiredNumber of units bought or sold.
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
assetassetThe instrument affected by the transaction.
depositorydepositoryThe depository affected by the transaction.
Loan transaction
loan-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
interestnumberInterest amount related to the loan. Denominated in account currency.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date.
valueDatestringRequiredISO 8601 representation of the transaction's value date.
Relationships:
accountaccountThe bank account affected by the transaction.
loanassetThe loan instrument that the transaction belongs to.
Refund transaction
refund-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commentstringA brief text note or explanation related to the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
Zero coupon bond trade transaction
zero-coupon-bond-trade-transaction
accountAmountnumberRequiredAmount deposited or withdrawn from the account. Denominated in account currency.
commissionnumberRequiredCommission charged by the bank or custodian. Denominated in account currency. A positive number means commission paid.
commentstringA brief text note or explanation related to the transaction.
tradeDatestringRequiredISO 8601 representation of the transaction's trade date (end-of-day).
unitPricenumberRequiredPrice per instrument unit.
unitsnumberRequiredNumber of units bought or sold.
valueDatestringRequiredISO 8601 representation of the transaction's value date (end-of-day).
Relationships:
accountaccountThe bank account affected by the transaction.
assetassetThe instrument affected by the transaction.
depositorydepositoryThe depository affected by the transaction.
Other transaction
other-transaction
Listed for a transaction of any other kind, including private market fund distributions and drawdowns, which have their own types only on v3. Not accepted by POST /api/v2/transactions.
accountAmountnumberAmount deposited or withdrawn from the account. Denominated in account currency.
commentstringA brief text note or explanation related to the transaction.
tradeDatestringISO 8601 representation of the transaction's trade date (end-of-day).
valueDatestringISO 8601 representation of the transaction's value date (end-of-day).
Relationships: account, asset and depository, as on the types above. A private market fund distribution or drawdown carries only account.
List transactions
Fetch all transactions with a trade date within a specified period. At least one of accountId or depositoryId must be specified. A request without fromDate, without toDate or without either identifier returns 400 with the detail Missing or empty query parameter: ..., naming what is missing.
Query parameters
accountIdstringAccount identifier. Repeat the parameter to include several accounts.
depositoryIdstringDepository identifier. Repeat the parameter to include several depositories. When both
accountIdanddepositoryIdare given, a transaction must match both.fromDatestringRequiredFirst day in the time period, as
yyyy-MM-dd.toDatestringRequiredLast day in the time period, as
yyyy-MM-dd.
curl -G https://api.aleta.ai/api/v2/transactions \
-H "Authorization: Bearer {access_token}" \
-d accountId=6698ffbdda04cf5d2d55a265 \
-d fromDate=2024-07-01 \
-d toDate=2024-07-01
{
"data": [
{
"id": "66990014c5dc848e8f97c1bb",
"type": "equity-trade-transaction",
"attributes": {
"accountAmount": 2961796.6,
"comment": "Equity Sell",
"commission": 199,
"tradeDate": "2024-07-01",
"unitPrice": 398,
"units": -1000,
"valueDate": "2024-07-01"
},
"relationships": {
"account": {
"data": { "type": "account", "id": "6698ffbdda04cf5d2d55a265" }
},
"asset": {
"data": { "type": "asset", "id": "b5afc699f5e3a15556d2a00c" }
},
"depository": {
"data": { "type": "depository", "id": "6698ffae47a5a2c8b2554ee8" }
}
}
}
]
}
Create a transaction
Create a new transaction for an account. The body is a transaction resource of one of the types in the data model and returns 201 Created with the created transaction.
Accepted types: account-interest-transaction, bond-coupon-transaction, bond-redemption-transaction, bond-trade-transaction, cash-transfer-transaction, dividend-transaction, equity-trade-transaction, fee-transaction, fx-spot-transaction, index-linked-bond-coupon-transaction, index-linked-bond-redemption-transaction, index-linked-bond-trade-transaction, refund-transaction and zero-coupon-bond-trade-transaction. Any other type is a 500 with the detail An error occurred while processing your request.
Internal cash transfer
For an internal cash transfer, create each leg of the transaction separately:
- For the first leg, create a transaction in the same way as an external cash transfer.
- For the second leg, include the
counterparty-transactionobject in the relationships and set it to the id of the transaction created as the first leg.
When you send the request for the second leg, the transaction referenced in counterparty-transaction is updated automatically, and a counterparty-transaction object is also added to that first transaction.
curl -X POST https://api.aleta.ai/api/v2/transactions \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "equity-trade-transaction",
"attributes": {
"accountAmount": 397801,
"comment": "Equity Sell",
"commission": 199,
"tradeDate": "2024-07-01",
"unitPrice": 398,
"units": -1000,
"valueDate": "2024-07-01"
},
"relationships": {
"account": { "data": { "type": "account", "id": "6698ffbdda04cf5d2d55a265" } },
"asset": { "data": { "type": "asset", "id": "b5afc699f5e3a15556d2a00c" } },
"depository": { "data": { "type": "depository", "id": "6698ffae47a5a2c8b2554ee8" } }
}
}
}'
{
"data": {
"id": "66990014c5dc848e8f97c1bb",
"type": "equity-trade-transaction",
"attributes": {
"accountAmount": 397801,
"comment": "Equity Sell",
"commission": 199,
"tradeDate": "2024-07-01",
"unitPrice": 398,
"units": -1000,
"valueDate": "2024-07-01"
},
"relationships": {
"account": {
"data": { "type": "account", "id": "6698ffbdda04cf5d2d55a265" }
},
"asset": {
"data": { "type": "asset", "id": "b5afc699f5e3a15556d2a00c" }
},
"depository": {
"data": { "type": "depository", "id": "6698ffae47a5a2c8b2554ee8" }
}
}
}
}
Delete a transaction
Delete a transaction with a given transactionId. Returns 204 No Content. An identifier that is not a 24-character hexadecimal id returns 400; an unknown transaction returns 404 with the detail 'transaction' resource with ID '{transactionId}' not found.
Deleting one leg of an FX spot transaction also deletes its other leg.
Path parameters
transactionIdstringRequiredIdentifier for the specific transaction that needs to be deleted.
curl -X DELETE https://api.aleta.ai/api/v2/transactions/66990014c5dc848e8f97c1bb \
-H "Authorization: Bearer {access_token}"