# Shop variant create

`POST /shop/variants` · Rivier · shop

Add a variant (SKU, options, weight, tax class, cost and price floor) to a product.

- Scope: shop:admin
- Mcp: rivier_shop_variant_create
- Sdk: shop.variant.create
- Cli: shop variant create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "productId": {
      "type": "string",
      "format": "uuid"
    },
    "sku": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "gtin": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 20
        },
        {
          "type": "null"
        }
      ]
    },
    "mpn": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 80
        },
        {
          "type": "null"
        }
      ]
    },
    "options": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 100
      },
      "default": {}
    },
    "weightG": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000000,
      "default": 0
    },
    "taxClass": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{0,29}$",
      "default": "standard"
    },
    "costMinor": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "priceFloorMinor": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "position": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000,
      "default": 0
    }
  },
  "required": [
    "productId",
    "sku"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/shop/variants' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "productId": "string",
  "sku": "string"
}'
```
