**版本：202201**

# 查询所有折扣码列表

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

返回所有折扣码的列表。

## 请求

**Query参数**

- `limit` int32

  Limit per page
- `page` int32

  Page number
- `need_detail_url` boolean

  若为 true，则在响应中返回详情 URL。

## 响应

**200 | 400**

200

**application/json**

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

**数据结构**

- `page` integer

  **默认值：** `0`

  **示例：** `1`
- `limit` integer

  **默认值：** `0`

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

  **示例：** `1`
- `data` object[]

  *   Array [

  - `allocation_limit` string

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

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

    **示例：**
  - `app_id` string

    **示例：**
  - `code` string

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

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

    **示例：** `tzt.myshoplaza.com/promotions/coupon/1783371b-76c1-41ab-a09c-531ff54425fc`
  - `discount_type` string

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

    **示例：** `-1`
  - `entitled_filter_ids` array
  - `entitled_filter_list` array
  - `entitled_product_ids` array
  - `id` string

    **示例：** `1783371b-76c1-41ab-a09c-531ff54425fc`
  - `is_admin_show` string

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

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

    **示例：** `0`
  - `prerequisite_customer_ids` array
  - `prerequisite_customer_segment_ids` array
  - `product_num`
  - `progress` string

    **示例：** `ongoing`
  - `sort` string

    **示例：** `{"by":"title","direction":"asc"}`
  - `starts_at` string

    **示例：** `1682652119`
  - `status` string

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

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

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

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

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

    **示例：** `tzt-优惠码-促进成交`
  - `usage_limit` string

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

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

    **示例：** `normal`
  - `value` integer

    **默认值：** `0`

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

    **示例：** `percentage`
  - `variant_product_ids` array
  *   ]

```json
{
  "page": 1,
  "limit": 20,
  "total": "1",
  "data": [
    {
      "allocation_limit": "1",
      "allocation_limit_amount": "0.0000",
      "allocation_method": "",
      "app_id": "",
      "code": "123234",
      "customer_selection": "all",
      "detail_url": "tzt.myshoplaza.com/promotions/coupon/1783371b-76c1-41ab-a09c-531ff54425fc",
      "discount_type": "percentage",
      "ends_at": "-1",
      "entitled_filter_ids": [
        null
      ],
      "entitled_filter_list": [
        null
      ],
      "entitled_product_ids": [
        null
      ],
      "id": "1783371b-76c1-41ab-a09c-531ff54425fc",
      "is_admin_show": "1",
      "once_per_customer": "1",
      "prerequisite": "0",
      "prerequisite_customer_ids": [
        null
      ],
      "prerequisite_customer_segment_ids": [
        null
      ],
      "product_num": {},
      "progress": "ongoing",
      "sort": "{\"by\":\"title\",\"direction\":\"asc\"}",
      "starts_at": "1682652119",
      "status": "1",
      "target_price_type": "combined_price",
      "target_selection": "all",
      "target_type": "line_item",
      "times_used": "0",
      "title": "tzt-优惠码-促进成交",
      "usage_limit": "1",
      "use_with_other": "0",
      "using_state": "normal",
      "value": 1,
      "value_type": "percentage",
      "variant_product_ids": [
        null
      ]
    }
  ]
}
```

```json
{
  "page": 1,
  "limit": 20,
  "total": "1",
  "data": [
    {
      "allocation_limit": "1",
      "allocation_limit_amount": "0.0000",
      "allocation_method": "",
      "app_id": "",
      "code": "123234",
      "customer_selection": "all",
      "detail_url": "tzt.myshoplaza.com/promotions/coupon/1783371b-76c1-41ab-a09c-531ff54425fc",
      "discount_type": "percentage",
      "ends_at": "-1",
      "entitled_filter_ids": [],
      "entitled_filter_list": [],
      "entitled_product_ids": [],
      "id": "1783371b-76c1-41ab-a09c-531ff54425fc",
      "is_admin_show": "1",
      "once_per_customer": "1",
      "prerequisite": "0",
      "prerequisite_customer_ids": [],
      "prerequisite_customer_segment_ids": [],
      "product_num": null,
      "progress": "ongoing",
      "sort": "{\"by\":\"title\",\"direction\":\"asc\"}",
      "starts_at": "1682652119",
      "status": "1",
      "target_price_type": "combined_price",
      "target_selection": "all",
      "target_type": "line_item",
      "times_used": "0",
      "title": "tzt-优惠码-促进成交",
      "usage_limit": "1",
      "use_with_other": "0",
      "using_state": "normal",
      "value": 1,
      "value_type": "percentage",
      "variant_product_ids": []
    }
  ]
}
```

400

**application/json**

无 Schema
