**Version: 202201**

# Price Rule List

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

Retrieves a list of price rules that can be applied to customer orders.

## Request

**Query Parameters**

- `limit` int32

  Result per page, max: `250`

  **Default value:** `50`
- `starts_at_min` int32

  Filter price rule started after date, timestamp format, e.g. `1581152471`
- `starts_at_max` int32

  Filter price rule started before date, timestamp format, e.g. `1581152471`
- `ends_at_min` int32

  Filter price rule ended before date, timestamp format, e.g. `1581152471`
- `ends_at_max` int32

  Filter price rule ended after date, timestamp format, e.g. `1581152471`
- `times_used` int32

  Used count for this price rule

## Responses

**200**

200

**application/json**

**Schema | Example | Result**

**Schema**

- `price_rules` object[]

  *   Array [

  - `id` string

    **Example:** `91f9a466-7c8c-46e7-9774-64874a641534`
  - `title` string

    **Example:** `Buy $180 get $20 off，once for one customer`
  - `value` integer

    **Default value:** `0`

    **Example:** `20`
  - `value_type` string

    **Example:** `fixed_amount`
  - `usage_limit` string

    **Example:** `-1`
  - `times_used` string

    **Example:** `0`
  - `allocation_method` string

    **Example:**
  - `allocation_limit` string

    **Example:** `0`
  - `once_per_customer` string

    **Example:** `1`
  - `prerequisite` string

    **Example:** `1`
  - `customer_selection` string

    **Example:** `all`
  - `target_selection` string

    **Example:** `all`
  - `target_type` string

    **Example:**
  - `created_at` string

    **Example:** `2022-06-17 15:00:03`
  - `updated_at` string

    **Example:** `2022-06-17 15:00:03`
  - `starts_at` string

    **Example:** `1655431200`
  - `ends_at` string

    **Example:** `-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

      **Example:** `180`
    - `value` string

      **Example:** `20`
    - `value_condition` string

      **Example:** `less_than_or_equal_to`
    - `target_type` string

      **Example:**
    - `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": []
        }
    ]
}
```
