---
title: "Records a trade, cash movement or note in a portfolio."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo merchant API › portfolio

`POST /v1/stores/{store}/products/{product}/portfolio/events`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `portfolio:write`

## Path parameters

- `store` (`recordPortfolioEvent.path.store`; string, required) — The store's id.
- `product` (`recordPortfolioEvent.path.product`; string, required) — An id, or `slug:<slug>`.
  - minLength 1

## Request body

_Required._

Any of:

- `object`
- `object`
- `object`
- `object`
- `object`
- `object`
- `object`
- `object`
- `object`

## Example request

```json
{
  "idempotency_key": "string",
  "type": "file",
  "price": 1,
  "symbol": "string",
  "symbol_type": "stock",
  "file_ids": [
    "string"
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/portfolio/events' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "idempotency_key": "string",
  "type": "file",
  "price": 1,
  "symbol": "string",
  "symbol_type": "stock",
  "file_ids": [
    "string"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/portfolio/events';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    idempotency_key: 'string',
    type: 'file',
    price: 1,
    symbol: 'string',
    symbol_type: 'stock',
    file_ids: ['string']
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/portfolio/events"

payload = {
    "idempotency_key": "string",
    "type": "file",
    "price": 1,
    "symbol": "string",
    "symbol_type": "stock",
    "file_ids": ["string"]
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Records a trade, cash movement or note in a portfolio.

#### Example

```json
{
  "id": "string",
  "portfolio_id": "string",
  "symbol": "string",
  "type": "string",
  "shares": 0,
  "price": 0,
  "amount": 0,
  "note": "string",
  "effective_date": "string",
  "symbol_type": "string",
  "currency": "string",
  "exponent": 0,
  "price_currency": "string",
  "price_exponent": 0,
  "allocation": 0,
  "allocation_change": 0,
  "ratio": {
    "num": 0,
    "den": 0
  },
  "occurred_at": "string",
  "recorded_at": "string",
  "metadata": {
    "source": "string",
    "recorded_by": "string",
    "file_ids": [
      "string"
    ],
    "remediated": true,
    "kind": "string",
    "name": "string",
    "notify": true,
    "price_quoted": true,
    "property1": true,
    "property2": true
  }
}
```

- `id` (`recordPortfolioEvent.response.201.id`; string, required)
- `portfolio_id` (`recordPortfolioEvent.response.201.portfolio_id`; string, required)
- `symbol` (`recordPortfolioEvent.response.201.symbol`; any of, required)
  - any of: `string`, `null`
- `type` (`recordPortfolioEvent.response.201.type`; string, required)
- `shares` (`recordPortfolioEvent.response.201.shares`; any of, required)
  - any of: `number`, `null`
- `price` (`recordPortfolioEvent.response.201.price`; any of, required)
  - any of: `number`, `null`
- `amount` (`recordPortfolioEvent.response.201.amount`; any of, required)
  - any of: `number`, `null`
- `note` (`recordPortfolioEvent.response.201.note`; any of, required)
  - any of: `string`, `null`
- `effective_date` (`recordPortfolioEvent.response.201.effective_date`; any of, required)
  - any of: `string`, `null`
- `symbol_type` (`recordPortfolioEvent.response.201.symbol_type`; any of, required)
  - any of: `string`, `null`
- `currency` (`recordPortfolioEvent.response.201.currency`; string, required)
- `exponent` (`recordPortfolioEvent.response.201.exponent`; any of, required)
  - any of: `number`, `null`
- `price_currency` (`recordPortfolioEvent.response.201.price_currency`; string, required)
- `price_exponent` (`recordPortfolioEvent.response.201.price_exponent`; any of, required)
  - any of: `number`, `null`
- `allocation` (`recordPortfolioEvent.response.201.allocation`; any of, required)
  - any of: `number`, `null`
- `allocation_change` (`recordPortfolioEvent.response.201.allocation_change`; any of, required)
  - any of: `number`, `null`
- `ratio` (`recordPortfolioEvent.response.201.ratio`; any of, required)
  - any of: `object`, `null`
- `occurred_at` (`recordPortfolioEvent.response.201.occurred_at`; any of, required)
  - any of: `string`, `null`
- `recorded_at` (`recordPortfolioEvent.response.201.recorded_at`; any of, required)
  - any of: `string`, `null`
- `metadata` (`recordPortfolioEvent.response.201.metadata`; object, required)
  - `source` (`recordPortfolioEvent.response.201.metadata.source`; string, optional) — `manual` for a member's entry, `auto` for the pipeline.
  - `recorded_by` (`recordPortfolioEvent.response.201.metadata.recorded_by`; string, optional) — The member who recorded a manual entry.
  - `file_ids` (`recordPortfolioEvent.response.201.metadata.file_ids`; array<string>, optional) — For a file event, the assets it announces on the holding.
  - `remediated` (`recordPortfolioEvent.response.201.metadata.remediated`; boolean, optional) — A later correction stands in for it.
  - `kind` (`recordPortfolioEvent.response.201.metadata.kind`; string, optional) — For a split, what the ratio alone cannot tell apart.
  - `name` (`recordPortfolioEvent.response.201.metadata.name`; string, optional) — The instrument's name core resolved when the event was recorded, never a member's.
  - `notify` (`recordPortfolioEvent.response.201.metadata.notify`; boolean, optional) — For a trade, whether the seller asked to notify the customers with access.
  - `price_quoted` (`recordPortfolioEvent.response.201.metadata.price_quoted`; boolean, optional) — The price was left empty and took the symbol's latest quote.

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`recordPortfolioEvent.response.default.type`; string, required)
  - format `uri`
- `title` (`recordPortfolioEvent.response.default.title`; string, required)
- `status` (`recordPortfolioEvent.response.default.status`; integer, required)
- `detail` (`recordPortfolioEvent.response.default.detail`; string, required)
- `code` (`recordPortfolioEvent.response.default.code`; string, optional)
- `context` (`recordPortfolioEvent.response.default.context`; object, optional)
- `reached_core` (`recordPortfolioEvent.response.default.reached_core`; boolean, optional)
- `core_answer` (`recordPortfolioEvent.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/record-portfolio-event/index.md
