Development discussions around Shopify APIs
Hi to all,
i've a little random problems when i try to create product's new variants:
1° example (result OK 201 Created)
..myshopify.com/admin/api/2020-07/products/4683504517206/variants.json
POST {"variant":{"product_id":4683504517206,"title":"XL/OUTLAW ORANGE","price":"3099.00","sku":"TR-01.20.10.3916","inventory_policy":"deny","inventory_management":"shopify","option1":"XL","option2":"OUTLAW ORANGE"}}
2° example (result KO 422 Unprocessable Entity)
..myshopify.com/admin/api/2020-07/products/4683902943318/variants.json
POST {"variant":{"product_id":4683902943318,"title":"S/PINOT NOIR RED","price":"2099.00","sku":"TR-01.20.10.4210","inventory_policy":"deny","inventory_management":"shopify","option1":"S","option2":"PINOT NOIR RED"}}
Both requests are similar (on 2 different product) but in example 1 i've response OK and in example 2 not!
i've thinked title field (contains "/" character) or sku field (contains "-" and "." characters) but in both examples is there
Any idea?
And in your second call example that fails, have you verified the product ID is valid?
yes, in second call, product'id is valid..
Okay, let's narrow other elements down to deduce things. What about changing the second API call so that the Title is generic, say, "GENERIC TITLE" If that still fails, change the API call so that the SKU is generic, say, "GENERICSKU" and see how that goes. All based off your confirmation that the product ID is valid.
User | RANK |
---|---|
10 | |
4 | |
3 | |
3 | |
3 |
We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023