Skip to main content
POST
Add a new transaction to your manual portfolio
4 credits per request

  • Support for buy, sell, and transfer operations
  • Automatically updates your portfolio holdings
  • Validates transaction data before recording
  • Returns the details of the created transaction
  • portfolioId (request body): A manual portfolio from GET /portfolio/list
  • 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)
  • notes: Add personal notes to the transaction
  • currency: Specify currency for price (default: USD)
  • shareToken and passcode: Legacy alternative to portfolioId for a shared portfolio

Authorizations

X-API-KEY
string
header
required

API key required to access the endpoints. Generate one from your dashboard at https://openapi.coinstats.app and pass it in the X-API-KEY request header. Never expose your key in client-side code.

Headers

sharetoken
string
passcode
string

Passcode for accessing protected portfolio data

Example:

"123456"

Body

application/json
coinId
string
required

Coin ID from CoinStats API. For fiats you can send coin ID like this: FiatCoinUSD.

Example:

"bitcoin"

count
number
required

Amount of coin. For sell transactions, this should be negative.

Example:

0.1

date
integer

Transaction date in milliseconds. If not provided, current date will be used.

Example:

1715948176654

price
number

Price of coin in USD at the time of transaction.

Example:

66252.93

portfolioId
string

Target manual portfolio id from GET /portfolio/list. Required unless a shareToken for a single portfolio is used.

Example:

"xobgM6CHi1zaEJaCXmPWenVoS"

currency
string

Default is USD.

Example:

"USD"

notes
string

Transaction notes, up to 1000 UTF-16 code units.

Maximum string length: 1000
Example:

"Some notes."

Response

PortfolioTransactions

transactionType
string
required

Display type of the transaction (e.g., Sent, Received, Swap, Roll In). The full list of supported types is available via GET /portfolio/transactions/types — this field matches its name values.

Example:

"Roll In"

date
string
required

ISO 8601 timestamp of when the transaction occurred

Example:

"2025-08-28T08:35:50.384Z"

profitLoss
object
required

Profit and loss information for the transaction

portfolioInfo
object
required

Information about the portfolio where the transaction occurred

coinData
object

Main coin data for the transaction (optional for some transaction types)

fee
object

Transaction fee information. Omitted when the transaction has no fee

transfers
object[]

List of transfers involved in the transaction (e.g., coins received/sent)

note
string

Note attached to the transaction

Example:

"Monthly DCA buy"