> For the complete documentation index, see [llms.txt](https://knowledgebase.offer18.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.offer18.com/zh/lian-meng-ke/lian-meng-ke-api/you-hui-quan-api.md).

# 优惠券 API

优惠券 API 是一个联属网络 API，用于获取有关优惠券代码的详细信息。

```
GET https://api.offer18.com/api/af/coupon
```

### **通用参数**

<table data-header-hidden><thead><tr><th width="150">路径</th><th width="150"> </th><th> </th></tr></thead><tbody><tr><td><strong>参数</strong></td><td><strong>类型</strong></td><td><strong>描述</strong></td></tr><tr><td>key</td><td>字符串</td><td>API 密钥</td></tr><tr><td>aid</td><td>整数</td><td>联盟 Id</td></tr><tr><td>mid</td><td>整数</td><td>您的广告主 MID</td></tr></tbody></table>

***

### 筛选

<table data-header-hidden><thead><tr><th width="150">查询</th><th width="150"> </th><th width="376.2"> </th></tr></thead><tbody><tr><td><strong>查询</strong></td><td><strong>类型</strong></td><td><strong>描述</strong></td></tr><tr><td>offer_id</td><td>整数</td><td>OfferID (&#x26;offer_id=000,001,002)</td></tr><tr><td>status</td><td>字符串</td><td>已批准, 已过期</td></tr></tbody></table>

{% code overflow="wrap" %}

```
https://api.offer18.com/api/af/coupon?key=000000000&aid=0000&mid=0000&offer_id=0000000&status=approved
```

{% endcode %}

***

### **API 响应**

```json
{
  "status": "200",
  "data": [
    {
      "coupon_code": "coupon1",
      "offer_id": "00011",
      "start_date": "2024-07-02",
      "end_date": "2025-05-29",
      "quota": "22",
      "quota_used": 2,
      "description": "coupon description",
      "status": "Approved"
    },
    {
      "coupon_code": "coupon2",
      "offer_id": "00012",
      "start_date": "2024-07-06",
      "end_date": "2025-01-06",
      "quota": "24",
      "quota_type": "shared",
      "quota_used": 4,
      "description": "coupon description",
      "status": "Expired"
    }
  ]
}
```

{% hint style="info" %}
**共享优惠码 (**&#x71;uota\_type: share&#x64;**)** - 单个优惠券代码由多个推广会员共享。
{% endhint %}
