**版本：202201**

# 查询价格规则列表

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

返回可应用于客户订单的价格规则列表。

## 请求

**Query参数**

- `limit` int32

  Result per page, max: `250`

  **默认值：** `50`
- `starts_at_min` int32

  过滤此时间之后开始的价格规则（Unix 时间）。
- `starts_at_max` int32

  过滤此时间之前开始的价格规则（Unix 时间）。
- `ends_at_min` int32

  过滤此时间之后结束的价格规则（Unix 时间）。
- `ends_at_max` int32

  过滤此时间之前结束的价格规则（Unix 时间）。
- `times_used` int32

  按使用次数过滤价格规则。

## 响应

**200**

200

**application/json**

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

**数据结构**

- `price_rules` object[]

  *   Array [

  - `id` string

    **示例：** `91f9a466-7c8c-46e7-9774-64874a641534`
  - `title` string

    **示例：** `Buy $180 get $20 off，once for one customer`
  - `value` integer

    **默认值：** `0`

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

    **示例：** `fixed_amount`
  - `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

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

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

    **示例：** `2022-06-17 15:00:03`
  - `updated_at` string

    **示例：** `2022-06-17 15:00:03`
  - `starts_at` string

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

    **示例：** `-1`
  - `entitled_product_ids` array
  - `entitled_filter_ids` array
  - `entitled_filter_list` array
  - `variant_product_ids` array
  - `prerequisite_subtotal_range` object[]

    *   Array [

    - `greater_than_or_equal_to` string

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

      **示例：** `20`
    - `value_condition` string

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

      **示例：**
    - `target_data` array
    - `target_data_variant` array
    - `target_data_collection` array
    *   ]
  - `prerequisite_quantity_range`
  *   ]

```json
{
  "price_rules": [
    {
      "id": "91f9a466-7c8c-46e7-9774-64874a641534",
      "title": "Buy $180 get $20 off，once for one customer",
      "value": 20,
      "value_type": "fixed_amount",
      "usage_limit": "-1",
      "times_used": "0",
      "allocation_method": "",
      "allocation_limit": "0",
      "once_per_customer": "1",
      "prerequisite": "1",
      "customer_selection": "all",
      "target_selection": "all",
      "target_type": "",
      "created_at": "2022-06-17 15:00:03",
      "updated_at": "2022-06-17 15:00:03",
      "starts_at": "1655431200",
      "ends_at": "-1",
      "entitled_product_ids": [
        null
      ],
      "entitled_filter_ids": [
        null
      ],
      "entitled_filter_list": [
        null
      ],
      "variant_product_ids": [
        null
      ],
      "prerequisite_subtotal_range": [
        {
          "greater_than_or_equal_to": "180",
          "value": "20",
          "value_condition": "less_than_or_equal_to",
          "target_type": "",
          "target_data": [
            null
          ],
          "target_data_variant": [
            null
          ],
          "target_data_collection": [
            null
          ]
        }
      ],
      "prerequisite_quantity_range": {}
    }
  ]
}
```

```json
{
    "price_rules": [
        {
            "id": "91f9a466-7c8c-46e7-9774-64874a641534",
            "title": "Buy $180 get $20 off，once for one customer",
            "value": 20,
            "value_type": "fixed_amount",
            "usage_limit": "-1",
            "times_used": "0",
            "allocation_method": "",
            "allocation_limit": "0",
            "once_per_customer": "1",
            "prerequisite": "1",
            "customer_selection": "all",
            "target_selection": "all",
            "target_type": "",
            "created_at": "2022-06-17 15:00:03",
            "updated_at": "2022-06-17 15:00:03",
            "starts_at": "1655431200",
            "ends_at": "-1",
            "entitled_product_ids": [],
            "entitled_filter_ids": [],
            "entitled_filter_list": [],
            "variant_product_ids": [],
            "prerequisite_subtotal_range": [
                {
                    "greater_than_or_equal_to": "180",
                    "value": "20",
                    "value_condition": "less_than_or_equal_to",
                    "target_type": "",
                    "target_data": [],
                    "target_data_variant": [],
                    "target_data_collection": []
                }
            ],
            "prerequisite_quantity_range": null
        },
        {
            "id": "b2bc789e-4f27-4dac-8a9e-7eab140a7281",
            "title": "$20 off for all products, no conditions, used up to 100 times",
            "value": 20,
            "value_type": "fixed_amount",
            "usage_limit": "100",
            "times_used": "0",
            "allocation_method": "",
            "allocation_limit": "0",
            "once_per_customer": "0",
            "prerequisite": "0",
            "customer_selection": "all",
            "target_selection": "all",
            "target_type": "",
            "created_at": "2022-06-17 15:00:02",
            "updated_at": "2022-06-17 15:00:02",
            "starts_at": "1655431200",
            "ends_at": "-1",
            "entitled_product_ids": [],
            "entitled_filter_ids": [],
            "entitled_filter_list": [],
            "variant_product_ids": []
        }
    ]
}
```
