Skip to main content

Asset Management API

This document describes the Asset Management endpoints for managing digital assets in Link Quote.

Endpoints​


Create Asset​

Creates a new digital asset in the system.

Endpoint: POST /assets

Request Body​

{
"name": "string",
"code": "string",
"categoryId": "string",
"description": "string",
"staticValue": number
}
FieldTypeRequiredDescription
namestringYesHuman-readable asset name (e.g., "Bitcoin")
codestringYesUnique asset code/ticker (e.g., "BTC")
categoryIdstringNoUUID of the asset category
descriptionstringNoAsset description
staticValuenumberNoFixed rate value (for assets with static pricing)

Response​

Status: 201 Created

{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Bitcoin",
"code": "BTC",
"categoryId": "789e4567-e89b-12d3-a456-426614174000",
"description": "Leading cryptocurrency by market cap",
"staticValue": null,
"createdAt": "2025-11-20T10:30:00.000Z",
"updatedAt": "2025-11-20T10:30:00.000Z"
}

Examples​

Create Basic Asset​

curl -X POST "https://api.ledgerlink.ai/v1/assets" \
-H "Content-Type: application/json" \
-d '{
"name": "Solana",
"code": "SOL",
"categoryId": "789e4567-e89b-12d3-a456-426614174000"
}'

Create Asset with Static Value​

curl -X POST "https://api.ledgerlink.ai/v1/assets" \
-H "Content-Type: application/json" \
-d '{
"name": "Custom Token",
"code": "CUSTOM",
"categoryId": "789e4567-e89b-12d3-a456-426614174000",
"description": "Internal token with fixed value",
"staticValue": 10.50
}'

Error Responses​

400 Bad Request​

{
"statusCode": 400,
"message": ["name must be a string", "code must be a string"],
"error": "Bad Request"
}

Causes:

  • Missing required fields (name or code)
  • Invalid data types
  • Asset code already exists (must be unique)

500 Internal Server Error​

{
"statusCode": 500,
"message": "Internal server error",
"error": "Internal Server Error"
}

List Assets​

Retrieves a paginated list of assets with optional filtering and sorting.

Endpoint: GET /assets

Query Parameters​

ParameterTypeRequiredDescription
namestringNoFilter by name (case-insensitive, partial match)
codestringNoFilter by code (case-insensitive, exact match)
categoryIdstringNoFilter by category ID (UUID)
limitnumberNoMaximum results per page (default: 10)
offsetnumberNoNumber of results to skip (default: 0)
sortBystringNoSort field: name, code, createdAt, updatedAt (default: createdAt)
sortOrderstringNoSort direction: asc or desc (default: desc)

Response​

Status: 200 OK

{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Bitcoin",
"code": "BTC",
"categoryId": "789e4567-e89b-12d3-a456-426614174000",
"description": "Leading cryptocurrency",
"staticValue": null,
"createdAt": "2025-11-20T10:30:00.000Z",
"updatedAt": "2025-11-20T10:30:00.000Z",
"category": {
"id": "789e4567-e89b-12d3-a456-426614174000",
"name": "Cryptocurrency"
},
"assetProviders": [
{
"providerId": "456e8400-e29b-41d4-a716-446655440000",
"provider": {
"id": "456e8400-e29b-41d4-a716-446655440000",
"name": "CoinMarketCap",
"slug": "coinmarketcap"
}
}
]
}
],
"pageInfo": {
"limit": 10,
"offset": 0,
"total": 45
}
}

Examples​

List All Assets​

curl -X GET "https://api.ledgerlink.ai/v1/assets?limit=20&offset=0"

Filter by Name​

curl -X GET "https://api.ledgerlink.ai/v1/assets?name=bitcoin"

Filter by Code​

curl -X GET "https://api.ledgerlink.ai/v1/assets?code=BTC"

Filter by Category​

curl -X GET "https://api.ledgerlink.ai/v1/assets?categoryId=789e4567-e89b-12d3-a456-426614174000"

Sort by Name​

curl -X GET "https://api.ledgerlink.ai/v1/assets?sortBy=name&sortOrder=asc&limit=50"

Error Responses​

400 Bad Request​

{
"statusCode": 400,
"message": "Invalid query parameters",
"error": "Bad Request"
}

Get Asset​

Retrieves a specific asset by ID with full relationship data.

Endpoint: GET /assets/:id

Path Parameters​

ParameterTypeRequiredDescription
idstringYesAsset UUID

Response​

Status: 200 OK

