# 获取唯一优惠券码限制

获取代码可以使用的剩余次数。要筛选代码，请使用codes查询参数。

要配置代码限制本身，请前往“管理”部分：
 *优惠券

Endpoint: GET /v2/project/{project_id}/admin/code/limit/coupon/external_id/{external_id}
Version: 2.0.0
Security: basicAuth

## Path parameters:

  - `project_id` (integer, required)
    项目ID。您可以在发布商帐户的项目名称旁找到此参数；使用项目时，也可以在浏览器地址栏中找到此参数。URL格式如下：https://publisher.xsolla.com//projects/。
    Example: 44056

  - `external_id` (integer, required)
    促销活动外部ID。项目内的唯一促销活动标识符。
    Example: "coupon_44056_1"

## Query parameters:

  - `codes[]` (array)
    区分大小写的唯一代码。仅包含字母和数字。

  - `limit` (integer)
    页面上元素数量的限制。
    Example: 50

  - `offset` (integer)
    生成列表时作为起始位置的元素编号（从0开始计数）。

## Response 200 fields (application/json):

  - `promotion_id` (integer)
    促销活动ID。项目内的唯一促销活动标识符。

  - `items` (array)

  - `items.code` (string)
    区分大小写的唯一兑换码。包含字母和数字。

  - `items.per_code` (object)

  - `items.per_code.total` (integer)
    兑换码可使用的最大次数。

  - `items.per_code.available` (integer)
    兑换码的剩余可用次数。

  - `items.per_code.used` (integer)
    兑换码被使用的次数。

  - `items.per_code.reserved` (integer)
    兑换码的预留次数。

  - `total_items_count` (number)
    代码总数。

  - `has_more` (boolean)
    如果存在其他含代码的页面。

## Response 401 fields (application/json):

  - `statusCode` (integer)
    Example: 401

  - `errorCode` (integer)
    Example: 1020

  - `errorMessage` (string)
    Example: "[0401-1020]: Error in Authentication method occurred"

## Response 404 fields (application/json):

  - `statusCode` (integer)

  - `errorCode` (integer)

  - `errorMessage` (string)

  - `transactionId` (string)

## Response 422 fields (application/json):

  - `statusCode` (integer)

  - `errorCode` (integer)

  - `errorMessage` (string)

  - `errorMessageExtended` (array)


