Collection Create Payload
Return type for mutation.
Anchor to FieldsFields
- collection (Collection)
- userErrors ([UserError!]!)
- Anchor to collectioncollection•Collection
The collection that has been created.
- Anchor to userErrorsuser•[User
Errors Error!]! non-null The list of errors that occurred from executing the mutation.
Anchor to Mutations with this payloadMutations with this payload
- collectionCreate (CollectionCreatePayload)
- •mutation
Creates a collection to group products together in the online store and other sales channels. For example, an athletics store might create different collections for running attire, shoes, and accessories.
Use the
mutation when you need to:- Create a new collection for a product launch or campaign
- Organize products by category, season, or promotion
- Automate product grouping using conditions (for example, by tag, type, or price)
Collections can include products manually and can also include products automatically based on rules, sources, or conditions.
Defining a collection's membership
Define membership with
sourceson thecollectionargument (). Each source adds products throughconditions(such as product tag, title, or metafield—seefor the full list) and through manualselections.NoteThe
inputargument and itsfield are deprecated. Existing integrations should migrate tocollectionandsources— arule maps to an equivalent sourcecondition(for example, a tag rule becomes acondition). If bothcollectionandinputare provided,collectionis used.Note:The
inputargument and itsfield are deprecated. Existing integrations should migrate tocollectionandsources— arule maps to an equivalent sourcecondition(for example, a tag rule becomes acondition). If bothcollectionandinputare provided,collectionis used.Note: The <code>input</code> argument and its <code><span class="PreventFireFoxApplyingGapToWBR">rule<wbr/>Set</span></code> field are deprecated. Existing integrations should migrate to <code>collection</code> and <code>sources</code> — a <code><span class="PreventFireFoxApplyingGapToWBR">rule<wbr/>Set</span></code> rule maps to an equivalent source <code>condition</code> (for example, a tag rule becomes a <code><span class="PreventFireFoxApplyingGapToWBR">product<wbr/>Tag</span></code> condition). If both <code>collection</code> and <code>input</code> are provided, <code>collection</code> is used.
NoteNote: The created collection is unpublished by default. To make it available to customers, use the <a href="https://shopify.dev/docs/api/admin-graphql/latest/mutations/publishablePublish"><code><span class="PreventFireFoxApplyingGapToWBR">publishable<wbr/>Publish</span></code></a> mutation after creation.
Learn more about using metafields with collection conditions.
- Anchor to collectioncollection•Collection
Create Input The properties and sources to use when creating the collection. Define product membership with
sources(conditions and manual selections) instead of the legacy.- Anchor to inputinput•Collection
Input Deprecated
Arguments