I’m trying to POST new product through REST API but getting 400 error without much details:
HTTP error:<400 , Bad Request Error : {"errors":{"product":"Required parameter missing or invalid"}}>
X-Request-ID: bc258e03-878e-4253-a3ad-8b30d63155ac
From API docs I see only ‘title’ element is necessary, which is present. Please give me more details what parameter I missed?
Used following schema to make a JSON request:
<application xmlns="http://wadl.dev.java.net/2009/02">
<doc xml:lang="en" title="https://mystorename.myshopify.com"/>
<grammars>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="product">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="title"/>
<xs:element type="xs:string" name="vendor"/>
<xs:element type="xs:string" name="product_type"/>
<xs:element type="xs:string" name="handle"/>
<xs:element type="xs:string" name="published_scope"/>
<xs:element type="xs:string" name="tags"/>
<xs:element type="xs:boolean" name="published"/>
<xs:element name="variants">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:decimal" name="price"/>
<xs:element type="xs:string" name="sku"/>
<xs:element type="xs:string" name="inventory_policy"/>
<xs:element type="xs:string" name="fulfillment_service"/>
<xs:element type="xs:string" name="inventory_management"/>
<xs:element type="xs:boolean" name="taxable"/>
<xs:element type="xs:string" name="barcode"/>
<xs:element type="xs:int" name="inventory_quantity"/>
<xs:element type="xs:boolean" name="requires_shipping"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</grammars>
<resources base="https://mystorename.myshopify.com">
<resource path="admin/api/2023-07/products.json" id="Products.json">
<doc xml:lang="en" title="Products.json"/>
<param name="Authorization" type="xs:string" required="false" default="" style="header" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<method name="POST" id="Products.json">
<doc xml:lang="en" title="Products.json"/>
<request>
<representation mediaType="application/json; charset=utf-8" element="product" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
</request>
<response status="200">
<representation mediaType="application/json; charset=utf-8"/>
</response>
</method>
</resource>
</resources>
</application>