Auto generate variants options with API #419
-
Hello, Currently, via the admin interface, you can automatically generate variants based on the options you have configured: Is it possible to have the same behavior via the API? I try const res = await swellnode.post('/products', {
name: 'Bûches de bois' + r,
// price: 99.0,
active: true,
variable: true,
slug: 'buches-de-bois' + r,
content: { organization: '280', agency: '254' },
options: [
{
name: 'Size',
values: [
{
name: '25 cm',
},
{
name: '33 cm',
},
{
name: '50 cm',
},
],
},
],
}); An idea ? thanks for the help |
Beta Was this translation helpful? Give feedback.
Answered by
logeshswell
Jan 2, 2024
Replies: 1 comment
-
variable: true might not help but passing variant: true might help
Also, did you try fetching the same product with additional params |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
logeshswell
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
variable: true might not help but passing variant: true might help
Also, did you try fetching the same product with additional params
expand: variants
after a POST request, to make sure the variants are generated successfully in async method.