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 | |
5 | |
3 | |
3 | |
3 |
Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...
By Trevor May 15, 2023With 2-Factor Authentication being required to use Shopify Payments, we’re here to help yo...
By Imogen Apr 26, 2023