I'm trying to use the /product endpoint but keep getting

`400 Bad Request` response:
{"message":"\"%fieldName\" is required. Enter and try again.","parameters":{"fieldName":"product"}}

My header includes the Json content-type. I'm really lost on how to form the body. Or does this even go in body? Below is my request:

require_once ('connparams.php');
$headers = [
    "Authorization" => "Bearer " . $token,        
    "Content-Type" => "application/json"
$response = $client->request('post', 'products', 
["headers" => $headers],
["body" => 
["product" => 
        ["sku" => 12211]

1 Answer 1



$response = $client->request('post', 'products',
        "product" => [
            "sku" => 12211

where $headers is an associative array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.