You are viewing the v1 Nacelle Docs for existing merchants.New merchants can find the V2 docs here: nacelle.com/docs.

# Collection Data

The Data Ingestion API gives developers the option to send collection data to Nacelle from a custom merchandising solution or product information management system.

To begin exploring this API, please view our Custom Quick Start Guide and our Data Ingestion Reference Docs.

# Viewing the Data Ingestion Collection Docs

Please follow the instructions in the Data Ingestion Reference Docs. Once the proper headers are added to your API Client, you will be able to use GraphQL introspection to browse the Collection object. Furthermore, you will find the requirements for the indexCollection and deleteCollection mutations. The indexCollection mutation is similar to a "create or update" function and is keyed on handle.

# Product Lists

Collections store an array of objects called productLists. Each Collection can have many productList objects and each productList is uniquely identified with the attribute slug. These lists contain an array of Product Handles.

When indexing, Nacelle guarantees the order of the handles array; this means sort orders for the same collection, including personalized orders for different customer segments, can be controlled with Collection productLists.

# Important Reminders

All the Data Ingestion Engine API calls are asynchronous in nature, and successful responses from the mutations sent do not guarantee successful indexing of the objects.

Product mutations require that a pim object is inputted along with your data. A product information management system (PIM) is the source of truth for your product catalog. Pim objects follow this structure:

pim: {
  syncSource: "custom"
  syncSourceDomain: "<put your pim domain here>"
  defaultLocale: "en-us"
}

Note: be sure to replace the "put your pim domain here" with your pim domain

# Example Mutations

This will create a Collection with the handle starship-enterprise-collection. If a Collection with the handle starship-enterprise-collection already exists, Nacelle will update the index with the data provided. This mutation can be run in bulk and, if multiple Collection events are sent to this mutation, Nacelle will index each one.

mutation IndexCollection {
  indexCollections(
    input: {
      pim: {
        syncSource: "shopify"
        syncSourceDomain: "<put your pim domain here>"
        defaultLocale: "en-us"
      }
      collections: [
        {
          handle: "starship-enterprise-collection"
          locale: "en-us"
          pimSyncSourceCollectionId: "xyz987"
          title: "Starship Enterprise Collection"
          description: "Products that you would want to buy if you were traveling on the Starship Enterprise"
          productLists: [
            {
              title: "default"
              slug: "default"
              handles: ["phaser-gun", "food-replicator"]
            }
          ]
        }
      ]
    }
  ) {
    count
    ids
  }
}

If a Collection is deleted, send the following mutation to the Data Ingestion API:

mutation DeleteCollection {
  deleteCollection(
    input: {
      pim: {
        syncSource: "custom"
        syncSourceDomain: "<your pim source domain>"
        defaultLocale: "en-us"
      }
      id: "<your pim source domain>::demo-collection::en-us"
    }
  )
}