Add child products to a combined listing
Description
Group separate products under a combined listing parent product so that they're sold as a single
listing. Use `productsAdded` to attach each child product and the parent
option values that it represents, and `optionsAndValues` to set the parent's options and the
order of their values. This example adds a blue and a red child product, both in size 12, to a
parent product that has only a default variant. Learn more about
[building for combined listings](https://shopify.dev/docs/apps/build/product-merchandising/combined-listings/build-for-combined-listings).
Query
mutation AddChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}
Variables
{
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Blue"
},
{
"name": "size",
"value": "12"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Red"
},
{
"name": "size",
"value": "12"
}
]
}
],
"optionsAndValues": [
{
"name": "color",
"values": [
"Blue",
"Red"
]
},
{
"name": "size",
"values": [
"12"
]
}
]
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation AddChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) { combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) { product { id combinedListing { combinedListingChildren(first: 10) { nodes { product { id } parentVariant { selectedOptions { value } } } } } } userErrors { code field message } } }",
"variables": {
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Blue"
},
{
"name": "size",
"value": "12"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Red"
},
{
"name": "size",
"value": "12"
}
]
}
],
"optionsAndValues": [
{
"name": "color",
"values": [
"Blue",
"Red"
]
},
{
"name": "size",
"values": [
"12"
]
}
]
}
}'
React Router
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation AddChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}`,
{
variables: {
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Blue"
},
{
"name": "size",
"value": "12"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Red"
},
{
"name": "size",
"value": "12"
}
]
}
],
"optionsAndValues": [
{
"name": "color",
"values": [
"Blue",
"Red"
]
},
{
"name": "size",
"values": [
"12"
]
}
]
},
},
);
const json = await response.json();
return json.data;
}
Ruby
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation AddChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}
QUERY
variables = {
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Blue"
},
{
"name": "size",
"value": "12"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Red"
},
{
"name": "size",
"value": "12"
}
]
}
],
"optionsAndValues": [
{
"name": "color",
"values": [
"Blue",
"Red"
]
},
{
"name": "size",
"values": [
"12"
]
}
]
}
response = client.query(query: query, variables: variables)
Node.js
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation AddChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}`,
"variables": {
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Blue"
},
{
"name": "size",
"value": "12"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Red"
},
{
"name": "size",
"value": "12"
}
]
}
],
"optionsAndValues": [
{
"name": "color",
"values": [
"Blue",
"Red"
]
},
{
"name": "size",
"values": [
"12"
]
}
]
},
},
});
Shopify CLI
shopify app execute \
--query \
'mutation AddChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}' \
--variables \
'{
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Blue"
},
{
"name": "size",
"value": "12"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Red"
},
{
"name": "size",
"value": "12"
}
]
}
],
"optionsAndValues": [
{
"name": "color",
"values": [
"Blue",
"Red"
]
},
{
"name": "size",
"values": [
"12"
]
}
]
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
method: 'POST',
body: JSON.stringify({
query: `
mutation AddChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}
`,
variables: {
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Blue"
},
{
"name": "size",
"value": "12"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "color",
"value": "Red"
},
{
"name": "size",
"value": "12"
}
]
}
],
"optionsAndValues": [
{
"name": "color",
"values": [
"Blue",
"Red"
]
},
{
"name": "size",
"values": [
"12"
]
}
]
},
}),
});
const { data } = await response.json();
console.log(data);
Response
{
"combinedListingUpdate": {
"product": {
"id": "gid://shopify/Product/108828309",
"combinedListing": {
"combinedListingChildren": {
"nodes": [
{
"product": {
"id": "gid://shopify/Product/121709582"
},
"parentVariant": {
"selectedOptions": [
{
"value": "Blue"
},
{
"value": "12"
}
]
}
},
{
"product": {
"id": "gid://shopify/Product/912855135"
},
"parentVariant": {
"selectedOptions": [
{
"value": "Red"
},
{
"value": "12"
}
]
}
}
]
}
}
},
"userErrors": []
}
}
Add child products with options associated with a metafield to a combined listing
Description
Add child products to a combined listing whose Color option is linked to the
`shopify.color-pattern` category metafield, so that each color value refers to a
`shopify--color-pattern` metaobject. In `optionsAndValues`, pass the metafield's `namespace` and `key`
in `linkedMetafield`, with the metaobject IDs in the same order as the option's values. In
`selectedParentOptionValues`, give each child product a `linkedMetafieldValue` for the linked
option that's one of those metaobject IDs. Options that aren't linked, such as Size here, take a
plain value. The parent product needs a product category to use linked metafield options. Learn
more about
[building for combined listings](https://shopify.dev/docs/apps/build/product-merchandising/combined-listings/build-for-combined-listings).
Query
mutation AddLinkedOptionChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
options {
name
linkedMetafield {
namespace
key
}
optionValues {
name
linkedMetafieldValue
}
}
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
name
value
optionValue {
linkedMetafieldValue
}
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}
Variables
{
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Blue",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842291"
},
{
"name": "Size",
"value": "M"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Red",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842292"
},
{
"name": "Size",
"value": "M"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"Blue",
"Red"
],
"linkedMetafield": {
"namespace": "shopify",
"key": "color-pattern",
"values": [
"gid://shopify/Metaobject/1059842291",
"gid://shopify/Metaobject/1059842292"
]
}
},
{
"name": "Size",
"values": [
"M"
]
}
]
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation AddLinkedOptionChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) { combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) { product { id options { name linkedMetafield { namespace key } optionValues { name linkedMetafieldValue } } combinedListing { combinedListingChildren(first: 10) { nodes { product { id } parentVariant { selectedOptions { name value optionValue { linkedMetafieldValue } } } } } } } userErrors { code field message } } }",
"variables": {
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Blue",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842291"
},
{
"name": "Size",
"value": "M"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Red",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842292"
},
{
"name": "Size",
"value": "M"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"Blue",
"Red"
],
"linkedMetafield": {
"namespace": "shopify",
"key": "color-pattern",
"values": [
"gid://shopify/Metaobject/1059842291",
"gid://shopify/Metaobject/1059842292"
]
}
},
{
"name": "Size",
"values": [
"M"
]
}
]
}
}'
React Router
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation AddLinkedOptionChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
options {
name
linkedMetafield {
namespace
key
}
optionValues {
name
linkedMetafieldValue
}
}
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
name
value
optionValue {
linkedMetafieldValue
}
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}`,
{
variables: {
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Blue",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842291"
},
{
"name": "Size",
"value": "M"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Red",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842292"
},
{
"name": "Size",
"value": "M"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"Blue",
"Red"
],
"linkedMetafield": {
"namespace": "shopify",
"key": "color-pattern",
"values": [
"gid://shopify/Metaobject/1059842291",
"gid://shopify/Metaobject/1059842292"
]
}
},
{
"name": "Size",
"values": [
"M"
]
}
]
},
},
);
const json = await response.json();
return json.data;
}
Ruby
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation AddLinkedOptionChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
options {
name
linkedMetafield {
namespace
key
}
optionValues {
name
linkedMetafieldValue
}
}
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
name
value
optionValue {
linkedMetafieldValue
}
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}
QUERY
variables = {
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Blue",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842291"
},
{
"name": "Size",
"value": "M"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Red",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842292"
},
{
"name": "Size",
"value": "M"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"Blue",
"Red"
],
"linkedMetafield": {
"namespace": "shopify",
"key": "color-pattern",
"values": [
"gid://shopify/Metaobject/1059842291",
"gid://shopify/Metaobject/1059842292"
]
}
},
{
"name": "Size",
"values": [
"M"
]
}
]
}
response = client.query(query: query, variables: variables)
Node.js
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation AddLinkedOptionChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
options {
name
linkedMetafield {
namespace
key
}
optionValues {
name
linkedMetafieldValue
}
}
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
name
value
optionValue {
linkedMetafieldValue
}
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}`,
"variables": {
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Blue",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842291"
},
{
"name": "Size",
"value": "M"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Red",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842292"
},
{
"name": "Size",
"value": "M"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"Blue",
"Red"
],
"linkedMetafield": {
"namespace": "shopify",
"key": "color-pattern",
"values": [
"gid://shopify/Metaobject/1059842291",
"gid://shopify/Metaobject/1059842292"
]
}
},
{
"name": "Size",
"values": [
"M"
]
}
]
},
},
});
Shopify CLI
shopify app execute \
--query \
'mutation AddLinkedOptionChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
options {
name
linkedMetafield {
namespace
key
}
optionValues {
name
linkedMetafieldValue
}
}
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
name
value
optionValue {
linkedMetafieldValue
}
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}' \
--variables \
'{
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Blue",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842291"
},
{
"name": "Size",
"value": "M"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Red",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842292"
},
{
"name": "Size",
"value": "M"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"Blue",
"Red"
],
"linkedMetafield": {
"namespace": "shopify",
"key": "color-pattern",
"values": [
"gid://shopify/Metaobject/1059842291",
"gid://shopify/Metaobject/1059842292"
]
}
},
{
"name": "Size",
"values": [
"M"
]
}
]
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
method: 'POST',
body: JSON.stringify({
query: `
mutation AddLinkedOptionChildProductsToCombinedListing($parentProductId: ID!, $productsAdded: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsAdded: $productsAdded, optionsAndValues: $optionsAndValues) {
product {
id
options {
name
linkedMetafield {
namespace
key
}
optionValues {
name
linkedMetafieldValue
}
}
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
name
value
optionValue {
linkedMetafieldValue
}
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}
`,
variables: {
"parentProductId": "gid://shopify/Product/108828309",
"productsAdded": [
{
"childProductId": "gid://shopify/Product/121709582",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Blue",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842291"
},
{
"name": "Size",
"value": "M"
}
]
},
{
"childProductId": "gid://shopify/Product/912855135",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "Red",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842292"
},
{
"name": "Size",
"value": "M"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"Blue",
"Red"
],
"linkedMetafield": {
"namespace": "shopify",
"key": "color-pattern",
"values": [
"gid://shopify/Metaobject/1059842291",
"gid://shopify/Metaobject/1059842292"
]
}
},
{
"name": "Size",
"values": [
"M"
]
}
]
},
}),
});
const { data } = await response.json();
console.log(data);
Response
{
"combinedListingUpdate": {
"product": {
"id": "gid://shopify/Product/108828309",
"options": [
{
"name": "Color",
"linkedMetafield": {
"namespace": "shopify",
"key": "color-pattern"
},
"optionValues": [
{
"name": "Blue",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842291"
},
{
"name": "Red",
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842292"
}
]
},
{
"name": "Size",
"linkedMetafield": null,
"optionValues": [
{
"name": "M",
"linkedMetafieldValue": null
}
]
}
],
"combinedListing": {
"combinedListingChildren": {
"nodes": [
{
"product": {
"id": "gid://shopify/Product/121709582"
},
"parentVariant": {
"selectedOptions": [
{
"name": "Color",
"value": "Blue",
"optionValue": {
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842291"
}
},
{
"name": "Size",
"value": "M",
"optionValue": {
"linkedMetafieldValue": null
}
}
]
}
},
{
"product": {
"id": "gid://shopify/Product/912855135"
},
"parentVariant": {
"selectedOptions": [
{
"name": "Color",
"value": "Red",
"optionValue": {
"linkedMetafieldValue": "gid://shopify/Metaobject/1059842292"
}
},
{
"name": "Size",
"value": "M",
"optionValue": {
"linkedMetafieldValue": null
}
}
]
}
}
]
}
}
},
"userErrors": []
}
}
Remove child products from a combined listing
Description
Take a child product out of a combined listing, for example when the merchant discontinues that
color. Pass the child product's ID in `productsRemovedIds`. The mutation removes the product from
the combined listing but doesn't delete the product, and the response lists the child products
that remain in the listing.
Query
mutation RemoveChildProductsFromCombinedListing($parentProductId: ID!, $productsRemovedIds: [ID!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsRemovedIds: $productsRemovedIds) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
}
}
}
}
userErrors {
code
field
message
}
}
}
Variables
{
"parentProductId": "gid://shopify/Product/362339553",
"productsRemovedIds": [
"gid://shopify/Product/223392616"
]
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation RemoveChildProductsFromCombinedListing($parentProductId: ID!, $productsRemovedIds: [ID!]) { combinedListingUpdate(parentProductId: $parentProductId, productsRemovedIds: $productsRemovedIds) { product { id combinedListing { combinedListingChildren(first: 10) { nodes { product { id } } } } } userErrors { code field message } } }",
"variables": {
"parentProductId": "gid://shopify/Product/362339553",
"productsRemovedIds": [
"gid://shopify/Product/223392616"
]
}
}'
React Router
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation RemoveChildProductsFromCombinedListing($parentProductId: ID!, $productsRemovedIds: [ID!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsRemovedIds: $productsRemovedIds) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
}
}
}
}
userErrors {
code
field
message
}
}
}`,
{
variables: {
"parentProductId": "gid://shopify/Product/362339553",
"productsRemovedIds": [
"gid://shopify/Product/223392616"
]
},
},
);
const json = await response.json();
return json.data;
}
Ruby
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation RemoveChildProductsFromCombinedListing($parentProductId: ID!, $productsRemovedIds: [ID!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsRemovedIds: $productsRemovedIds) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
}
}
}
}
userErrors {
code
field
message
}
}
}
QUERY
variables = {
"parentProductId": "gid://shopify/Product/362339553",
"productsRemovedIds": [
"gid://shopify/Product/223392616"
]
}
response = client.query(query: query, variables: variables)
Node.js
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation RemoveChildProductsFromCombinedListing($parentProductId: ID!, $productsRemovedIds: [ID!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsRemovedIds: $productsRemovedIds) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
}
}
}
}
userErrors {
code
field
message
}
}
}`,
"variables": {
"parentProductId": "gid://shopify/Product/362339553",
"productsRemovedIds": [
"gid://shopify/Product/223392616"
]
},
},
});
Shopify CLI
shopify app execute \
--query \
'mutation RemoveChildProductsFromCombinedListing($parentProductId: ID!, $productsRemovedIds: [ID!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsRemovedIds: $productsRemovedIds) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
}
}
}
}
userErrors {
code
field
message
}
}
}' \
--variables \
'{
"parentProductId": "gid://shopify/Product/362339553",
"productsRemovedIds": [
"gid://shopify/Product/223392616"
]
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
method: 'POST',
body: JSON.stringify({
query: `
mutation RemoveChildProductsFromCombinedListing($parentProductId: ID!, $productsRemovedIds: [ID!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsRemovedIds: $productsRemovedIds) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
}
}
}
}
userErrors {
code
field
message
}
}
}
`,
variables: {
"parentProductId": "gid://shopify/Product/362339553",
"productsRemovedIds": [
"gid://shopify/Product/223392616"
]
},
}),
});
const { data } = await response.json();
console.log(data);
Response
{
"combinedListingUpdate": {
"product": {
"id": "gid://shopify/Product/362339553",
"combinedListing": {
"combinedListingChildren": {
"nodes": [
{
"product": {
"id": "gid://shopify/Product/555575834"
}
}
]
}
}
},
"userErrors": []
}
}
Update option values of combined listing child product
Description
Change which parent option values child products represent, for example to correct two child
products that were assigned each other's colors. Use `productsEdited` to give each child product
its new `selectedParentOptionValues`, and `optionsAndValues` to list the option's values in the
order to show them. Passing the existing option's `optionId` updates that option instead of
creating a new one.
Query
mutation UpdateChildProductsOfCombinedListing($parentProductId: ID!, $productsEdited: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsEdited: $productsEdited, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}
Variables
{
"parentProductId": "gid://shopify/Product/362339553",
"productsEdited": [
{
"childProductId": "gid://shopify/Product/223392616",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "green"
}
]
},
{
"childProductId": "gid://shopify/Product/555575834",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "blue"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"blue",
"green"
],
"optionId": "gid://shopify/ProductOption/863720033"
}
]
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation UpdateChildProductsOfCombinedListing($parentProductId: ID!, $productsEdited: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) { combinedListingUpdate(parentProductId: $parentProductId, productsEdited: $productsEdited, optionsAndValues: $optionsAndValues) { product { id combinedListing { combinedListingChildren(first: 10) { nodes { product { id } parentVariant { selectedOptions { value } } } } } } userErrors { code field message } } }",
"variables": {
"parentProductId": "gid://shopify/Product/362339553",
"productsEdited": [
{
"childProductId": "gid://shopify/Product/223392616",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "green"
}
]
},
{
"childProductId": "gid://shopify/Product/555575834",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "blue"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"blue",
"green"
],
"optionId": "gid://shopify/ProductOption/863720033"
}
]
}
}'
React Router
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation UpdateChildProductsOfCombinedListing($parentProductId: ID!, $productsEdited: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsEdited: $productsEdited, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}`,
{
variables: {
"parentProductId": "gid://shopify/Product/362339553",
"productsEdited": [
{
"childProductId": "gid://shopify/Product/223392616",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "green"
}
]
},
{
"childProductId": "gid://shopify/Product/555575834",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "blue"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"blue",
"green"
],
"optionId": "gid://shopify/ProductOption/863720033"
}
]
},
},
);
const json = await response.json();
return json.data;
}
Ruby
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation UpdateChildProductsOfCombinedListing($parentProductId: ID!, $productsEdited: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsEdited: $productsEdited, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}
QUERY
variables = {
"parentProductId": "gid://shopify/Product/362339553",
"productsEdited": [
{
"childProductId": "gid://shopify/Product/223392616",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "green"
}
]
},
{
"childProductId": "gid://shopify/Product/555575834",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "blue"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"blue",
"green"
],
"optionId": "gid://shopify/ProductOption/863720033"
}
]
}
response = client.query(query: query, variables: variables)
Node.js
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation UpdateChildProductsOfCombinedListing($parentProductId: ID!, $productsEdited: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsEdited: $productsEdited, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}`,
"variables": {
"parentProductId": "gid://shopify/Product/362339553",
"productsEdited": [
{
"childProductId": "gid://shopify/Product/223392616",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "green"
}
]
},
{
"childProductId": "gid://shopify/Product/555575834",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "blue"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"blue",
"green"
],
"optionId": "gid://shopify/ProductOption/863720033"
}
]
},
},
});
Shopify CLI
shopify app execute \
--query \
'mutation UpdateChildProductsOfCombinedListing($parentProductId: ID!, $productsEdited: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsEdited: $productsEdited, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}' \
--variables \
'{
"parentProductId": "gid://shopify/Product/362339553",
"productsEdited": [
{
"childProductId": "gid://shopify/Product/223392616",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "green"
}
]
},
{
"childProductId": "gid://shopify/Product/555575834",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "blue"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"blue",
"green"
],
"optionId": "gid://shopify/ProductOption/863720033"
}
]
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
method: 'POST',
body: JSON.stringify({
query: `
mutation UpdateChildProductsOfCombinedListing($parentProductId: ID!, $productsEdited: [ChildProductRelationInput!], $optionsAndValues: [OptionAndValueInput!]) {
combinedListingUpdate(parentProductId: $parentProductId, productsEdited: $productsEdited, optionsAndValues: $optionsAndValues) {
product {
id
combinedListing {
combinedListingChildren(first: 10) {
nodes {
product {
id
}
parentVariant {
selectedOptions {
value
}
}
}
}
}
}
userErrors {
code
field
message
}
}
}
`,
variables: {
"parentProductId": "gid://shopify/Product/362339553",
"productsEdited": [
{
"childProductId": "gid://shopify/Product/223392616",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "green"
}
]
},
{
"childProductId": "gid://shopify/Product/555575834",
"selectedParentOptionValues": [
{
"name": "Color",
"value": "blue"
}
]
}
],
"optionsAndValues": [
{
"name": "Color",
"values": [
"blue",
"green"
],
"optionId": "gid://shopify/ProductOption/863720033"
}
]
},
}),
});
const { data } = await response.json();
console.log(data);
Response
{
"combinedListingUpdate": {
"product": {
"id": "gid://shopify/Product/362339553",
"combinedListing": {
"combinedListingChildren": {
"nodes": [
{
"product": {
"id": "gid://shopify/Product/223392616"
},
"parentVariant": {
"selectedOptions": [
{
"value": "green"
}
]
}
},
{
"product": {
"id": "gid://shopify/Product/555575834"
},
"parentVariant": {
"selectedOptions": [
{
"value": "blue"
}
]
}
}
]
}
}
},
"userErrors": []
}
}