Asset Management API
This document describes the Asset Management endpoints for managing digital assets in Link Quote.
Endpoints
- Create Asset -
POST /assets - List Assets -
GET /assets - Get Asset -
GET /assets/:id - Update Asset -
PUT /assets/:id - Update Static Value -
PATCH /assets/:id/static-value - Delete Asset -
DELETE /assets/:id
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
}
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Human-readable asset name (e.g., "Bitcoin") |
code | string | Yes | Unique asset code/ticker (e.g., "BTC") |
categoryId | string | No | UUID of the asset category |
description | string | No | Asset description |
staticValue | number | No | Fixed 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 (
nameorcode) - 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
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Filter by name (case-insensitive, partial match) |
code | string | No | Filter by code (case-insensitive, exact match) |
categoryId | string | No | Filter by category ID (UUID) |
limit | number | No | Maximum results per page (default: 10) |
offset | number | No | Number of results to skip (default: 0) |
sortBy | string | No | Sort field: name, code, createdAt, updatedAt (default: createdAt) |
sortOrder | string | No | Sort 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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Asset 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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Asset 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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Asset UUID |
Request Body
{
"staticValue": 10.50
}
| Field | Type | Required | Description |
|---|---|---|---|
staticValue | number | Yes | New 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
staticValueis set,POST /rateswill return this static value instead of fetching from providers - Set to
nullto 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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Asset 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
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Unique asset identifier |
name | string | Human-readable asset name |
code | string | Unique asset code/ticker symbol |
categoryId | string (UUID) | Associated category ID |
description | string | Optional asset description |
staticValue | number or null | Fixed rate value (overrides provider fetching) |
createdAt | string (ISO 8601) | Creation timestamp |
updatedAt | string (ISO 8601) | Last update timestamp |
category | object | Associated category details (when included) |
assetProviders | array | Associated providers (when included) |
Need Help? Contact helpdesk@ledgerlink.ai for assistance.