---
title: "Updates a portfolio's settings."
---

> 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

`PATCH /v1/stores/{store}/products/{product}/portfolio`

## Authentication

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

## Path parameters

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

## Header parameters

- `Idempotency-Key` (`updatePortfolio.header.Idempotency-Key`; string, optional) — Repeats within 24 hours answer the first result; the same key with other arguments is a conflict.
  - minLength 1; maxLength 255; pattern `^[\x21-\x7E]+$`

## Request body

_Optional._

- `settings` (`updatePortfolio.settings`; object, optional) — Merged onto the stored settings; null deletes a key.
  - `show_absolute_values` (`updatePortfolio.settings.show_absolute_values`; any of, optional) — Amounts, not only percentages.
    - any of: `boolean`, `null`
  - `locked_chart_delay` (`updatePortfolio.settings.locked_chart_delay`; any of, optional)
    - any of: `string`, `null`
- `currency` (`updatePortfolio.currency`; string, optional) — Only while the portfolio holds no holding, event or snapshot.
  - minLength 3; maxLength 3

## Example request

```json
{
  "settings": {
    "show_absolute_values": true,
    "locked_chart_delay": "week",
    "property1": true,
    "property2": true
  },
  "currency": "str"
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/portfolio' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "settings": {
    "show_absolute_values": true,
    "locked_chart_delay": "week",
    "property1": true,
    "property2": true
  },
  "currency": "str"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/portfolio';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    settings: {
      show_absolute_values: true,
      locked_chart_delay: 'week',
      property1: true,
      property2: true
    },
    currency: 'str'
  })
};

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"

payload = {
    "settings": {
        "show_absolute_values": True,
        "locked_chart_delay": "week",
        "property1": True,
        "property2": True
    },
    "currency": "str"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Updates a portfolio's settings.

#### Example

```json
{
  "product": {
    "id": "string",
    "slug": "string",
    "path": "string",
    "url": "string",
    "title": "string",
    "category": "string",
    "deleted": true
  },
  "holdings": {
    "items": [
      {
        "id": "string",
        "portfolio_id": "string",
        "symbol": "string",
        "shares": 0,
        "avg_cost": 0,
        "cost_currency": "string",
        "cost_exponent": 0,
        "price_currency": "string",
        "price_exponent": 0,
        "name": "string",
        "symbol_type": "string",
        "currency": "string",
        "note": "string",
        "removed_note": "string",
        "removed_at": "string",
        "updated_at": "string",
        "metadata": {
          "property1": true,
          "property2": true
        }
      }
    ],
    "total": 0
  },
  "events": 0,
  "snapshots": 0,
  "id": "string",
  "product_id": "string",
  "currency": "string",
  "exponent": 0,
  "settings": {
    "show_absolute_values": true,
    "locked_chart_delay": "string",
    "property1": true,
    "property2": true
  },
  "created_at": "string"
}
```

- `product` (`updatePortfolio.response.200.product`; object, required)
  - `id` (`updatePortfolio.response.200.product.id`; string, required)
  - `slug` (`updatePortfolio.response.200.product.slug`; string, required)
  - `path` (`updatePortfolio.response.200.product.path`; any of, required) — The product's storefront path, or null once deleted, since another product may take its slug.
    - any of: `string`, `null`
  - `url` (`updatePortfolio.response.200.product.url`; any of, required) — The absolute URL on the store's verified hostname, or null before it has one or once deleted.
    - any of: `string`, `null`
  - `title` (`updatePortfolio.response.200.product.title`; string, required)
  - `category` (`updatePortfolio.response.200.product.category`; string, required)
  - `deleted` (`updatePortfolio.response.200.product.deleted`; boolean, required)
- `holdings` (`updatePortfolio.response.200.holdings`; object, required)
  - `items` (`updatePortfolio.response.200.holdings.items`; array<object>, required)
    - `id` (`updatePortfolio.response.200.holdings.items.id`; string, required)
    - `portfolio_id` (`updatePortfolio.response.200.holdings.items.portfolio_id`; string, required)
    - `symbol` (`updatePortfolio.response.200.holdings.items.symbol`; string, required)
    - `shares` (`updatePortfolio.response.200.holdings.items.shares`; number, required)
    - `avg_cost` (`updatePortfolio.response.200.holdings.items.avg_cost`; any of, required)
      - any of: `number`, `null`
    - `cost_currency` (`updatePortfolio.response.200.holdings.items.cost_currency`; string, required)
    - `cost_exponent` (`updatePortfolio.response.200.holdings.items.cost_exponent`; any of, required)
      - any of: `number`, `null`
    - `price_currency` (`updatePortfolio.response.200.holdings.items.price_currency`; string, required)
    - `price_exponent` (`updatePortfolio.response.200.holdings.items.price_exponent`; any of, required)
      - any of: `number`, `null`
    - `name` (`updatePortfolio.response.200.holdings.items.name`; string, required)
    - `symbol_type` (`updatePortfolio.response.200.holdings.items.symbol_type`; any of, required)
      - any of: `string`, `null`
    - `currency` (`updatePortfolio.response.200.holdings.items.currency`; any of, required)
      - any of: `string`, `null`
    - `note` (`updatePortfolio.response.200.holdings.items.note`; any of, required)
      - any of: `string`, `null`
    - `removed_note` (`updatePortfolio.response.200.holdings.items.removed_note`; any of, required)
      - any of: `string`, `null`
    - `removed_at` (`updatePortfolio.response.200.holdings.items.removed_at`; any of, required)
      - any of: `string`, `null`
    - `updated_at` (`updatePortfolio.response.200.holdings.items.updated_at`; any of, required)
      - any of: `string`, `null`
    - `metadata` (`updatePortfolio.response.200.holdings.items.metadata`; map<any of>, required)
  - `total` (`updatePortfolio.response.200.holdings.total`; number, required)
- `events` (`updatePortfolio.response.200.events`; number, required)
- `snapshots` (`updatePortfolio.response.200.snapshots`; number, required)
- `id` (`updatePortfolio.response.200.id`; string, required)
- `product_id` (`updatePortfolio.response.200.product_id`; string, required)
- `currency` (`updatePortfolio.response.200.currency`; string, required)
- `exponent` (`updatePortfolio.response.200.exponent`; any of, required)
  - any of: `number`, `null`
- `settings` (`updatePortfolio.response.200.settings`; object, required)
  - `show_absolute_values` (`updatePortfolio.response.200.settings.show_absolute_values`; boolean, optional) — Amounts, not only percentages.
  - `locked_chart_delay` (`updatePortfolio.response.200.settings.locked_chart_delay`; string, optional)
- `created_at` (`updatePortfolio.response.200.created_at`; any of, required)
  - any of: `string`, `null`

### 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` (`updatePortfolio.response.default.type`; string, required)
  - format `uri`
- `title` (`updatePortfolio.response.default.title`; string, required)
- `status` (`updatePortfolio.response.default.status`; integer, required)
- `detail` (`updatePortfolio.response.default.detail`; string, required)
- `code` (`updatePortfolio.response.default.code`; string, optional)
- `context` (`updatePortfolio.response.default.context`; object, optional)
- `reached_core` (`updatePortfolio.response.default.reached_core`; boolean, optional)
- `core_answer` (`updatePortfolio.response.default.core_answer`; string, optional)


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