**版本：202201**

# 查询价格规则详情

**GET** `/openapi/2022-01/price_rules/:price_rule_id`

通过价格规则 ID 获取指定规则的详细信息。

## 请求

**Path参数**

- `price_rule_id` string (required)

  价格规则 ID。

## 响应

**200 | 404**

200

**application/json**

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

**数据结构**

- `price_rule` object

  - `id` string

    **示例：** `00095d6a-419d-4499-a497-f265fb2edaa5`
  - `title` string

    **示例：** `title-update`
  - `value` integer

    **默认值：** `0`

    **示例：** `0`
  - `value_type` string

    **示例：** `percentage`
  - `usage_limit` string

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

    **示例：** `0`
  - `allocation_method` string

    **示例：**
  - `allocation_limit` string

    **示例：** `0`
  - `once_per_customer` string

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

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

    **示例：** `all`
  - `target_selection` string

    **示例：** `entitled`
  - `target_type` string

    **示例：**
  - `created_at` string

    **示例：** `2020-03-06 17:00:32`
  - `updated_at` string

    **示例：** `2020-03-12 15:29:44`
  - `starts_at` string

    **示例：** `1583424000`
  - `ends_at` string

    **示例：** `1583942399`
  - `entitled_product_ids` string[]
  - `entitled_variant_ids` array
  - `prerequisite_quantity_range` object[]

    *   Array [

    - `greater_than_or_equal_to` string

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

      **示例：** `5`
    - `target_type` string

      **示例：**
    - `target_data` array
    *   ]
  - `prerequisite_subtotal_range`

```json
{
  "price_rule": {
    "id": "00095d6a-419d-4499-a497-f265fb2edaa5",
    "title": "title-update",
    "value": 0,
    "value_type": "percentage",
    "usage_limit": "-1",
    "times_used": "0",
    "allocation_method": "",
    "allocation_limit": "0",
    "once_per_customer": "1",
    "prerequisite": "1",
    "customer_selection": "all",
    "target_selection": "entitled",
    "target_type": "",
    "created_at": "2020-03-06 17:00:32",
    "updated_at": "2020-03-12 15:29:44",
    "starts_at": "1583424000",
    "ends_at": "1583942399",
    "entitled_product_ids": [
      "cea210d5-a419-4d4e-a17d-5bbd0bc4af76"
    ],
    "entitled_variant_ids": [
      null
    ],
    "prerequisite_quantity_range": [
      {
        "greater_than_or_equal_to": "1",
        "value": "5",
        "target_type": "",
        "target_data": [
          null
        ]
      }
    ],
    "prerequisite_subtotal_range": {}
  }
}
```

```json
{
    "price_rule": {
        "id": "00095d6a-419d-4499-a497-f265fb2edaa5",
        "title": "title-update",
        "value": 0,
        "value_type": "percentage",
        "usage_limit": "-1",
        "times_used": "0",
        "allocation_method": "",
        "allocation_limit": "0",
        "once_per_customer": "1",
        "prerequisite": "1",
        "customer_selection": "all",
        "target_selection": "entitled",
        "target_type": "",
        "created_at": "2020-03-06 17:00:32",
        "updated_at": "2020-03-12 15:29:44",
        "starts_at": "1583424000",
        "ends_at": "1583942399",
        "entitled_product_ids": [
            "cea210d5-a419-4d4e-a17d-5bbd0bc4af76",
            "de2c55f5-c3e1-45e1-92f6-e65faf816ecc",
            "47734e19-1b5c-468b-8695-31159d6d4478"
        ],
        "entitled_variant_ids": [],
        "prerequisite_quantity_range": [
            {
                "greater_than_or_equal_to": "1",
                "value": "5",
                "target_type": "",
                "target_data": []
            }
        ],
        "prerequisite_subtotal_range": null
    }
}
```

404

**application/json**

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

**数据结构**

- `errors` string[]

```json
{
  "errors": [
    "Not found"
  ]
}
```

```json
{
    "errors": [
        "Not found"
    ]
}
```
