Complete Crypto System API

Full cryptocurrency platform with coins, markets, wallets, transactions, and portfolio tracking

10
Resources
2025-11-28
2 days ago

Alerts

User price alerts

GET /api/crypto/alerts Auth Required User Filtering

Retrieve a paginated list of all alerts

Request Example
GET /api/crypto/alerts
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
  "data": [
    {
        "user_id": 1,
        "user_name": "Robert Johnson",
        "cryptocurrency_symbol": "BTC",
        "alert_type": "above",
        "target_price": 45000,
        "current_price": 43250.5,
        "is_triggered": false,
        "created_at": "2024-01-18T10:00:00Z",
        "triggered_at": null
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total": 50,
    "per_page": 15
  }
}
GET /api/crypto/alerts/{id} Auth Required

Retrieve a single alert by ID

Request Example
GET /api/crypto/alerts/1
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "cryptocurrency_symbol": "BTC",
    "alert_type": "above",
    "target_price": 45000,
    "current_price": 43250.5,
    "is_triggered": false,
    "created_at": "2024-01-18T10:00:00Z",
    "triggered_at": null
}
Error Response 404 Not Found
{
  "error": "Resource not found",
  "message": "The requested alert does not exist"
}
POST /api/crypto/alerts Auth Required Auto User ID

Create a new alert

Request Body
POST /api/crypto/alerts
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "cryptocurrency_symbol": "BTC",
    "alert_type": "above",
    "target_price": 45000,
    "current_price": 43250.5,
    "is_triggered": false,
    "triggered_at": null
}
Response Example 201 Created
{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "cryptocurrency_symbol": "BTC",
    "alert_type": "above",
    "target_price": 45000,
    "current_price": 43250.5,
    "is_triggered": false,
    "created_at": "2024-01-18T10:00:00Z",
    "triggered_at": null
}
PUT/PATCH /api/crypto/alerts/{id} Public

Update an existing alert

Request Body
PUT /api/crypto/alerts/1
Content-Type: application/json

{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "cryptocurrency_symbol": "BTC",
    "alert_type": "above",
    "target_price": 45000,
    "current_price": 43250.5,
    "is_triggered": false,
    "triggered_at": null
}
Response Example 200 OK
{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "cryptocurrency_symbol": "BTC",
    "alert_type": "above",
    "target_price": 45000,
    "current_price": 43250.5,
    "is_triggered": false,
    "created_at": "2024-01-18T10:00:00Z",
    "triggered_at": null
}
DELETE /api/crypto/alerts/{id} Auth Required Ownership Check

Delete a alert by ID

Only the owner can delete this resource
Request Example
DELETE /api/crypto/alerts/1
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
  "message": "Alert deleted successfully"
}
Error Response 500 Error
{
  "error": "Deletion failed",
  "message": "Unable to delete the resource"
}

Cryptocurrencies

Available cryptocurrencies and tokens

GET /api/crypto/cryptocurrencies Public

Retrieve a paginated list of all cryptocurrencies

