---
title: "Updates a price's fields."
---

> 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 › price

`PATCH /v1/stores/{store}/products/{product}/prices/{price}`

## Authentication

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

## Path parameters

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

## Header parameters

- `Idempotency-Key` (`updatePrice.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._

- `amount` (`updatePrice.amount`; integer, optional)
  - min 0; max 9007199254740991
- `title` (`updatePrice.title`; any of, optional) — Null clears it.
  - any of: `string`, `null`
- `description` (`updatePrice.description`; any of, optional)
  - any of: `string`, `null`
- `settings` (`updatePrice.settings`; object, optional) — Merged onto the stored settings; null deletes a key.
  - `autorenew` (`updatePrice.settings.autorenew`; any of, optional) — Recurring only; false stops the renewal, absent renews.
    - any of: `boolean`, `null`
  - `renewal_discount` (`updatePrice.settings.renewal_discount`; any of, optional) — Recurring only, a percent off every renewal.
    - any of: `integer`, `null`
  - `upgrade_multiplier` (`updatePrice.settings.upgrade_multiplier`; any of, optional) — One-time only, a factor on the difference paid to move up a tier.
    - any of: `number`, `null`
  - `refund_policy` (`updatePrice.settings.refund_policy`; any of, optional) — Overrides the product's.
    - any of: `string`, `null`

## Example request

```json
{
  "amount": 9007199254740991,
  "title": "string",
  "description": "string",
  "settings": {
    "autorenew": true,
    "renewal_discount": 100,
    "upgrade_multiplier": 1,
    "refund_policy": "none",
    "property1": true,
    "property2": true
  }
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/prices/<price>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 9007199254740991,
  "title": "string",
  "description": "string",
  "settings": {
    "autorenew": true,
    "renewal_discount": 100,
    "upgrade_multiplier": 1,
    "refund_policy": "none",
    "property1": true,
    "property2": true
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/prices/<price>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    amount: 9007199254740991,
    title: 'string',
    description: 'string',
    settings: {
      autorenew: true,
      renewal_discount: 100,
      upgrade_multiplier: 1,
      refund_policy: 'none',
      property1: true,
      property2: true
    }
  })
};

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>/prices/<price>"

payload = {
    "amount": 9007199254740991,
    "title": "string",
    "description": "string",
    "settings": {
        "autorenew": True,
        "renewal_discount": 100,
        "upgrade_multiplier": 1,
        "refund_policy": "none",
        "property1": True,
        "property2": True
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Updates a price's fields.

#### Example

```json
{
  "in_use": {
    "orders": 0,
    "subscriptions": 0,
    "checkouts": 0,
    "automations": 0,
    "discounts": 0
  },
  "id": "string",
  "product_id": "string",
  "tier_id": "string",
  "currency": "string",
  "exponent": 0,
  "amount": 0,
  "kind": "string",
  "period": {
    "unit": "string",
    "multiplier": 0
  },
  "highlighted": true,
  "title": "string",
  "description": "string",
  "settings": {
    "autorenew": true,
    "renewal_discount": 100,
    "upgrade_multiplier": 1,
    "refund_policy": "string",
    "property1": true,
    "property2": true
  },
  "archived_at": "string",
  "created_at": "string"
}
```

- `in_use` (`updatePrice.response.200.in_use`; object, required)
  - `orders` (`updatePrice.response.200.in_use.orders`; number, required)
  - `subscriptions` (`updatePrice.response.200.in_use.subscriptions`; number, required)
  - `checkouts` (`updatePrice.response.200.in_use.checkouts`; number, required)
  - `automations` (`updatePrice.response.200.in_use.automations`; number, required)
  - `discounts` (`updatePrice.response.200.in_use.discounts`; number, required)
- `id` (`updatePrice.response.200.id`; string, required)
- `product_id` (`updatePrice.response.200.product_id`; string, required)
- `tier_id` (`updatePrice.response.200.tier_id`; string, required)
- `currency` (`updatePrice.response.200.currency`; string, required)
- `exponent` (`updatePrice.response.200.exponent`; any of, required)
  - any of: `number`, `null`
- `amount` (`updatePrice.response.200.amount`; number, required)
- `kind` (`updatePrice.response.200.kind`; string, required)
- `period` (`updatePrice.response.200.period`; any of, required)
  - any of: `object`, `null`
- `highlighted` (`updatePrice.response.200.highlighted`; boolean, required)
- `title` (`updatePrice.response.200.title`; any of, required)
  - any of: `string`, `null`
- `description` (`updatePrice.response.200.description`; any of, required)
  - any of: `string`, `null`
- `settings` (`updatePrice.response.200.settings`; object, required)
  - `autorenew` (`updatePrice.response.200.settings.autorenew`; boolean, optional) — Recurring only; false stops the renewal, absent renews.
  - `renewal_discount` (`updatePrice.response.200.settings.renewal_discount`; integer, optional) — Recurring only, a percent off every renewal.
    - min 0; max 100
  - `upgrade_multiplier` (`updatePrice.response.200.settings.upgrade_multiplier`; number, optional) — One-time only, a factor on the difference paid to move up a tier.
    - min 1; max 10
  - `refund_policy` (`updatePrice.response.200.settings.refund_policy`; string, optional) — Overrides the product's.
- `archived_at` (`updatePrice.response.200.archived_at`; any of, required)
  - any of: `string`, `null`
- `created_at` (`updatePrice.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` (`updatePrice.response.default.type`; string, required)
  - format `uri`
- `title` (`updatePrice.response.default.title`; string, required)
- `status` (`updatePrice.response.default.status`; integer, required)
- `detail` (`updatePrice.response.default.detail`; string, required)
- `code` (`updatePrice.response.default.code`; string, optional)
- `context` (`updatePrice.response.default.context`; object, optional)
- `reached_core` (`updatePrice.response.default.reached_core`; boolean, optional)
- `core_answer` (`updatePrice.response.default.core_answer`; string, optional)


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