API Create Product {"errors":{"product":"Required parameter missing or invalid"}}

API Create Product {"errors":{"product":"Required parameter missing or invalid"}}

Pierre8
Shopify Partner
2 0 0

Hello, 

I'm trying to create products on stores using the shopify API.

It's working fine on one store but not in the other.

Here is the request : 

POST : [store_url]/admin/api/2024-07/products.json
Content-type : application/json

Body 

 
{
    "product": {
        "title": "TEST SHOPIFY - NE PAS EFFACER",
        "body_html": "",
        "vendor": "SHOPIFY",
        "product_type": "Antivol à code",
        "status": "active",
		"published_scope": "global",
		"published": true,
		"metafields": [],
"images":[{"src":"https:"}],
        "variants": [
            {
                "title": "Default Title",
                "price": "20",
                "sku": "",
                "position": 1,
                "inventory_policy": "continue",
                "fulfillment_service": "manual",
                "inventory_management": "shopify",
                "option1": "Default Title",
"metafields": [],
                "option2": null,
                "option3": null,
                "taxable": true,
                "barcode": "",
                "weight": 2,
                "inventory_quantity": 1,
                "old_inventory_quantity": 0,			
                "presentment_prices": [
                    {
                        "price": {
                            "amount": "20",
                            "currency_code": "EUR"
                        },
                        "compare_at_price": null
                    }
                ],
                "requires_shipping": true
            }
        ]
    }
}
 
 
On one store the product is successfully created.
On the other a status code 400 with the error message 
{"errors":{"product":"Required parameter missing or invalid"}}
The error message does not tel me what parameter is missing.

Replies 2 (2)

gojiberry-des
Shopify Partner
6 1 0

Hello, the image url in your request seems to be incomplete. Could that be the issue?

If you like my suggestion please give it a LIKE or mark it as a solution! ★★★★★

Gojiberry - Best post-purchase survey and feedback app for Shopify | Install on App Store for free
Shopify Community is helpful, BUT... why not start asking your customers for feedback instead?

Pierre8
Shopify Partner
2 0 0

Hey @gojiberry-des 

 

Thanks for the reply,
I tried :
- removing the 

"images":[{"src":"https:"}],

- Removing https:
- Adding a complete url 

Still getting the error 400.