Request Example
GET /api/crypto/cryptocurrencies
Accept: application/json
Response Example 200 OK
{
  "data": [
    {
        "symbol": "BTC",
        "name": "Bitcoin",
        "logo": "\u20bf",
        "current_price": 43250.5,
        "market_cap": 847500000000,
        "volume_24h": 28500000000,
        "price_change_24h": 1234.5,
        "price_change_percentage_24h": 2.939999999999999946709294817992486059665679931640625,
        "circulating_supply": 19600000,
        "total_supply": 21000000,
        "rank": 1
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total": 50,
    "per_page": 15
  }
}
GET /api/crypto/cryptocurrencies/{id} Public

Retrieve a single cryptocurrencie by ID

Request Example
GET /api/crypto/cryptocurrencies/1
Accept: application/json
Response Example 200 OK
{
    "symbol": "BTC",
    "name": "Bitcoin",
    "logo": "\u20bf",
    "current_price": 43250.5,
    "market_cap": 847500000000,
    "volume_24h": 28500000000,
    "price_change_24h": 1234.5,
    "price_change_percentage_24h": 2.939999999999999946709294817992486059665679931640625,
    "circulating_supply": 19600000,
    "total_supply": 21000000,
    "rank": 1
}
Error Response 404 Not Found
{
  "error": "Resource not found",
  "message": "The requested cryptocurrencie does not exist"
}
POST /api/crypto/cryptocurrencies Public

Create a new cryptocurrencie

Request Body
POST /api/crypto/cryptocurrencies
Content-Type: application/json

{
    "symbol": "BTC",
    "name": "Bitcoin",
    "logo": "\u20bf",
    "current_price": 43250.5,
    "market_cap": 847500000000,
    "volume_24h": 28500000000,
    "price_change_24h": 1234.5,
    "price_change_percentage_24h": 2.939999999999999946709294817992486059665679931640625,
    "circulating_supply": 19600000,
    "total_supply": 21000000,
    "rank": 1
}
Response Example 201 Created
{
    "symbol": "BTC",
    "name": "Bitcoin",
    "logo": "\u20bf",
    "current_price": 43250.5,
    "market_cap": 847500000000,
    "volume_24h": 28500000000,
    "price_change_24h": 1234.5,
    "price_change_percentage_24h": 2.939999999999999946709294817992486059665679931640625,
    "circulating_supply": 19600000,
    "total_supply": 21000000,
    "rank": 1
}
PUT/PATCH /api/crypto/cryptocurrencies/{id} Public

Update an existing cryptocurrencie

Request Body
PUT /api/crypto/cryptocurrencies/1
Content-Type: application/json

{
    "symbol": "BTC",
    "name": "Bitcoin",
    "logo": "\u20bf",
    "current_price": 43250.5,
    "market_cap": 847500000000,
    "volume_24h": 28500000000,
    "price_change_24h": 1234.5,
    "price_change_percentage_24h": 2.939999999999999946709294817992486059665679931640625,
    "circulating_supply": 19600000,
    "total_supply": 21000000,
    "rank": 1
}
Response Example 200 OK
{
    "symbol": "BTC",
    "name": "Bitcoin",
    "logo": "\u20bf",
    "current_price": 43250.5,
    "market_cap": 847500000000,
    "volume_24h": 28500000000,
    "price_change_24h": 1234.5,
    "price_change_percentage_24h": 2.939999999999999946709294817992486059665679931640625,
    "circulating_supply": 19600000,
    "total_supply": 21000000,
    "rank": 1
}
DELETE /api/crypto/cryptocurrencies/{id} Public

Delete a cryptocurrencie by ID

Request Example
DELETE /api/crypto/cryptocurrencies/1
Accept: application/json
Response Example 200 OK
{
  "message": "Cryptocurrencie deleted successfully"
}
Error Response 500 Error
{
  "error": "Deletion failed",
  "message": "Unable to delete the resource"
}

Exchanges

Cryptocurrency exchanges information

GET /api/crypto/exchanges Public

Retrieve a paginated list of all exchanges

Request Example
GET /api/crypto/exchanges
Accept: application/json
Response Example 200 OK
{
  "data": [
    {
        "name": "Binance",
        "country": "Global",
        "logo": "https://picsum.photos/100/100?random=ex1",
        "trust_score": 10,
        "volume_24h_btc": 125000,
        "year_established": 2017
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total": 50,
    "per_page": 15
  }
}
GET /api/crypto/exchanges/{id} Public

Retrieve a single exchange by ID

Request Example
GET /api/crypto/exchanges/1
Accept: application/json
Response Example 200 OK
{
    "name": "Binance",
    "country": "Global",
    "logo": "https://picsum.photos/100/100?random=ex1",
    "trust_score": 10,
    "volume_24h_btc": 125000,
    "year_established": 2017
}
Error Response 404 Not Found
{
  "error": "Resource not found",
  "message": "The requested exchange does not exist"
}
POST /api/crypto/exchanges Public

Create a new exchange

Request Body
POST /api/crypto/exchanges
Content-Type: application/json

{
    "name": "Binance",
    "country": "Global",
    "logo": "https://picsum.photos/100/100?random=ex1",
    "trust_score": 10,
    "volume_24h_btc": 125000,
    "year_established": 2017
}
Response Example 201 Created
{
    "name": "Binance",
    "country": "Global",
    "logo": "https://picsum.photos/100/100?random=ex1",
    "trust_score": 10,
    "volume_24h_btc": 125000,
    "year_established": 2017
}
PUT/PATCH /api/crypto/exchanges/{id} Public

Update an existing exchange

Request Body
PUT /api/crypto/exchanges/1
Content-Type: application/json

{
    "name": "Binance",
    "country": "Global",
    "logo": "https://picsum.photos/100/100?random=ex1",
    "trust_score": 10,
    "volume_24h_btc": 125000,
    "year_established": 2017
}
Response Example 200 OK
{
    "name": "Binance",
    "country": "Global",
    "logo": "https://picsum.photos/100/100?random=ex1",
    "trust_score": 10,
    "volume_24h_btc": 125000,
    "year_established": 2017
}
DELETE /api/crypto/exchanges/{id} Public

Delete a exchange by ID

Request Example
DELETE /api/crypto/exchanges/1
Accept: application/json
Response Example 200 OK
{
  "message": "Exchange deleted successfully"
}
Error Response 500 Error
{
  "error": "Deletion failed",
  "message": "Unable to delete the resource"
}

Markets

Trading pairs and market data

GET /api/crypto/markets Public

Retrieve a paginated list of all markets

Request Example
GET /api/crypto/markets
Accept: application/json
Response Example 200 OK
{
  "data": [
    {
        "pair": "BTC/USDT",
        "base_currency": "BTC",
        "quote_currency": "USDT",
        "last_price": 43250.5,
        "bid": 43248.300000000002910383045673370361328125,
        "ask": 43252.699999999997089616954326629638671875,
        "volume_24h": 15600,
        "high_24h": 43890,
        "low_24h": 42540
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total": 50,
    "per_page": 15
  }
}
GET /api/crypto/markets/{id} Public

Retrieve a single market by ID

Request Example
GET /api/crypto/markets/1
Accept: application/json
Response Example 200 OK
{
    "pair": "BTC/USDT",
    "base_currency": "BTC",
    "quote_currency": "USDT",
    "last_price": 43250.5,
    "bid": 43248.300000000002910383045673370361328125,
    "ask": 43252.699999999997089616954326629638671875,
    "volume_24h": 15600,
    "high_24h": 43890,
    "low_24h": 42540
}
Error Response 404 Not Found
{
  "error": "Resource not found",
  "message": "The requested market does not exist"
}
POST /api/crypto/markets Public

Create a new market

Request Body
POST /api/crypto/markets
Content-Type: application/json

{
    "pair": "BTC/USDT",
    "base_currency": "BTC",
    "quote_currency": "USDT",
    "last_price": 43250.5,
    "bid": 43248.300000000002910383045673370361328125,
    "ask": 43252.699999999997089616954326629638671875,
    "volume_24h": 15600,
    "high_24h": 43890,
    "low_24h": 42540
}
Response Example 201 Created
{
    "pair": "BTC/USDT",
    "base_currency": "BTC",
    "quote_currency": "USDT",
    "last_price": 43250.5,
    "bid": 43248.300000000002910383045673370361328125,
    "ask": 43252.699999999997089616954326629638671875,
    "volume_24h": 15600,
    "high_24h": 43890,
    "low_24h": 42540
}
PUT/PATCH /api/crypto/markets/{id} Public

Update an existing market

Request Body
PUT /api/crypto/markets/1
Content-Type: application/json

{
    "pair": "BTC/USDT",
    "base_currency": "BTC",
    "quote_currency": "USDT",
    "last_price": 43250.5,
    "bid": 43248.300000000002910383045673370361328125,
    "ask": 43252.699999999997089616954326629638671875,
    "volume_24h": 15600,
    "high_24h": 43890,
    "low_24h": 42540
}
Response Example 200 OK
{
    "pair": "BTC/USDT",
    "base_currency": "BTC",
    "quote_currency": "USDT",
    "last_price": 43250.5,
    "bid": 43248.300000000002910383045673370361328125,
    "ask": 43252.699999999997089616954326629638671875,
    "volume_24h": 15600,
    "high_24h": 43890,
    "low_24h": 42540
}
DELETE /api/crypto/markets/{id} Public

Delete a market by ID

Request Example
DELETE /api/crypto/markets/1
Accept: application/json
Response Example 200 OK
{
  "message": "Market deleted successfully"
}
Error Response 500 Error
{
  "error": "Deletion failed",
  "message": "Unable to delete the resource"
}

News

Cryptocurrency news and updates

GET /api/crypto/news Public

Retrieve a paginated list of all news

Request Example
GET /api/crypto/news
Accept: application/json
Response Example 200 OK
{
  "data": [
    {
        "title": "Bitcoin Surges Past $43K Amid Institutional Buying",
        "summary": "Bitcoin price jumps 3% as institutional investors increase their holdings...",
        "url": "https://cryptonews.com/news/btc-surge",
        "image": "https://picsum.photos/600/400?random=news1",
        "source": "CryptoNews",
        "related_cryptocurrencies": [
            "BTC"
        ],
        "published_at": "2024-01-22T08:30:00Z"
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total": 50,
    "per_page": 15
  }
}
GET /api/crypto/news/{id} Public

Retrieve a single new by ID

Request Example
GET /api/crypto/news/1
Accept: application/json
Response Example 200 OK
{
    "title": "Bitcoin Surges Past $43K Amid Institutional Buying",
    "summary": "Bitcoin price jumps 3% as institutional investors increase their holdings...",
    "url": "https://cryptonews.com/news/btc-surge",
    "image": "https://picsum.photos/600/400?random=news1",
    "source": "CryptoNews",
    "related_cryptocurrencies": [
        "BTC"
    ],
    "published_at": "2024-01-22T08:30:00Z"
}
Error Response 404 Not Found
{
  "error": "Resource not found",
  "message": "The requested new does not exist"
}
POST /api/crypto/news Public

Create a new new

Request Body
POST /api/crypto/news
Content-Type: application/json

{
    "title": "Bitcoin Surges Past $43K Amid Institutional Buying",
    "summary": "Bitcoin price jumps 3% as institutional investors increase their holdings...",
    "url": "https://cryptonews.com/news/btc-surge",
    "image": "https://picsum.photos/600/400?random=news1",
    "source": "CryptoNews",
    "related_cryptocurrencies": [
        "BTC"
    ],
    "published_at": "2024-01-22T08:30:00Z"
}
Response Example 201 Created
{
    "title": "Bitcoin Surges Past $43K Amid Institutional Buying",
    "summary": "Bitcoin price jumps 3% as institutional investors increase their holdings...",
    "url": "https://cryptonews.com/news/btc-surge",
    "image": "https://picsum.photos/600/400?random=news1",
    "source": "CryptoNews",
    "related_cryptocurrencies": [
        "BTC"
    ],
    "published_at": "2024-01-22T08:30:00Z"
}
PUT/PATCH /api/crypto/news/{id} Public

Update an existing new

Request Body
PUT /api/crypto/news/1
Content-Type: application/json

{
    "title": "Bitcoin Surges Past $43K Amid Institutional Buying",
    "summary": "Bitcoin price jumps 3% as institutional investors increase their holdings...",
    "url": "https://cryptonews.com/news/btc-surge",
    "image": "https://picsum.photos/600/400?random=news1",
    "source": "CryptoNews",
    "related_cryptocurrencies": [
        "BTC"
    ],
    "published_at": "2024-01-22T08:30:00Z"
}
Response Example 200 OK
{
    "title": "Bitcoin Surges Past $43K Amid Institutional Buying",
    "summary": "Bitcoin price jumps 3% as institutional investors increase their holdings...",
    "url": "https://cryptonews.com/news/btc-surge",
    "image": "https://picsum.photos/600/400?random=news1",
    "source": "CryptoNews",
    "related_cryptocurrencies": [
        "BTC"
    ],
    "published_at": "2024-01-22T08:30:00Z"
}
DELETE /api/crypto/news/{id} Public

Delete a new by ID

Request Example
DELETE /api/crypto/news/1
Accept: application/json
Response Example 200 OK
{
  "message": "New deleted successfully"
}
Error Response 500 Error
{
  "error": "Deletion failed",
  "message": "Unable to delete the resource"
}

Portfolios

User portfolio summary

GET /api/crypto/portfolios Auth Required User Filtering

Retrieve a paginated list of all portfolios

Request Example
GET /api/crypto/portfolios
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
  "data": [
    {
        "user_id": 1,
        "user_name": "Robert Johnson",
        "total_value_usd": 125670.5,
        "total_invested_usd": 110000,
        "profit_loss_usd": 15670.5,
        "profit_loss_percentage": 14.25,
        "holdings": [
            {
                "symbol": "BTC",
                "amount": 2.45000000000000017763568394002504646778106689453125,
                "value_usd": 105962.5
            },
            {
                "symbol": "ETH",
                "amount": 5.79999999999999982236431605997495353221893310546875,
                "value_usd": 13605.350000000000363797880709171295166015625
            }
        ]
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total": 50,
    "per_page": 15
  }
}
GET /api/crypto/portfolios/{id} Auth Required

Retrieve a single portfolio by ID

Request Example
GET /api/crypto/portfolios/1
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "total_value_usd": 125670.5,
    "total_invested_usd": 110000,
    "profit_loss_usd": 15670.5,
    "profit_loss_percentage": 14.25,
    "holdings": [
        {
            "symbol": "BTC",
            "amount": 2.45000000000000017763568394002504646778106689453125,
            "value_usd": 105962.5
        },
        {
            "symbol": "ETH",
            "amount": 5.79999999999999982236431605997495353221893310546875,
            "value_usd": 13605.350000000000363797880709171295166015625
        }
    ]
}
Error Response 404 Not Found
{
  "error": "Resource not found",
  "message": "The requested portfolio does not exist"
}
POST /api/crypto/portfolios Auth Required Auto User ID

Create a new portfolio

Request Body
POST /api/crypto/portfolios
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "total_value_usd": 125670.5,
    "total_invested_usd": 110000,
    "profit_loss_usd": 15670.5,
    "profit_loss_percentage": 14.25,
    "holdings": [
        {
            "symbol": "BTC",
            "amount": 2.45000000000000017763568394002504646778106689453125,
            "value_usd": 105962.5
        },
        {
            "symbol": "ETH",
            "amount": 5.79999999999999982236431605997495353221893310546875,
            "value_usd": 13605.350000000000363797880709171295166015625
        }
    ]
}
Response Example 201 Created
{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "total_value_usd": 125670.5,
    "total_invested_usd": 110000,
    "profit_loss_usd": 15670.5,
    "profit_loss_percentage": 14.25,
    "holdings": [
        {
            "symbol": "BTC",
            "amount": 2.45000000000000017763568394002504646778106689453125,
            "value_usd": 105962.5
        },
        {
            "symbol": "ETH",
            "amount": 5.79999999999999982236431605997495353221893310546875,
            "value_usd": 13605.350000000000363797880709171295166015625
        }
    ]
}
PUT/PATCH /api/crypto/portfolios/{id} Auth Required Ownership Check

Update an existing portfolio

Only the owner can update this resource
Request Body
PUT /api/crypto/portfolios/1
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "total_value_usd": 125670.5,
    "total_invested_usd": 110000,
    "profit_loss_usd": 15670.5,
    "profit_loss_percentage": 14.25,
    "holdings": [
        {
            "symbol": "BTC",
            "amount": 2.45000000000000017763568394002504646778106689453125,
            "value_usd": 105962.5
        },
        {
            "symbol": "ETH",
            "amount": 5.79999999999999982236431605997495353221893310546875,
            "value_usd": 13605.350000000000363797880709171295166015625
        }
    ]
}
Response Example 200 OK
{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "total_value_usd": 125670.5,
    "total_invested_usd": 110000,
    "profit_loss_usd": 15670.5,
    "profit_loss_percentage": 14.25,
    "holdings": [
        {
            "symbol": "BTC",
            "amount": 2.45000000000000017763568394002504646778106689453125,
            "value_usd": 105962.5
        },
        {
            "symbol": "ETH",
            "amount": 5.79999999999999982236431605997495353221893310546875,
            "value_usd": 13605.350000000000363797880709171295166015625
        }
    ]
}
DELETE /api/crypto/portfolios/{id} Auth Required Ownership Check

Delete a portfolio by ID

Only the owner can delete this resource
Request Example
DELETE /api/crypto/portfolios/1
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
  "message": "Portfolio deleted successfully"
}
Error Response 500 Error
{
  "error": "Deletion failed",
  "message": "Unable to delete the resource"
}

