Skip to main content
mutation

Requires write_batches access scope.

Adds items to the most recent open or in-progress batch with the given name. An item goes to a different batch with the same name when that batch is full or when the batch workflow's steps don't allow the item in that batch alongside the items it already has. A full batch's overflow goes to a new batch with the same name, never an older one. Concurrent requests with the same name don't create duplicate batches.

Supports an optional idempotency key using the @idempotent directive. For more information, see the idempotency documentation.

•[ID!]

The items to add. If omitted or null, the matching batch is returned, or an empty batch with the given name is created if none exists. An empty list returns a NO_ITEMS error.

•String!
required

The name of the batch to add items to. A batch with this name is created if no eligible batch with the name exists.

•ID

The batch workflow to match. If set, only batches that use it are matched. If omitted, matching batches can use any batch workflow, and new batches use the shop's default batch workflow, which is created if it doesn't exist.


Was this section helpful?

Anchor to BatchAddItemsByNamePayload returnsBatchAddItemsByNamePayload returns

•[Batch!]

The batches that received items, in the order they were created. If no items were given, the matching batch.

Show fields
•[BatchItemRejection!]

Items that weren't added to any batch, grouped by rejection reason.

Show fields
•[Batch!]

The batches that this request created. A subset of batches.

Show fields
•[BatchAddItemsByNameUserError!]!
non-null

The list of errors that occurred from executing the mutation.

Show fields

Was this section helpful?