# 创建优惠链 创建优惠链。 Endpoint: POST /v2/project/{project_id}/admin/offer_chain Version: 2.0.0 Security: basicAuth ## Path parameters: - `project_id` (integer, required) 项目ID。您可以在您的发布商帐户项目名称旁边找到。 Example: 44056 ## Request fields (application/json): - `attribute_conditions` (array) 用户属性验证条件。 根据用户属性是否满足所有指定条件来确定优惠链可用性。 - `date_end` (string,null) 优惠链结束日期。可为null,若date_end为null则无时间限制。 Example: "2020-04-15T18:16:00+05:00" - `date_start` (string, required) 优惠链开始日期。 Example: "2020-04-15T18:16:00+05:00" - `description` (object,null) 包含本地化商品描述的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的区域设置代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:en和en-US),将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。 - `is_always_visible` (boolean) 优惠链是否对所有用户可见: * 如为true,则无论用户的认证状态或属性如何,优惠链始终显示。 * 如为false,则仅在未找到个性化优惠链时才显示该优惠链。例如,当用户未认证或其属性与任何个性化优惠链都不匹配时。 仅适用于存在个性化奖励链的前提,并在未传递attribute_conditions数组时使用。 Example: true - `is_enabled` (boolean, required) Example: true - `name` (object,null, required) 包含商品本地化名称的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的语言代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:en和en-US),将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。 - `order` (integer) 定义排列顺序。 Example: 1 - `recurrent_schedule` (object,null) 优惠链的重置周期。 - `steps` (array, required) - `steps.is_free` (boolean, required) 是否为免费步骤:如为true,需通过领取免费优惠链步骤调用来领取。如为false,需通过为付费优惠链步骤创建订单调用来购买。 - `steps.items` (array, required) - `steps.items.order` (integer,null) 优惠链步骤奖励顺序。 - `steps.items.quantity` (integer, required) 此步骤的奖励品数量。 - `steps.items.sku` (string, required) 唯一商品ID。 SKU只能包含大小写英文字母和数字字符、句点、破折号和下划线。 Example: "booster_mega_1" - `steps.step_number` (integer, required) 步骤编号。 Example: 2 ## Response 201 fields (application/json): - `offer_chain_id` (integer) Example: 10 ## Response 401 fields (application/json): - `errorCode` (integer) Example: 1020 - `errorMessage` (string) Example: "[0401-1020]: Error in Authentication method occurred" - `statusCode` (integer) Example: 401 ## Response 422 fields (application/json): - `errorCode` (integer) Example: 1102 - `errorMessage` (string) Example: "[0401-1102]: Unprocessable Entity. The property `property_name` is required" - `errorMessageExtended` (object,null) - `statusCode` (integer) Example: 422 - `transactionId` (string) Example: "x-x-x-x-transactionId-mock-x-x-x"