Price-history

Historical price data

GET /api/crypto/price-history Public

Retrieve a paginated list of all price-history

Request Example
GET /api/crypto/price-history
Accept: application/json
Response Example 200 OK
{
  "data": [
    {
        "cryptocurrency_symbol": "BTC",
        "timestamp": "2024-01-20T00:00:00Z",
        "price_usd": 42540,
        "volume_24h": 27800000000,
        "market_cap": 834000000000
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total": 50,
    "per_page": 15
  }
}
GET /api/crypto/price-history/{id} Public

Retrieve a single price-history by ID

Request Example
GET /api/crypto/price-history/1
Accept: application/json
Response Example 200 OK
{
    "cryptocurrency_symbol": "BTC",
    "timestamp": "2024-01-20T00:00:00Z",
    "price_usd": 42540,
    "volume_24h": 27800000000,
    "market_cap": 834000000000
}
Error Response 404 Not Found
{
  "error": "Resource not found",
  "message": "The requested price-history does not exist"
}
POST /api/crypto/price-history Public

Create a new price-history

Request Body
POST /api/crypto/price-history
Content-Type: application/json

{
    "cryptocurrency_symbol": "BTC",
    "timestamp": "2024-01-20T00:00:00Z",
    "price_usd": 42540,
    "volume_24h": 27800000000,
    "market_cap": 834000000000
}
Response Example 201 Created
{
    "cryptocurrency_symbol": "BTC",
    "timestamp": "2024-01-20T00:00:00Z",
    "price_usd": 42540,
    "volume_24h": 27800000000,
    "market_cap": 834000000000
}
PUT/PATCH /api/crypto/price-history/{id} Public

Update an existing price-history

Request Body
PUT /api/crypto/price-history/1
Content-Type: application/json

{
    "cryptocurrency_symbol": "BTC",
    "timestamp": "2024-01-20T00:00:00Z",
    "price_usd": 42540,
    "volume_24h": 27800000000,
    "market_cap": 834000000000
}
Response Example 200 OK
{
    "cryptocurrency_symbol": "BTC",
    "timestamp": "2024-01-20T00:00:00Z",
    "price_usd": 42540,
    "volume_24h": 27800000000,
    "market_cap": 834000000000
}
DELETE /api/crypto/price-history/{id} Public

Delete a price-history by ID

Request Example
DELETE /api/crypto/price-history/1
Accept: application/json
Response Example 200 OK
{
  "message": "Price-history deleted successfully"
}
Error Response 500 Error
{
  "error": "Deletion failed",
  "message": "Unable to delete the resource"
}

Transactions

Buy, sell, and transfer transactions

GET /api/crypto/transactions Auth Required User Filtering

Retrieve a paginated list of all transactions

Request Example
GET /api/crypto/transactions
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
  "data": [
    {
        "transaction_hash": "0x3f4d2a1c8b5e9f6a3d2c1b4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4",
        "user_id": 1,
        "user_name": "Robert Johnson",
        "type": "buy",
        "cryptocurrency_symbol": "BTC",
        "amount": 0.25,
        "price_usd": 43100,
        "total_usd": 10775,
        "from_wallet": "USD Wallet",
        "to_wallet": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
        "status": "confirmed",
        "created_at": "2024-01-20T10:30:00Z",
        "confirmed_at": "2024-01-20T10:35:00Z"
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total": 50,
    "per_page": 15
  }
}
GET /api/crypto/transactions/{id} Auth Required

Retrieve a single transaction by ID

Request Example
GET /api/crypto/transactions/1
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
    "transaction_hash": "0x3f4d2a1c8b5e9f6a3d2c1b4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4",
    "user_id": 1,
    "user_name": "Robert Johnson",
    "type": "buy",
    "cryptocurrency_symbol": "BTC",
    "amount": 0.25,
    "price_usd": 43100,
    "total_usd": 10775,
    "from_wallet": "USD Wallet",
    "to_wallet": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "status": "confirmed",
    "created_at": "2024-01-20T10:30:00Z",
    "confirmed_at": "2024-01-20T10:35:00Z"
}
Error Response 404 Not Found
{
  "error": "Resource not found",
  "message": "The requested transaction does not exist"
}
POST /api/crypto/transactions Auth Required Auto User ID

