---
title: "codeDiscountNodeByCode"
description: "Retrieve discount information by using a discount code."
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/queries/code-discount-node-by-code'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/queries/code-discount-node-by-code.md'
---
# codeDiscountNodeByCode

Retrieve discount information by using a discount code.

- **Required Scopes:** `read_discounts`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Type Signature

`DiscountCodeNode`

## Required Permissions

* `read_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

* `code`

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

  Discount code

## Returns

* `codeDiscount`

  [DiscountCode](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/unions/discount-code.md)

  The underlying code discount object.
  
  

* `id`

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

  A globally-unique ID.
  
  

## Code Example

```graphql
 {
	codeDiscountNodeByCode(code ) 
		 {
			# DiscountCodeNode fields
		}
}
```

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

