View as Markdown

Assets

Data model

Bond

JSON:API resource type bond-asset.

ccyCodestring

Required. ISO 4217 code for the bond's currency. Examples: "USD", "EUR", "DKK".

countryCodestring

Required. ISO 3166-1 alpha-2 code representing the bond issuer's domicile. Examples: "US", "DE", "DK".

couponFrequencystring

Required. Specifies how often the coupon payment occurs. Possible values: "quarterly", "semiannually", "annually". Some assets will have a value of "other", but new assets can not be created with this value.

datedDatestring

Optional. ISO 8601 representation of the start date for accrued interest calculation.

dayCountConventionstring

Required. Specifies the method used to calculate interest accruals. Possible values: "actual/actual", "30/360", "actual/360". Some assets will have a value of "other", but new assets can not be created with this value.

firstCouponDatestring

Optional. ISO 8601 representation of the first coupon date.

maturityDatestring

Optional. ISO 8601 representation of the bond's maturity date.

namestring

Required. Display name of the bond.

securityIdentifierstring

Required. Security identifier of the asset.

Fee

JSON:API resource type fee-asset.

namestring

Required. Name of the asset.

categorystring

Required. Type of fee. Possible values: "custody", "management", "other".

FX forward, cash settlement

JSON:API resource type fx-forward-cash-settlement-asset.

agreementDatestring

Required. ISO 8601 representation of the date when the FX forward was agreed upon.

fixingDatestring

Required. ISO 8601 representation of the date on which the difference between the spot rate and the agreed forward rate is calculated.

notionalAmountnumber

Required. The agreed-upon amount for the FX forward, denominated in the contract's primary currency.

primaryCcyCodestring

Required. ISO 4217 code for the currency in which the notional amount is denominated. Examples: "USD", "EUR", "DKK".

secondaryCcyCodestring

Required. ISO 4217 code for the currency in which the settlement amount is denominated. Examples: "USD", "EUR", "DKK".

securityIdentifierstring

Required. Security identifier of the asset.

settlementAmountnumber

Required. The agreed settlement amount, denominated in the contract's secondary currency.

settlementDatestring

Required. ISO 8601 representation of the date the FX forward is settled.

Relationships

accountaccount

The account the cash settlement will affect.

FX forward, physical delivery

JSON:API resource type fx-forward-physical-delivery-asset.

agreementDatestring

Required. ISO 8601 representation of the date when the FX forward was agreed upon.

fixingDatestring

Required. ISO 8601 representation of the date on which the difference between the spot rate and the agreed forward rate is calculated.

notionalAmountnumber

Required. The notional amount, denominated in the currency of the primary account.

securityIdentifierstring

Required. Security identifier of the asset.

settlementAmountnumber

Required. The agreed settlement amount, denominated in the currency of the secondary account.

settlementDatestring

Required. ISO 8601 representation of the date the FX forward is settled.

Relationships

primaryAccountaccount

The account associated with the notional amount.

secondaryAccountaccount

The account associated with the settlement amount.

Index-linked bond

JSON:API resource type index-linked-bond-asset.

ccyCodestring

Required. ISO 4217 code for the bond's currency. Examples: "USD", "EUR", "DKK".

countryCodestring

Required. ISO 3166-1 alpha-2 code representing the bond issuer's domicile. Examples: "US", "DE", "DK".

couponFrequencystring

Required. Specifies how often the coupon payment occurs. Possible values: "quarterly", "semiannually", "annually". Some assets will have a value of "other", but new assets can not be created with this value.

datedDatestring

Optional. ISO 8601 representation of the start date for accrued interest calculation.

dayCountConventionstring

Required. Specifies the method used to calculate interest accruals. Possible values: "actual/actual", "30/360", "actual/360". Some assets will have a value of "other", but new assets can not be created with this value.

firstCouponDatestring

Optional. ISO 8601 representation of the first coupon date.

maturityDatestring

Optional. ISO 8601 representation of the bond's maturity date.

namestring

Required. Display name of the bond.

securityIdentifierstring

Required. Security identifier of the asset.

Loan

JSON:API resource type loan-asset.

agreementDatestring

Required. ISO 8601 representation of the date when the loan was agreed upon.

dayCountConventionstring

Required. The method used to calculate interest. Possible values: "actual/actual", "30/360", "actual/360". Some assets will have a value of "other", but new assets can not be created with this value.

interestRateInPercentnumber

Required when creating a loan; not part of the payload when retrieving one. The fixed interest rate for the loan, expressed as a percentage (e.g., 1.5 for 1.5%). This should usually be a positive number, as the sign of the principal amount affects the sign of the accruing interest, but in unusual periods with negative interest rates it can be negative.

maturityDatestring

Required. ISO 8601 representation of the date when the loan matures.

principalAmountnumber

Required. The agreed-upon amount for the loan, denominated in the account's currency. A positive value represents receivables (an asset), while a negative value represents payables (a liability).

securityIdentifierstring

Required. Security identifier of the asset.

Relationships

accountaccount