Create a new transaction

Request Body
POST /api/crypto/transactions
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
    "transaction_hash": "0x3f4d2a1c8b5e9f6a3d2c1b4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4",
    "user_id": 1,
    "user_name": "Robert Johnson",
    "type": "buy",
    "cryptocurrency_symbol": "BTC",
    "amount": 0.25,
    "price_usd": 43100,
    "total_usd": 10775,
    "from_wallet": "USD Wallet",
    "to_wallet": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "status": "confirmed",
    "confirmed_at": "2024-01-20T10:35:00Z"
}
Response Example 201 Created
{
    "transaction_hash": "0x3f4d2a1c8b5e9f6a3d2c1b4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4",
    "user_id": 1,
    "user_name": "Robert Johnson",
    "type": "buy",
    "cryptocurrency_symbol": "BTC",
    "amount": 0.25,
    "price_usd": 43100,
    "total_usd": 10775,
    "from_wallet": "USD Wallet",
    "to_wallet": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "status": "confirmed",
    "created_at": "2024-01-20T10:30:00Z",
    "confirmed_at": "2024-01-20T10:35:00Z"
}
PUT/PATCH /api/crypto/transactions/{id} Auth Required Ownership Check

Update an existing transaction

Only the owner can update this resource
Request Body
PUT /api/crypto/transactions/1
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
    "transaction_hash": "0x3f4d2a1c8b5e9f6a3d2c1b4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4",
    "user_id": 1,
    "user_name": "Robert Johnson",
    "type": "buy",
    "cryptocurrency_symbol": "BTC",
    "amount": 0.25,
    "price_usd": 43100,
    "total_usd": 10775,
    "from_wallet": "USD Wallet",
    "to_wallet": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "status": "confirmed",
    "confirmed_at": "2024-01-20T10:35:00Z"
}
Response Example 200 OK
{
    "transaction_hash": "0x3f4d2a1c8b5e9f6a3d2c1b4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4",
    "user_id": 1,
    "user_name": "Robert Johnson",
    "type": "buy",
    "cryptocurrency_symbol": "BTC",
    "amount": 0.25,
    "price_usd": 43100,
    "total_usd": 10775,
    "from_wallet": "USD Wallet",
    "to_wallet": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "status": "confirmed",
    "created_at": "2024-01-20T10:30:00Z",
    "confirmed_at": "2024-01-20T10:35:00Z"
}
DELETE /api/crypto/transactions/{id} Auth Required Ownership Check

