---
title: "discountRedeemCodeBulkAdd"
description: >
  Asynchronously add discount codes in bulk, specifying the codes to be added and the discount code ID to which they belong.
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/mutations/discount-redeem-code-bulk-add'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/mutations/discount-redeem-code-bulk-add.md'
---
# discountRedeemCodeBulkAdd

Asynchronously add discount codes in bulk, specifying the codes to be added and the discount code ID to which they belong.

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

## Type Signature

`DiscountRedeemCodeBulkAddPayload`

## Required Permissions

* `write_discounts`

An access token is required to call this API. Refer to [Authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md) for more information about how to obtain the token.

## Arguments

* `discountId`

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

  The discount code ID to which the codes will be added.

* `codes`

  [[DiscountRedeemCodeInput]](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/inputs/discount-redeem-code-input.md)

  The list of codes to be added to the discount. A maximum of 100 codes is allowed.

## Returns

* `bulkCreation`

  [DiscountRedeemCodeBulkCreation](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-redeem-code-bulk-creation.md)

  The ID of the discount redeem code bulk creation operation

* `userErrors`

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

  A list of mistakes that happen during mutation execution.

## Code Example

```graphql
mutation discountRedeemCodeBulkAdd($discountId: ID! $codes: [DiscountRedeemCodeInput] ) {
	discountRedeemCodeBulkAdd(discountId: $discountId, codes: $codes ) 
		 {
			# DiscountRedeemCodeBulkAddPayload fields
		}
		
	}

```

## Variables

```json
{
  "codes": {
    "code": {}
  },
  "discountId": {}
}
```

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes).

