---
title: "Update product variants"
method: PATCH
path: "/products/{product_id}/variants"
tags: ["Products"]
---

# Update product variants

`PATCH /products/{product_id}/variants`

## Request

- Base URL: `https://api.whatnot.com/seller-api/rest/v2`
- URL: `https://api.whatnot.com/seller-api/rest/v2/products/{product_id}/variants`
- Auth: OAuth 2
  - Authorization code: `https://api.whatnot.com/seller-api/rest/oauth/authorize`
  - Token URL: `https://api.whatnot.com/seller-api/rest/oauth/token`

Partially update one or more of a product's variants; omitted fields are unchanged. `media` replaces a variant's image with one item; a variant image cannot be removed. A new image is ingested asynchronously and may be missing from this response. With allow_partial_updates, valid variants are applied and the rest are returned in errors. Without it, any invalid variant rejects the whole batch.

## Path parameters

- `product_id` string, required

## Request body

- UpdateProductVariantsRequest
  - `variants` ProductVariantPatch[], required: The variant patches, each keyed by id. At most 10 per request, and each id at most once.
    - `id` string, required: The variant's id.
    - `sku` string, nullable: Seller SKU. Send null to clear.
    - `external_id` string, nullable: Seller external identifier. Send null to clear.
    - `pricing` VariantPricingInput: Prices to stage per format. An omitted format is left unchanged.
      - `buy_it_now` VariantBuyItNowInput
        - `price` Money, required
          - `amount` string, required: Decimal amount in major currency units, e.g. 42.00.
          - `currency` string, required: ISO 4217 currency code.
      - `auction` VariantAuctionInput
        - `start_price` Money, required
          - `amount` string, required: Decimal amount in major currency units, e.g. 42.00.
          - `currency` string, required: ISO 4217 currency code.
    - `country_of_origin` string, nullable: Seller-declared country of origin, ISO 3166-1 alpha-2.
    - `media` Media[], nullable: Replaces the variant's image. Send one item. Omit the field to leave it unchanged. A variant image cannot be removed. Ingest is asynchronous, so a new image may be missing from this response.
      - `id` string, nullable: The image's id.
      - `url` string, required: On create, the image URL to ingest. On read, the CDN URL of the ingested image.
      - `alt` string, nullable: The image's alt text / label, if set.
  - `allow_partial_updates` boolean: When true, valid variants are applied and failures are returned in errors. When false, any invalid variant rejects the whole batch with a 422 and nothing is written.

## Response `207`

The updated variants, plus per-variant errors.

- VariantBatchResult
  - `variants` ProductVariant[], required: The updated variants, in input order.
    - `id` string, required: The variant's id.
    - `product_id` string, required: Parent product identifier.
    - `sku` string, nullable, required: Seller SKU, if set.
    - `external_id` string, nullable, required: Seller external identifier, if set.
    - `selected_options` SelectedOption[], required: Selected product option values.
      - `id` string, required: Stable product option identifier.
      - `name` string, required: Product option display name.
      - `value_id` string, required: Stable option value identifier.
      - `value` string, required: Selected option value.
    - `pricing` VariantPricing, required
      - `buy_it_now` VariantBuyItNow, required
        - `price` Money, required
          - `amount` string, required: Decimal amount in major currency units, e.g. 42.00.
          - `currency` string, required: ISO 4217 currency code.
      - `auction` VariantAuction, required
        - `start_price` Money, required
          - `amount` string, required: Decimal amount in major currency units, e.g. 42.00.
          - `currency` string, required: ISO 4217 currency code.
    - `country_of_origin` string, nullable, required: Seller-declared country of origin.
    - `inventory` VariantInventory, required
      - `available_quantity` integer, required: Available inventory quantity.
    - `media` Media[], required: Resolved variant images.
      - `id` string, nullable: The image's id.
      - `url` string, required: On create, the image URL to ingest. On read, the CDN URL of the ingested image.
      - `alt` string, nullable: The image's alt text / label, if set.
  - `errors` VariantError[], nullable: Patches that were not applied, in input order. Present only when allow_partial_updates is true.
    - `id` string, required: The patch's id, echoed from input.
    - `code` 'variant_not_found' | 'variant_not_editable' | 'pricing_not_supported' | 'variants_not_supported', required: Why the patch was not applied.
    - `message` string, required: A human-readable explanation.

## Other responses

- `404`: Product not found.
- `422`: The request failed validation.

---

[API](https://skmtc.dev/whatnot/apis/whatnot-seller-api.md) - [All operations](https://skmtc.dev/whatnot/apis/whatnot-seller-api/llms.txt) - [OpenAPI document](https://skmtc.dev/whatnot/apis/whatnot-seller-api/revisions/e619f15f7ce0?raw)
