---
title: "discountAutomaticActivate"
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/discounts-and-marketing/mutations/discount-automatic-activate'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/mutations/discount-automatic-activate.md'
---
# discountAutomaticActivate

启用自动折扣

- **Required Scopes:** `write_discounts`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Type Signature

`DiscountAutomaticActivatePayload`

## Required Permissions

* `write_discounts`

接口访问需要令牌，具体如何获取令牌请参考：[身份认证](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md)

## Arguments

* `id`

  [ID!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/id.md)

  要启用的自动折扣的 ID

## Returns

* `automaticDiscountNode`

  [DiscountAutomaticNode](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-automatic-node.md)

  激活的自动折扣

* `userErrors`

  [[DiscountUserError]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-user-error.md)

  执行突变时发生的错误列表

## Code Example

```graphql
mutation discountAutomaticActivate($id: ID! ) {
	discountAutomaticActivate(id: $id ) 
		 {
			# DiscountAutomaticActivatePayload fields
		}
		
	}

```

## Variables

```json
{
  "id": {}
}
```

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