{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Bitcoin",
"code": "BTC",
"categoryId": "789e4567-e89b-12d3-a456-426614174000",
"description": "Leading cryptocurrency by market cap",
"staticValue": null,
"createdAt": "2025-11-20T10:30:00.000Z",
"updatedAt": "2025-11-20T10:30:00.000Z",
"category": {
"id": "789e4567-e89b-12d3-a456-426614174000",
"name": "Cryptocurrency"
},
"assetProviders": [
{
"providerId": "456e8400-e29b-41d4-a716-446655440000",
"assetId": "123e4567-e89b-12d3-a456-426614174000",
"provider": {
"id": "456e8400-e29b-41d4-a716-446655440000",
"name": "CoinMarketCap",
"slug": "coinmarketcap",
"isDefault": true
}
},
{
"providerId": "567e8400-e29b-41d4-a716-446655440001",
"assetId": "123e4567-e89b-12d3-a456-426614174000",
"provider": {
"id": "567e8400-e29b-41d4-a716-446655440001",
"name": "Pyth Network",
"slug": "pyth",
"isDefault": true
}
}
]
}

Example​

curl -X GET "https://api.ledgerlink.ai/v1/assets/123e4567-e89b-12d3-a456-426614174000"

Error Responses​

404 Not Found​

{
"statusCode": 404,
"message": "Asset not found",
"error": "Not Found"
}

Update Asset​

Updates an existing asset's details.

Endpoint: PUT /assets/:id

Path Parameters​

ParameterTypeRequiredDescription
idstringYesAsset UUID

Request Body​

{
"name": "string",
"code": "string",
"categoryId": "string",
"description": "string",
"staticValue": number
}

All fields are optional. Only provided fields will be updated.

Response​

Status: 200 OK

{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Bitcoin (Updated)",
"code": "BTC",
"categoryId": "789e4567-e89b-12d3-a456-426614174000",
"description": "Updated description",
"staticValue": null,
"createdAt": "2025-11-20T10:30:00.000Z",
"updatedAt": "2025-11-20T15:45:00.000Z"
}

Example​

curl -X PUT "https://api.ledgerlink.ai/v1/assets/123e4567-e89b-12d3-a456-426614174000" \
-H "Content-Type: application/json" \
-d '{
"description": "Leading digital currency with largest market cap",
"categoryId": "789e4567-e89b-12d3-a456-426614174001"
}'

Error Responses​

404 Not Found​

{
"statusCode": 404,
"message": "Asset not found",
"error": "Not Found"
}

400 Bad Request​

{
"statusCode": 400,
"message": "Invalid input data",
"error": "Bad Request"
}

Update Static Value​

Updates only the staticValue field of an asset. This is useful for assets with fixed pricing.

Endpoint: PATCH /assets/:id/static-value

Path Parameters​

ParameterTypeRequiredDescription
idstringYesAsset UUID

Request Body​

{
"staticValue": 10.50
}
FieldTypeRequiredDescription
staticValuenumberYesNew static value for the asset (or null to remove)

Response​

Status: 200 OK

{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Custom Token",
"code": "CUSTOM",
"categoryId": "789e4567-e89b-12d3-a456-426614174000",
"description": "Internal token",
"staticValue": 10.50,
"createdAt": "2025-11-20T10:30:00.000Z",
"updatedAt": "2025-11-20T16:00:00.000Z"
}

Example​

curl -X PATCH "https://api.ledgerlink.ai/v1/assets/123e4567-e89b-12d3-a456-426614174000/static-value" \
-H "Content-Type: application/json" \
-d '{
"staticValue": 15.75
}'

Notes​

  • When staticValue is set, POST /rates will return this static value instead of fetching from providers
  • Set to null to remove static pricing and resume using providers
  • Useful for internal tokens, gift cards, or assets with fixed fiat equivalents

Delete Asset​

Soft deletes an asset from the system.

Endpoint: DELETE /assets/:id

Path Parameters​

ParameterTypeRequiredDescription
idstringYesAsset UUID

Response​

Status: 200 OK

{
"success": true,
"message": "Asset successfully deleted"
}

Example​

curl -X DELETE "https://api.ledgerlink.ai/v1/assets/123e4567-e89b-12d3-a456-426614174000"

Error Responses​

404 Not Found​

{
"statusCode": 404,
"message": "Asset not found",
"error": "Not Found"
}

400 Bad Request​

{
"statusCode": 400,
"message": "Cannot delete asset with active rates or transactions",
"error": "Bad Request"
}

Notes​

  • This is a soft delete - the asset is marked as deleted but remains in the database
  • Deleted assets are excluded from list queries
  • Assets with active relationships may not be deletable (implementation-dependent)

Asset Fields Reference​

FieldTypeDescription
idstring (UUID)Unique asset identifier
namestringHuman-readable asset name
codestringUnique asset code/ticker symbol
categoryIdstring (UUID)Associated category ID
descriptionstringOptional asset description
staticValuenumber or nullFixed rate value (overrides provider fetching)
createdAtstring (ISO 8601)Creation timestamp
updatedAtstring (ISO 8601)Last update timestamp
categoryobjectAssociated category details (when included)
assetProvidersarrayAssociated providers (when included)

Need Help? Contact helpdesk@ledgerlink.ai for assistance.