API Documentation
Reference documentation for the CMYCASH Asset Registration API
POSTRegister Asset
/api/assets
Request Body
{
"name": "1oz Gold Bar",
"type": "Gold Bar | Coin | Jewelry | Other",
"description": "Optional description",
"issuer": "Pilot",
"image_url": "https://example.com/image.jpg",
"passport_id": "PP-2024-001234",
"asset_number": "AN-2024-001234"
}Response
{
"success": true,
"asset": {
"id": "uuid",
"passport_id": "PP-2024-001234",
"asset_number": "AN-2024-001234",
"name": "1oz Gold Bar",
"type": "Gold Bar",
"description": "Optional description",
"issuer": "Pilot",
"image_url": "https://example.com/image.jpg",
"status": "REGISTERED",
"verification_level": "PENDING",
"metadata": null,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
}GETGet Asset by Passport ID
/api/assets/[passport_id]
URL Parameters
passport_id: string - The passport ID of the asset (e.g., PP-2024-001234)
Response
{
"success": true,
"asset": {
"id": "uuid",
"passport_id": "PP-2024-001234",
"asset_number": "AN-2024-001234",
"name": "1oz Gold Bar",
"type": "Gold Bar",
"description": "Optional description",
"issuer": "Pilot",
"image_url": "https://example.com/image.jpg",
"status": "REGISTERED",
"verification_level": "PENDING",
"metadata": null,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
}Asset Types
Valid values for the type field
Gold Bar- Gold bars and bullionCoin- Precious metal coinsJewelry- Jewelry and ornamentsOther- Other valuable assets
Error Responses
Common error response format
{
"success": false,
"error": "Error message describing what went wrong"
}