Delete a transaction by ID

Only the owner can delete this resource
Request Example
DELETE /api/crypto/transactions/1
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
  "message": "Transaction deleted successfully"
}
Error Response 500 Error
{
  "error": "Deletion failed",
  "message": "Unable to delete the resource"
}

Users

Platform users

GET /api/crypto/users Public

Retrieve a paginated list of all users

Request Example
GET /api/crypto/users
Accept: application/json
Response Example 200 OK
{
  "data": [
    {
        "name": "Robert Johnson",
        "email": "robert@crypto.com",
        "password": "$2y$12$j1O8T17Lx7IK529rKa0gS.g/cfriqUZylGT9SKKKZ9aAXMTHr828W",
        "api_token": "466c251a43d04a3dd83c5464b55c259c621b525a643f7b84ccb47ea3b39243e0",
        "avatar": "https://i.pravatar.cc/150?img=51",
        "kyc_verified": true,
        "joined_at": "2023-06-15",
        "total_balance_usd": 125670.5,
        "wallets_count": 5
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total": 50,
    "per_page": 15
  }
}
GET /api/crypto/users/{id} Public

Retrieve a single user by ID

Request Example
GET /api/crypto/users/1
Accept: application/json
Response Example 200 OK
{
    "name": "Robert Johnson",
    "email": "robert@crypto.com",
    "password": "$2y$12$j1O8T17Lx7IK529rKa0gS.g/cfriqUZylGT9SKKKZ9aAXMTHr828W",
    "api_token": "466c251a43d04a3dd83c5464b55c259c621b525a643f7b84ccb47ea3b39243e0",
    "avatar": "https://i.pravatar.cc/150?img=51",
    "kyc_verified": true,
    "joined_at": "2023-06-15",
    "total_balance_usd": 125670.5,
    "wallets_count": 5
}
Error Response 404 Not Found
{
  "error": "Resource not found",
  "message": "The requested user does not exist"
}
POST /api/crypto/users Public

Create a new user

Request Body
POST /api/crypto/users
Content-Type: application/json

{
    "name": "Robert Johnson",
    "email": "robert@crypto.com",
    "password": "$2y$12$j1O8T17Lx7IK529rKa0gS.g/cfriqUZylGT9SKKKZ9aAXMTHr828W",
    "api_token": "466c251a43d04a3dd83c5464b55c259c621b525a643f7b84ccb47ea3b39243e0",
    "avatar": "https://i.pravatar.cc/150?img=51",
    "kyc_verified": true,
    "joined_at": "2023-06-15",
    "total_balance_usd": 125670.5,
    "wallets_count": 5
}
Response Example 201 Created
{
    "name": "Robert Johnson",
    "email": "robert@crypto.com",
    "password": "$2y$12$j1O8T17Lx7IK529rKa0gS.g/cfriqUZylGT9SKKKZ9aAXMTHr828W",
    "api_token": "466c251a43d04a3dd83c5464b55c259c621b525a643f7b84ccb47ea3b39243e0",
    "avatar": "https://i.pravatar.cc/150?img=51",
    "kyc_verified": true,
    "joined_at": "2023-06-15",
    "total_balance_usd": 125670.5,
    "wallets_count": 5
}
PUT/PATCH /api/crypto/users/{id} Auth Required Ownership Check

Update an existing user

Only the owner can update this resource
Request Body
PUT /api/crypto/users/1
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
    "name": "Robert Johnson",
    "email": "robert@crypto.com",
    "password": "$2y$12$j1O8T17Lx7IK529rKa0gS.g/cfriqUZylGT9SKKKZ9aAXMTHr828W",
    "api_token": "466c251a43d04a3dd83c5464b55c259c621b525a643f7b84ccb47ea3b39243e0",
    "avatar": "https://i.pravatar.cc/150?img=51",
    "kyc_verified": true,
    "joined_at": "2023-06-15",
    "total_balance_usd": 125670.5,
    "wallets_count": 5
}
Response Example 200 OK
{
    "name": "Robert Johnson",
    "email": "robert@crypto.com",
    "password": "$2y$12$j1O8T17Lx7IK529rKa0gS.g/cfriqUZylGT9SKKKZ9aAXMTHr828W",
    "api_token": "466c251a43d04a3dd83c5464b55c259c621b525a643f7b84ccb47ea3b39243e0",
    "avatar": "https://i.pravatar.cc/150?img=51",
    "kyc_verified": true,
    "joined_at": "2023-06-15",
    "total_balance_usd": 125670.5,
    "wallets_count": 5
}
DELETE /api/crypto/users/{id} Auth Required Ownership Check

