---
title: "CodeDiscountSortKeys"
description: "The set of valid sort keys for the CodeDiscount query"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/enums/code-discount-sort-keys'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/enums/code-discount-sort-keys.md'
---
# CodeDiscountSortKeys

The set of valid sort keys for the CodeDiscount query

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

## Type Signature

`CodeDiscountSortKeys`

## Values

* `ENDS_AT`

  Sort by the ends_at value.

* `ID`

  Sort by the id value.

* `RLEVANCE`

  Sort by relevance to the search terms when the query parameter is specified on the connection. Don't use this sort key when no search query is specified.

* `STARTS_AT`

  Sort by the starts_at value.

* `TIMES_USED`

  Sort by the times_used value.

* `TITLE`

  Sort by the title value

* `UPDATED_AT`

  Sort by the updated_at value.

* `CREATED_AT`

  Sort by the created_at value.

## Schema Definition

```graphql
enum CodeDiscountSortKeys { 
	ENDS_AT 
	ID 
	RLEVANCE 
	STARTS_AT 
	TIMES_USED 
	TITLE 
	UPDATED_AT 
	CREATED_AT  
}
```

## Argument from

* [Query](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/queries/code-discount-nodes.md).codeDiscountNodes

  查询代码折扣列表。

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

