---
title: "CollectionInput"
description: "Input fields that are required to complete a collection's creation."
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/inputs/collection-input'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/inputs/collection-input.md'
---
# CollectionInput

Input fields that are required to complete a collection's creation.

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

## Type Signature

`CollectionInput`

## Input Fields

* `redirectNewHandle`

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

  Represents whether a redirect is needed after providing a new handle. If true, the old handle will automatically redirect to the new handle.
  
  The default value is false.

* `banner`

  [ImageInput](https://developer.shopline.com/docs/admin-graph-ql-api/common-objects/inputs/image-input.md)

  The banner related to the collection.

* `products`

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

  The initial list of products in the collection. Only applicable for collectionCreate and without smart collection rules.

* `id`

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

  Specify the collection to update, or create a new one if it does not exist. Required for updating the collection.

* `sortOrder`

  [CollectionSortOrder](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/enums/collection-sort-order.md)

  The sorting of products in the collection.

* `descriptionHtml`

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

  The collection description.

* `image`

  [ImageInput](https://developer.shopline.com/docs/admin-graph-ql-api/common-objects/inputs/image-input.md)

  The image related to the collection.

* `ruleSet`

  [CollectionRuleSetInput](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/inputs/collection-rule-set-input.md)

  The rules for assigning products to collections.

* `handle`

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

  A unique, user-friendly string for the collection, automatically generated based on the collection title.

* `title`

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

  The collection title, required when creating a collection.

* `templateSuffix`

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

  The template of the theme used for viewing the collection in the store.

## Schema Definition

```graphql
input CollectionInput { 
	redirectNewHandle: Boolean
	banner: ImageInput
	products: [ID]
	id: ID
	sortOrder: CollectionSortOrder
	descriptionHtml: String
	image: ImageInput
	ruleSet: CollectionRuleSetInput
	handle: String
	title: String!
	templateSuffix: String 
}
```

## Argument from

* [Mutation](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/mutations/collection-create.md).collectionCreate

  创建一个新分类

* [Mutation](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/mutations/collection-update.md).collectionUpdate

  更新分类

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

