Focusing on managing products, variants, and collections through the API.
Hi there,
I recently created a bundled product
https://maxim-khanate.myshopify.com/admin/products/6766421901376
When I look at it with the admin REST API
Solved! Go to the solution
This is an accepted solution.
Hi @sengming
If the app that created the bundle didn't add any metafieds then that it may have been setup as a fixed bundle through GraphQL.
In that case I don't see any option to identify variants or their bundled components from the REST Admin API, but you could always use the GraphQL Admin API to verify a productVariant with a request like this:
query bundledVariant($id: ID!) {
node(id: $id) {
... on ProductVariant {
id
requiresComponents
productVariantComponents(first: 3) {
nodes {
id
quantity
}
}
}
}
}
Hope that helps!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi @sengming,
The REST Admin API doesn't expose a requiresComponents field on the productVariant object like the GraphQL Admin API, but our guide on how to model a bundle says:
"You model a bundle by creating metafields on variants, creating a bundle parent product variant, and defining the bundle on child product variants."
Have you checked for any metafields associated with your product's variants?
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
there are no metafileds associated with the variants (see request and response below). Do you have any other suggestions?
```
--> 200 OK 17 (162.5ms)
[]
```
This is an accepted solution.
Hi @sengming
If the app that created the bundle didn't add any metafieds then that it may have been setup as a fixed bundle through GraphQL.
In that case I don't see any option to identify variants or their bundled components from the REST Admin API, but you could always use the GraphQL Admin API to verify a productVariant with a request like this:
query bundledVariant($id: ID!) {
node(id: $id) {
... on ProductVariant {
id
requiresComponents
productVariantComponents(first: 3) {
nodes {
id
quantity
}
}
}
}
}
Hope that helps!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thanks!
Just for the record, I used the official Shopify Bundles app to create the bundles https://apps.shopify.com/shopify-bundles
hello, We use graphQL ,and get the response like the following json:, so how to get the detail of nodes.id.... it isn't the original variant id of product
"node": {
"id": "gid://shopify/ProductVariant/4xxxx",
"requiresComponents": true,
"productVariantComponents": {
"nodes": [
{
"id": "gid://shopify/ProductVariantComponent/2326xxx",
"quantity": 1
},
{
"id": "gid://shopify/ProductVariantComponent/2329xxx",
"quantity": 1
}
]
}
}by