**版本：202201**

# 查询子款式详情

**GET** `/openapi/2022-01/variants/:variant_id`

通过子款式 ID 获取指定子款式的详细信息。

## 请求

**Path参数**

- `variant_id` string (required)

  待查询的子款式 ID。

## 响应

**200 | 422**

200

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `variant` object

  - `id` string

    **示例：** `88e68830-4ef5-4125-bf7d-aef8047176b2`
  - `product_id` string

    **示例：** `a1a88be0-a1d4-47e4-a2f2-ba6e131cf447`
  - `image_id` string

    **示例：** `8ef098c5-5a08-44b4-b5fb-89214bb507dc`
  - `created_at` string

    **示例：** `2024-04-17T02:15:18Z`
  - `updated_at` string

    **示例：** `2024-04-17T02:15:18Z`
  - `title` string

    **示例：** `S-blue-T`
  - `option1` string

    **示例：** `S`
  - `option2` string

    **示例：** `blue`
  - `option3` string

    **示例：** `T`
  - `image` object

    - `src` string

      **示例：** `//cdn.shoplazza.com/ccf0794c594bad32a320eea0d6bfe40c.jpeg`
    - `width` integer

      **默认值：** `0`

      **示例：** `174`
    - `height` integer

      **默认值：** `0`

      **示例：** `180`
    - `path` string

      **示例：** `ccf0794c594bad32a320eea0d6bfe40c.jpeg`
    - `alt` string

      **示例：**
  - `position` integer

    **默认值：** `0`

    **示例：** `1`
  - `compare_at_price` string

    **示例：** `12.10`
  - `price` string

    **示例：** `10.10`
  - `sku` string

    **示例：** `T-M-S-blue-T-A001004`
  - `barcode` string

    **示例：** `6929000212340`
  - `note` string

    **示例：** `node`
  - `inventory_quantity` integer

    **默认值：** `0`

    **示例：** `10`
  - `weight` string

    **示例：** `1.10`
  - `weight_unit` string

    **示例：** `kg`
  - `cost_price` string

    **示例：** `1.10`
  - `wholesale_price` object[]

    *   Array [

    - `price` string

      **示例：** `10.10`
    - `min_quantity` integer

      **默认值：** `0`

      **示例：** `1`
    *   ]
  - `extend` object

    - `length` integer

      **默认值：** `0`

      **示例：** `10`
    - `width` integer

      **默认值：** `0`

      **示例：** `10`
    - `height` integer

      **默认值：** `0`

      **示例：** `10`
    - `dimension_unit` string

      **示例：** `in`
    - `origin_country_code` string

      **示例：** `AG`
    - `hs_code` string

      **示例：** `62114390`

```json
{
  "variant": {
    "id": "88e68830-4ef5-4125-bf7d-aef8047176b2",
    "product_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
    "image_id": "8ef098c5-5a08-44b4-b5fb-89214bb507dc",
    "created_at": "2024-04-17T02:15:18Z",
    "updated_at": "2024-04-17T02:15:18Z",
    "title": "S-blue-T",
    "option1": "S",
    "option2": "blue",
    "option3": "T",
    "image": {
      "src": "//cdn.shoplazza.com/ccf0794c594bad32a320eea0d6bfe40c.jpeg",
      "width": 174,
      "height": 180,
      "path": "ccf0794c594bad32a320eea0d6bfe40c.jpeg",
      "alt": ""
    },
    "position": 1,
    "compare_at_price": "12.10",
    "price": "10.10",
    "sku": "T-M-S-blue-T-A001004",
    "barcode": "6929000212340",
    "note": "node",
    "inventory_quantity": 10,
    "weight": "1.10",
    "weight_unit": "kg",
    "cost_price": "1.10",
    "wholesale_price": [
      {
        "price": "10.10",
        "min_quantity": 1
      }
    ],
    "extend": {
      "length": 10,
      "width": 10,
      "height": 10,
      "dimension_unit": "in",
      "origin_country_code": "AG",
      "hs_code": "62114390"
    }
  }
}
```

```json
{
  "variant":
    {
      "id": "88e68830-4ef5-4125-bf7d-aef8047176b2",
      "product_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
      "image_id": "8ef098c5-5a08-44b4-b5fb-89214bb507dc",
      "created_at": "2024-04-17T02:15:18Z",
      "updated_at": "2024-04-17T02:15:18Z",
      "title": "S-blue-T",
      "option1": "S",
      "option2": "blue",
      "option3": "T",
      "image": {
        "src": "//cdn.shoplazza.com/ccf0794c594bad32a320eea0d6bfe40c.jpeg",
        "width": 174,
        "height": 180,
        "path": "ccf0794c594bad32a320eea0d6bfe40c.jpeg",
        "alt": ""
      },
      "position": 1,
      "compare_at_price": "12.10",
      "price": "10.10",
      "sku": "T-M-S-blue-T-A001004",
      "barcode": "6929000212340",
      "note": "node",
      "inventory_quantity": 10,
      "weight": "1.10",
      "weight_unit": "kg",
      "cost_price": "1.10",
      "wholesale_price": [
        {
          "price": "10.10",
          "min_quantity": 1
        }
      ],
      "extend": {
        "length": 10,
        "width": 10,
        "height": 10,
        "dimension_unit": "in",
        "origin_country_code": "AG",
        "hs_code": "62114390"
      }
    }
}
```

422

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `errors` string[]

```json
{
  "errors": [
    "variantId has an invalid UUID"
  ]
}
```

```json
{
  "errors": [
    "variantId has an invalid UUID"
  ]
}
```
