Ergonode docs
Search…
Creating simple product with mutation
This is how you can create a simple product via API.
Please note that for this to work, you need to create a template beforehand. This mutation can only assign products to an already existing template, and will NOT create a new one.
1
mutation {
2
productCreateSimple(
3
input: { sku: "SKU_test2", templateCode: "Tshirts"}
4
) {
5
__typename
6
}
7
}
8
Copied!
You can also assign category to newly created product in the same query.
While templateCode is required, categoryCodes is not. But if used, also needed to be created beforehand.
1
mutation {
2
productCreateSimple(
3
input: { sku: "SKU_test2", templateCode: "Tshirts", categoryCodes: "DELL" }
4
) {
5
__typename
6
}
7
}
Copied!
Copy link