Delete a user by ID

Only the owner can delete this resource
Request Example
DELETE /api/crypto/users/1
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
  "message": "User deleted successfully"
}
Error Response 500 Error
{
  "error": "Deletion failed",
  "message": "Unable to delete the resource"
}

Wallets

User cryptocurrency wallets

GET /api/crypto/wallets Auth Required User Filtering

Retrieve a paginated list of all wallets

Returns only wallets belonging to authenticated user
Request Example
GET /api/crypto/wallets
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
  "data": [
    {
        "user_id": 1,
        "user_name": "Robert Johnson",
        "cryptocurrency_id": 1,
        "cryptocurrency_symbol": "BTC",
        "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
        "balance": 2.45000000000000017763568394002504646778106689453125,
        "balance_usd": 105962.5,
        "created_at": "2023-06-15T10:00:00Z"
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total": 50,
    "per_page": 15
  }
}
GET /api/crypto/wallets/{id} Auth Required

Retrieve a single wallet by ID

Request Example
GET /api/crypto/wallets/1
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "cryptocurrency_id": 1,
    "cryptocurrency_symbol": "BTC",
    "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "balance": 2.45000000000000017763568394002504646778106689453125,
    "balance_usd": 105962.5,
    "created_at": "2023-06-15T10:00:00Z"
}
Error Response 404 Not Found
{
  "error": "Resource not found",
  "message": "The requested wallet does not exist"
}
POST /api/crypto/wallets Auth Required Auto User ID

