# 更新优惠链

更新指定优惠链。

Endpoint: PUT /v2/project/{project_id}/admin/offer_chain/id/{offer_chain_id}
Version: 2.0.0
Security: basicAuth

## Path parameters:

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

  - `offer_chain_id` (integer, required)
    优惠链ID。
    Example: 101

## Request fields (application/json):

  - `id` (integer)
    优惠链唯一ID。

  - `name` (object,null, required)
    包含商品本地化名称的对象。值接受以下两种格式之一：两个小写字母的语言代码（例如，en）或五个字符的语言代码（例如，en-US）。虽然两种格式都可作为输入接受，但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时（例如：en和en-US），将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。

  - `order` (integer)
    定义排列顺序。

  - `description` (object,null)
    包含本地化商品描述的对象。值接受以下两种格式之一：两个小写字母的语言代码（例如，en）或五个字符的区域设置代码（例如，en-US）。虽然两种格式都可作为输入接受，但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时（例如：en和en-US），将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。

  - `date_start` (string, required)
    优惠链开始日期。

  - `date_end` (string,null)
    优惠链结束日期。可为null，若date_end为null则无时间限制。

  - `is_enabled` (boolean, required)

  - `recurrent_schedule` (any)

  - `steps` (array, required)

  - `steps.step_id` (integer,null)
    链步骤的唯一ID。更新时指定以保留用户进度。

  - `steps.step_number` (integer, required)
    步骤编号。

  - `steps.is_free` (boolean, required)
    是否为免费步骤：如为true，需通过领取免费优惠链步骤调用来领取。如为false，需通过为付费优惠链步骤创建订单调用来购买。

  - `steps.items` (array, required)

  - `steps.items.sku` (string, required)
    唯一商品ID。SKU只能包含大小写英文字母、数字、句点、短横线和下划线。

  - `steps.items.quantity` (integer, required)
    此步骤的奖励品数量。

  - `steps.items.order` (integer,null)
    优惠链步骤奖励顺序。

  - `is_always_visible` (boolean)
    累充奖励链是否对所有用户可见。如果为true，则无论用户的身份认证状态或属性如何，始终显示该链。

如需配置个性化，您需要传入false。累充奖励链的显示逻辑如下：
* 如果传入false，并在attribute_conditions数组中指定可见性条件，则该累充奖励链会被视为个性化累充奖励链，并且仅向符合指定条件的授权用户显示。
* 如果传入false，但未传入attribute_conditions数组或该数组为空，则该累充奖励链会向未授权用户显示；如果未找到与授权用户匹配的累充奖励链，也会显示该链。

  - `attribute_conditions` (array)
    用于验证用户属性的条件。
根据用户属性是否匹配所有指定条件，确定累充奖励链是否可用。

## 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)
    Example: 422

  - `errorCode` (integer)
    Example: 1102

  - `errorMessage` (string)
    Example: "[0401-1102]: Unprocessable Entity. The property `property_name` is required"

  - `transactionId` (string)
    Example: "x-x-x-x-transactionId-mock-x-x-x"

  - `errorMessageExtended` (object,null)

## Response 422 fields (application/json):

  - `statusCode` (integer)
    Example: 422

  - `errorCode` (integer)
    Example: 1102

  - `errorMessage` (string)
    Example: "[0401-1102]: Unprocessable Entity. The property `property_name` is required"

  - `transactionId` (string)
    Example: "x-x-x-x-transactionId-mock-x-x-x"

  - `errorMessageExtended` (object,null)


## Response 204 fields
