# 设置指定用户的促销活动限制

在增加或减少次数后设置指定用户在应用的限制内可以使用促销活动的次数。

用户限制API可用于限制用户使用促销活动的次数。如需配置用户限制，请前往所需促销活动类型的“管理”部分：
* 折扣促销活动
* 买赠促销活动

Endpoint: PUT /v2/project/{project_id}/admin/user/limit/promotion/id/{promotion_id}
Version: 2.0.0
Security: basicAuth

## Path parameters:

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

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

## Request fields (application/json):

  - `user` (object, required)

  - `user.user_external_id` (string, required)
    用户外部ID。

  - `available` (integer, required)
    在已应用的限制内，用户还可购买的商品数量或还可使用促销活动的次数。

## Response 200 fields (application/json):

  - `per_user` (object)

  - `per_user.total` (integer)
    用户可以使用促销活动的最大次数。
    Example: 10

  - `per_user.available` (integer)
    用户可以使用促销活动的剩余次数。
    Example: 9

## 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)

  - `transactionId` (string)


