POST
/
portfolio
/
transaction
cURL
curl --request POST \
  --url https://openapiv1.coinstats.app/portfolio/transaction \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "coinId": "bitcoin",
  "count": 0.1,
  "date": 1715948176654,
  "price": 66252.93,
  "portfolioId": "xobgM6CHi1zaEJaCXmPWenVoS",
  "currency": "USD",
  "notes": "Some notes."
}'
{
  "transactionType": "<string>",
  "date": "<string>",
  "coinData": {
    "identifier": "<string>",
    "count": 123,
    "symbol": "<string>",
    "totalWorth": 123,
    "currentValue": 123
  },
  "profitLoss": {
    "profit": 123,
    "profitPercent": 123,
    "currentValue": 123
  },
  "fee": {
    "coin": {
      "rank": 123,
      "identifier": "<string>",
      "symbol": "<string>",
      "name": "<string>",
      "icon": "<string>",
      "isFake": true,
      "isFiat": true,
      "priceChange24h": 123,
      "priceChange1h": 123,
      "priceChange7d": 123,
      "volume": 123
    },
    "count": 123,
    "toAddress": "<string>",
    "fromAddress": "<string>",
    "totalWorth": 123,
    "price": 123
  },
  "transfers": [
    {
      "transferType": "<string>",
      "items": [
        {
          "coin": {
            "rank": 123,
            "identifier": "<string>",
            "symbol": "<string>",
            "name": "<string>",
            "icon": "<string>",
            "isFake": true,
            "isFiat": true,
            "priceChange24h": 123,
            "priceChange1h": 123,
            "priceChange7d": 123,
            "volume": 123
          },
          "count": 123,
          "toAddress": "<string>",
          "fromAddress": "<string>",
          "totalWorth": 123,
          "price": 123
        }
      ]
    }
  ],
  "portfolioInfo": {
    "name": "<string>",
    "icon": "<string>"
  }
}
4 credits per request
Add a new transaction to your manual portfolio:
  • Support for buy, sell, and transfer operations
  • Automatically updates your portfolio holdings
  • Validates transaction data before recording
  • Returns the details of the created transaction
Required:
  • shareToken: Get this from your CoinStats portfolio page
  • Transaction details in request body:
    • coinId: The cryptocurrency’s identifier
    • count: Amount (negative for sells)
    • date: Transaction timestamp (optional)
    • price: Price at time of transaction (optional)
Optional:
  • notes: Add personal notes to the transaction
  • currency: Specify currency for price (default: USD)
  • passcode: Optional passcode for accessing protected portfolio data
Note: This endpoint is only available for users with a Degen plan subscription.

Authorizations

X-API-KEY
string
header
required

API key needed to access the endpoints. Example: 'demo-api-key'

Query Parameters

shareToken
string
required

<b>To access your Share Token</b> Visit <a target='_blank' href='https://coinstats.app/portfolio'>CoinStats Portfolio</a> and make sure you are signed in to your account. In the top-right corner of the page, click on the Share button. This will bring up sharing preferences for your portfolio. Generate a Share Link. In the generated URL, the segment following <code>/p/</code> (e.g., <code>XXX</code>) is your share token. Copy only that token (without additional slashes or characters). Use the Token in the API

passcode
string

Optional passcode for accessing protected portfolio data

Example:

"123456"

Body

application/json

Response

200
application/json

Transactions

The response is of type object.