# Update a product

`PATCH https://api.anyshop.io/v1/products/{id}`

Changes the fields you send and nothing else.

- Part of the [API reference](https://docs.anyshop.io/reference.md), [Products](https://docs.anyshop.io/reference.md#products).
- Scope: `products:write`.
- Live keys only.
- Idempotent with Idempotency-Key.
- Answers 403 `store_suspended` while the store is suspended.

## Path parameters

- `id` (string, required)

## Body (application/json)

- `name` (string): What buyers see on your storefront and in their email. 1 to 120 characters.
- `category` (enum): Deprecated and ignored: products have no category since 23 November 2026. Still accepted, so existing integrations keep working. Values: `software_licenses`, `digital_files`, `access_memberships`, `services`.
- `slug` (string): A new address on the storefront: lowercase letters, digits and dashes. The old address keeps working: the product page sends visitors on, and checkout links and buy buttons made with it still open the product. Up to 80 characters.
- `description` (string): Shown on the product page. Up to 10,000 characters.
- `max_quantity_per_order` (integer): How many one buyer can take in one order, default 1. 1 to 100.
- `min_quantity_per_order` (integer): The fewest one buyer takes in one order, default 1, at most max_quantity_per_order. Lowering max_quantity_per_order below it lowers it too. A product with fewer keys or units left than this shows as sold out. 1 to 100.
- `listed` (boolean): Whether it shows on your store page, default true. False hides it from the store page's list and search; its own link, buy buttons and the API still sell it.
- `low_stock_threshold` (integer or null): Serial keys only. Below this many keys you get the daily low stock email and a stock.low event. 0 to 1,000,000.
- `platform` (string or null): Serial keys only. Where the key is used, such as Windows and macOS. Up to 40 characters.
- `region` (string or null): Serial keys only. Where the key works. Up to 40 characters.
- `delivery_instructions` (string): The seller's instructions for the buyer, shown with what was delivered (a key, a license, a download), or, for a service, what the buyer receives. Up to 2,000 characters.
- `dynamic_endpoint_url` (string or null): Dynamic products: your https server (port 443 or 8443), which anyshop calls after each payment with a Standard Webhooks signed request; its answer is delivered. Up to 2,048 characters.
- `immediate_delivery_consent` (boolean): Whether every buyer ticks a box at checkout asking for it right away; in the EU, the EEA and the UK this ends their 14-day cancellation period when it is delivered. Off: no buyer is asked, and EU, EEA and UK buyers keep the 14 days. Default true, false for services.
- `stock_limit` (integer or null): Not for serial keys. Units left to sell: each live sale takes one off, sold out at 0. Null is unlimited. 0 to 1,000,000.
- `payment_methods` (array of strings or null): The ways to pay it takes, from those your store connected: stripe, paypal, btc, ltc. Null takes every one. 1 to 20 items.
- `seo_title` (string or null): The product page's title in search results and link previews, up to 70 characters. Null or empty uses the product's name. Up to 70 characters.
- `seo_description` (string or null): The product page's description in search results and link previews, up to 155 characters. Null or empty uses the start of its description. Up to 155 characters.
- `after_purchase_url` (string or null): A full https address, up to 500 characters, without a user name or password. Once the buyer paid, their order page offers a button to continue to it. When an order's products have different links, none is offered. Null or empty for none. Up to 500 characters.
- `quantity_discounts` (array of objects): Up to 4 steps for every variant, each from min_quantity (2 up to max_quantity_per_order) with percent_off (1 to 90), with bigger discounts at bigger quantities. Refused when max_quantity_per_order is 1. Send [] for none. Lowering max_quantity_per_order below a step is refused: change the steps with it. Up to 4 items.
  - `min_quantity` (integer, required): From this many units in one order: 2 up to max_quantity_per_order. 2 to 100.
  - `percent_off` (integer, required): Percent off the line, 1 to 90. 1 to 90.
- `thank_you_message` (string): Up to 1,000 characters of visible text with simple formatting: **bold**, *italic*, [words](https://...) links (https only), - or 1. lists, and paragraphs separated by an empty line. Anything else, HTML included, shows as the text it is. Checked like the product's description: a live product whose message matches our acceptable use policy is held for a review. Empty for none. Up to 5,000 characters.
- `upsell` (object or null): Offer another product of your store on the thank-you page: product_id, on sale and not this product, and coupon_id, a coupon that applies to it, or null. Null for no offer.
  - `product_id` (string, required): Another product of your store that is on sale, never this one. Up to 64 characters.
  - `coupon_id` (string or null, required): A coupon of your store that applies to that product, or null for none. Up to 64 characters.
- `items` (array of objects): Bundles only: the products it holds, in order, each variant once. 2 to 10 to publish it (a draft may hold fewer). Each is delivered as it is on its own: keys from its own stock, licenses issued, its file, your server, its instructions. Sending the list replaces the one before. Up to 10 items.
  - `product_id` (string, required): A product of your store that is not a bundle. Up to 64 characters.
  - `variant_id` (string, required): One of that product's variants, at a fixed price. Up to 64 characters.
  - `quantity` (integer, required): How many of it one bundle gives, up to that product's max_quantity_per_order. 1 to 100.

## Headers

- `Idempotency-Key` (string): Up to 255 characters. A retry with the same key and request gets the first answer, without running twice (24 hours).

## Returns

The **product** object.

## Errors

| Status | error.type | When |
| --- | --- | --- |
| 400 | `invalid_request` | The request is not valid; `error.param` names the field |
| 401 | `authentication` | No API key, or it is not valid |
| 403 | `permission` | The key does not have the scope this needs, or the store is suspended (store_suspended) |
| 404 | `not_found` | Not found in the key's store and mode |
| 409 | `conflict` | Conflicts with the object's state (type conflict), or an Idempotency-Key reused for another request (type idempotency, code idempotency_key_reused) |
| 429 | `rate_limited` | Too many requests; see Retry-After |

## Example

curl:

```bash
curl -X PATCH \
  https://api.anyshop.io/v1/products/prod_01m3rr5kmbeb2s18x1kpntjxqb \
  -H "Authorization: Bearer $ANYSHOP_LIVE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Lumen Studio Pro",
    "max_quantity_per_order": 2,
    "min_quantity_per_order": 1,
    "listed": true,
    "low_stock_threshold": 20,
    "platform": "Windows and macOS",
    "region": "Global",
    "delivery_instructions": "In Lumen Studio Pro, choose Help, Enter license key, and paste this key.",
    "immediate_delivery_consent": true,
    "stock_limit": null,
    "payment_methods": null
  }'
```

Node:

```js
const response = await fetch("https://api.anyshop.io/v1/products/prod_01m3rr5kmbeb2s18x1kpntjxqb", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.ANYSHOP_LIVE_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Lumen Studio Pro",
    "max_quantity_per_order": 2,
    "min_quantity_per_order": 1,
    "listed": true,
    "low_stock_threshold": 20,
    "platform": "Windows and macOS",
    "region": "Global",
    "delivery_instructions": "In Lumen Studio Pro, choose Help, Enter license key, and paste this key.",
    "immediate_delivery_consent": true,
    "stock_limit": null,
    "payment_methods": null
  }),
});
const answer = await response.json();
```

Python:

```python
import os
import requests

response = requests.patch(
    "https://api.anyshop.io/v1/products/prod_01m3rr5kmbeb2s18x1kpntjxqb",
    headers={
        "Authorization": f"Bearer {os.environ['ANYSHOP_LIVE_KEY']}",
    },
    json={
      "name": "Lumen Studio Pro",
      "max_quantity_per_order": 2,
      "min_quantity_per_order": 1,
      "listed": True,
      "low_stock_threshold": 20,
      "platform": "Windows and macOS",
      "region": "Global",
      "delivery_instructions": "In Lumen Studio Pro, choose Help, Enter license key, and paste this key.",
      "immediate_delivery_consent": True,
      "stock_limit": None,
      "payment_methods": None
    },
)
answer = response.json()
```

Answer (200):

```json
{
  "object": "product",
  "id": "prod_01m3rr5kmbeb2s18x1kpntjxqb",
  "name": "Lumen Studio Pro",
  "slug": "lumen-studio-pro",
  "description": "",
  "type": "serial",
  "category": "digital_files",
  "status": "draft",
  "currency": "USD",
  "variants": [
    {
      "id": "var_01m3rr5kmd6h0q2t8w4y9zb7ce",
      "name": "Standard",
      "price": 1999,
      "compare_at_price": null,
      "price_kind": "fixed",
      "minimum_price": null,
      "suggested_price": null,
      "current_price": 1999,
      "sale": null,
      "description": null,
      "low_stock_threshold": null
    }
  ],
  "stock_mode": "shared",
  "max_quantity_per_order": 2,
  "min_quantity_per_order": 1,
  "listed": true,
  "low_stock_threshold": 20,
  "platform": "Windows and macOS",
  "region": "Global",
  "delivery_instructions": "In Lumen Studio Pro, choose Help, Enter license key, and paste this key.",
  "immediate_delivery_consent": true,
  "stock_limit": null,
  "payment_methods": null,
  "seo_title": null,
  "seo_description": null,
  "after_purchase_url": null,
  "quantity_discounts": [],
  "thank_you_message": "",
  "questions": [],
  "upsell": null,
  "items": null,
  "created_at": "2026-10-02T14:21:07.000Z",
  "updated_at": "2026-10-02T14:21:07.000Z",
  "published_at": null
}
```

Answer (400):

```json
{
  "error": {
    "type": "invalid_request",
    "code": "invalid_body",
    "message": "The request is not valid; `error.param` names the field",
    "param": null
  }
}
```

Answer (409):

```json
{
  "error": {
    "type": "conflict",
    "code": "conflict",
    "message": "Conflicts with the object's state (type conflict), or an Idempotency-Key reused for another request (type idempotency, code idempotency_key_reused)",
    "param": null
  }
}
```

The IDs and keys in these examples are made up. Every schema is in the OpenAPI document, https://api.anyshop.io/v1/openapi.json.
