---
title: "customerRewardCreate"
description: "创建一项折扣码客户奖励，并将奖励发放给指定客户。客户奖励会展示在 **会员系统组件** 以及 **个人中心** 各自的奖励模块内。"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/member-system/mutations/customer-reward-create'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/member-system/mutations/customer-reward-create.md'
---
# customerRewardCreate

创建一项折扣码客户奖励，并将奖励发放给指定客户。客户奖励会展示在 **会员系统组件** 以及 **个人中心** 各自的奖励模块内。 

- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Arguments

* `input`

  [CustomerRewardCreateInput](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/member-system/inputs/customer-reward-create-input.md)

  用于创建和发放客户奖励的输入字段。

## Returns

* `userErrors`

  [[UserError!]!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/user-error.md)

  在创建和发放客户奖励的过程中发生的错误的列表。

## Examples

### 创建并发放折扣码客户奖励

创建一项折扣码客户奖励，并将奖励发放给指定客户。客户奖励会展示在 **会员系统组件** 以及 **个人中心** 各自的奖励模块内。 

**Request:**

```json
{
  "input": {
      "buyerIds": [
        "4603752891"
    ],
    "businessId": "********123456",
    "rewardType": "PERCENTAGE_DISCOUNT",
    "benefitsDetails": "50",
    "rewardUsageInstructionType": "MIN_PURCHASE_AMOUNT",
    "rewardUsageInstructionValue": "20",
    "usageLimits": 1,
    "autoStackLimit": "false",
    "codeStackLimit": "false",
    "rewardExpiryTime": "2027-07-06T16:06:18Z"
  }
}
```

**Response:**

```json
{
  "data": {
    "data": {
      "customerRewardCreate": {
        "userErrors": []
      }
    },
    "extensions": {
      "cost": {
        "throttleStatus": {
          "currentlyAvailable": 49988,
          "maximumAvailable": 50000,
          "restoreRate": 50000
        },
        "actualQueryCost": 12,
        "requestedQueryCost": 12
      }
    }
  }
}
```

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes)。

