# Variants

> Each option of a product, tied to the seller's SKU and to your store's variant.

Source: https://www.ninjabuy.com/business/docs/api/variants

One option of a product, a size, a colour or a phone model, tied to the seller's SKU we buy and to the variant your store sells.

A variant is what an order line names. Its [inventory level](https://www.ninjabuy.com/business/docs/api/inventory-levels.md) says how many you can sell.

Endpoints

- GET /v1/products/{id}/variants List a product's variants
- GET /v1/variants/{id} Coming soon Retrieve a variant
- PATCH /v1/variants/{id} Coming soon Update a variant

## The Variant object

- `id` string

  Starts var\_.

- `sku` string

  The seller's SKU, as we read it. What we buy.

- `label, options`

  The option values, as one label and by option name.

- `cost` money

  What the seller charges for one, in CN¥, as last read.

- `price` money

  Your selling price.

- `in_stock` boolean

  Whether the seller can sell it, as last read.

- `units` integer

  One by default. An order line can request multiple units per item.

- `weight_g` integer

  The packed weight you gave for one, used to estimate shipping.

- `external_variant_id` string|null

  Null for API products. Your integration keeps the store's variant mapping.

variant

```json
{  "id": "var_41hz",  "product": "prd_8f2k",  "sku": "5187209554",  "label": "Black / M",  "options": { "Color": "Black", "Size": "M" },  "image": "https://media.ninjabuy.com/listings/weidian-7750970856/sku-black.webp",  "cost": { "amount": "38.00", "currency": "CNY" },  "price": { "amount": "49.99", "currency": "USD" },  "in_stock": true,  "units": 1,  "weight_g": 180,  "external_variant_id": null,  "updated_at": "2026-11-04T09:20:03Z"}
```

## List a product's variants

GET /v1/products/{id}/variants

Every variant with its cost, your price, stock and mapping.

Scope products:read

### Path parameters

- `id` string required

  The product's id.

### Query parameters

- `limit, cursor`

  [Pagination](https://www.ninjabuy.com/business/docs/api.md#pagination)

### Errors

| Status | Type      | When                             |
| ------ | --------- | -------------------------------- |
| 404    | not-found | No such product on this account. |

```bash
curl "https://www.ninjabuy.com/api/v1/products/prd_8f2k/variants" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11"
```

Response · 200

```
HTTP/2 200 OK​{  "data": [    {      "id": "var_41hz",      "product": "prd_8f2k",      "sku": "5187209554",      "label": "Black / M",      "options": { "Color": "Black", "Size": "M" },      "image": "https://media.ninjabuy.com/listings/weidian-7750970856/sku-black.webp",      "cost": { "amount": "38.00", "currency": "CNY" },      "price": { "amount": "49.99", "currency": "USD" },      "in_stock": true,      "units": 1,      "weight_g": 180,      "external_variant_id": null,      "updated_at": "2026-11-04T09:20:03Z"    },    {      "id": "var_41j0",      "product": "prd_8f2k",      "sku": "5187209555",      "label": "Black / L",      "options": { "Color": "Black", "Size": "M" },      "image": "https://media.ninjabuy.com/listings/weidian-7750970856/sku-black.webp",      "cost": { "amount": "38.00", "currency": "CNY" },      "price": { "amount": "49.99", "currency": "USD" },      "in_stock": false,      "units": 1,      "weight_g": 180,      "external_variant_id": null,      "updated_at": "2026-11-04T09:20:03Z"    }  ],  "has_more": false,  "cursor": null}
```

## Retrieve a variant

GET /v1/variants/{id} Coming soon

One variant.

Scope products:read

### Path parameters

- `id` string required

  The variant's id.

### Errors

| Status | Type      | When                             |
| ------ | --------- | -------------------------------- |
| 404    | not-found | No such variant on this account. |

```bash
curl "https://www.ninjabuy.com/api/v1/variants/var_41hz" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11"
```

Response · 200

```
HTTP/2 200 OK​{  "id": "var_41hz",  "product": "prd_8f2k",  "sku": "5187209554",  "label": "Black / M",  "options": { "Color": "Black", "Size": "M" },  "image": "https://media.ninjabuy.com/listings/weidian-7750970856/sku-black.webp",  "cost": { "amount": "38.00", "currency": "CNY" },  "price": { "amount": "49.99", "currency": "USD" },  "in_stock": true,  "units": 1,  "weight_g": 180,  "external_variant_id": null,  "updated_at": "2026-11-04T09:20:03Z"}
```

## Update a variant

PATCH /v1/variants/{id} Coming soon

Set its price, the units bought per sale, its weight, or the store variant it answers for. Send only what changes.

Scope products:write

### Path parameters

- `id` string required

  The variant's id.

### Body

- `price` money

  Optional. Your selling price.

- `units` integer

  Optional. 1 to 50.

- `weight_g` integer

  Optional. Packed weight of one, in grams.

- `external_variant_id` string|null

  Optional. Map it to a variant in your store, or null to unmap it.

### Errors

| Status | Type          | When                                                |
| ------ | ------------- | --------------------------------------------------- |
| 404    | not-found     | No such variant on this account.                    |
| 409    | invalid-state | That store variant already answers for another SKU. |

```bash
curl -X PATCH "https://www.ninjabuy.com/api/v1/variants/var_41hz" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11" \  -H "Content-Type: application/json" \  -d '{    "units": 2,    "price": { "amount": "89.99", "currency": "USD" }  }'
```

Response · 200

```
HTTP/2 200 OK​{  "id": "var_41hz",  "product": "prd_8f2k",  "sku": "5187209554",  "label": "Black / M",  "options": { "Color": "Black", "Size": "M" },  "image": "https://media.ninjabuy.com/listings/weidian-7750970856/sku-black.webp",  "cost": { "amount": "38.00", "currency": "CNY" },  "price": { "amount": "89.99", "currency": "USD" },  "in_stock": true,  "units": 2,  "weight_g": 180,  "external_variant_id": null,  "updated_at": "2026-11-04T09:20:03Z"}
```

- The API is open on request. Our team sets up your Business account and issues its API keys.

  [Contact sales](https://www.ninjabuy.com/business#contact)