Create a new wallet

Request Body
POST /api/crypto/wallets
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "cryptocurrency_id": 1,
    "cryptocurrency_symbol": "BTC",
    "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "balance": 2.45000000000000017763568394002504646778106689453125,
    "balance_usd": 105962.5
}
Response Example 201 Created
{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "cryptocurrency_id": 1,
    "cryptocurrency_symbol": "BTC",
    "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "balance": 2.45000000000000017763568394002504646778106689453125,
    "balance_usd": 105962.5,
    "created_at": "2023-06-15T10:00:00Z"
}
PUT/PATCH /api/crypto/wallets/{id} Auth Required Ownership Check

Update an existing wallet

Only the owner can update this resource
Request Body
PUT /api/crypto/wallets/1
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "cryptocurrency_id": 1,
    "cryptocurrency_symbol": "BTC",
    "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "balance": 2.45000000000000017763568394002504646778106689453125,
    "balance_usd": 105962.5
}
Response Example 200 OK
{
    "user_id": 1,
    "user_name": "Robert Johnson",
    "cryptocurrency_id": 1,
    "cryptocurrency_symbol": "BTC",
    "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "balance": 2.45000000000000017763568394002504646778106689453125,
    "balance_usd": 105962.5,
    "created_at": "2023-06-15T10:00:00Z"
}
DELETE /api/crypto/wallets/{id} Auth Required Ownership Check

Delete a wallet by ID

Only the owner can delete this resource
Request Example
DELETE /api/crypto/wallets/1
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Response Example 200 OK
{
  "message": "Wallet deleted successfully"
}
Error Response 500 Error
{
  "error": "Deletion failed",
  "message": "Unable to delete the resource"
}