Products

Create product variant

Creates a variant of a product. Creating a variant for a physical or service product requires that the product already has at least one attribute.

post/v2/commerce/products/{productId}/variants

Request

Path parameters

productIdstring required

Headers

Authorizationstring required

API key or OAuth access token

User-Agentstring required

User Agent

Request body

attributesobject

Specifies attribute-value pairs for the variant. 100 char limit per key and per value with no more than six key-value pairs. Supported for PHYSICAL products only.

gtinstring

Global Trade Item Number (GTIN). Optional. Must be 8, 12, 13, or 14 numeric digits. Whitespace, hyphens, and underscores are stripped before validation. Supported for PHYSICAL products only.

mpnstring

Manufacturer Part Number (MPN). Optional. Must be alphanumeric and 70 characters or fewer. Whitespace, hyphens, and underscores are stripped before validation. Supported for PHYSICAL products only.

skustring required

Merchant-defined code that identifies the product variant. Value must be unique among variants. Leading and trailing whitespace is removed.

Example request

{
  "gtin": "01234567890128",
  "mpn": "MPN-1234",
  "pricing": {
    "basePrice": {
      "value": 49.99
    },
    "salePrice": {
      "value": 49.99
    }
  }
}

Response

The ProductVariant was created successfully.

OR
OR

Example response

{
  "pricing": {
    "basePrice": {
      "value": 49.99
    },
    "salePrice": {
      "value": 49.99
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.