> 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-huo-ban/lian-meng-huo-ban-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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://knowledgebase.offer18.com/zh/lian-meng-huo-ban/lian-meng-huo-ban-api/you-hui-quan-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