The account the loan will affect.

Mutual fund

JSON:API resource type mutual-fund-asset.

ccyCodestring

Required. ISO 4217 code for the mutual fund's currency. Examples: "USD", "EUR", "DKK".

countryCodestring

Required. ISO 3166-1 alpha-2 code representing the mutual fund issuer's domicile. Examples: "US", "DE", "DK".

namestring

Required. Display name of the mutual fund.

securityIdentifierstring

Required. Security identifier of the asset.

Refund

JSON:API resource type refund-asset.

namestring

Required. Name of the asset.

Stock

JSON:API resource type stock-asset.

ccyCodestring

Required. ISO 4217 code for the stock's currency. Examples: "USD", "EUR", "DKK".

countryCodestring

Required. ISO 3166-1 alpha-2 code representing the company's domicile. Examples: "US", "DE", "DK".

namestring

Required. Display name of the stock.

securityIdentifierstring

Required. Security identifier of the asset.

Zero coupon bond

JSON:API resource type zero-coupon-bond-asset.

ccyCodestring

Required. ISO 4217 code for the bond's currency. Examples: "USD", "EUR", "DKK".

countryCodestring

Required. ISO 3166-1 alpha-2 code representing the bond issuer's domicile. Examples: "US", "DE", "DK".

maturityDatestring

Optional. ISO 8601 representation of the bond's maturity date.

namestring

Required. Display name of the bond.

securityIdentifierstring

Required. Security identifier of the asset.

Other

JSON:API resource type other-asset. This type represents a range of other, more uncommon types of assets in the system. Assets of this type can only be retrieved, not created.

securityIdentifierstring

Required. Security identifier of the asset.


GET/api/v2/assets/{id}

Retrieve an asset

Parameters

idstring

Path, required. Asset identifier.

Request
GET/api/v2/assets/{id}
curl https://api.aleta.ai/api/v2/assets/5e6a90cf921d8b1874c32ed5 \
  -H "Authorization: Bearer {access_token}"
Response
{
  "data": {
    "id": "5e6a90cf921d8b1874c32ed5",
    "type": "bond-asset",
    "attributes": {
      "ccyCode": "DKK",
      "countryCode": "DK",
      "couponFrequency": "quarterly",
      "dayCountConvention": "actual/actual",
      "firstCouponDate": "2010-07-01",
      "datedDate": "2010-04-23",
      "maturityDate": "2041-07-01",
      "name": "4% Nordea Kre 41",
      "securityIdentifier": "DK0002024876"
    }
  }
}

POST/api/v2/assets

Create an asset

Create a new asset.

New Fee, Refund and Other type assets can not be created; a request with any other resource type answers 400.

Date attributes must be yyyy-MM-dd; any other format answers 400. For loans and FX forwards, every account in relationships must exist (an unknown account answers 404), the asset's name is its securityIdentifier, a loan takes the currency of its account, and a physical delivery FX forward takes the currencies of its two accounts.

For the basic-data types, an asset whose securityIdentifier and ccyCode match a publicly traded security Aleta knows is created as a shared catalog asset; any other is private to your client.

Asset already exists

When attempting to create a bond, index-linked bond, mutual fund, stock or zero coupon bond with a combination of securityIdentifier and ccyCode that already exists in the system, the API responds with a 303 See Other redirection that provides a Location header, pointing to the GET /api/v2/assets/{id} endpoint where the asset can be found.

Request
POST/api/v2/assets
curl -X POST https://api.aleta.ai/api/v2/assets \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/vnd.json+api" \
  -d '{
    "data": {
      "type": "bond-asset",
      "attributes": {
        "ccyCode": "DKK",
        "countryCode": "DK",
        "couponFrequency": "quarterly",
        "dayCountConvention": "actual/actual",
        "firstCouponDate": "2010-07-01",
        "datedDate": "2010-04-23",
        "maturityDate": "2041-07-01",
        "name": "4% Nordea Kre 41",
        "securityIdentifier": "DK0002024876"
      }
    }
  }'
Response
{
  "data": {
    "id": "5e6a90cf921d8b1874c32ed5",
    "type": "bond-asset",
    "attributes": {
      "ccyCode": "DKK",
      "countryCode": "DK",
      "couponFrequency": "quarterly",
      "dayCountConvention": "actual/actual",
      "firstCouponDate": "2010-07-01",
      "datedDate": "2010-04-23",
      "maturityDate": "2041-07-01",
      "name": "4% Nordea Kre 41",
      "securityIdentifier": "DK0002024876"
    },
    "relationships": null
  }
}

DELETE/api/v2/assets/{id}

Delete an asset

Delete the asset given by id. An asset that is still referenced by transactions can not be deleted; the request answers 400.

Parameters

idstring

Path, required. Asset identifier.

Request
DELETE/api/v2/assets/{id}
curl -X DELETE https://api.aleta.ai/api/v2/assets/6704d535298ab60100cbc56c \
  -H "Authorization: Bearer {access_token}"
Response
HTTP/1.1 204 No Content