hello everyone…
im working on my final year graduation project … it’s about creating ,updating,deleting products using wix store APIs.
In creating a product using PHP laravel 9 I keep getting this error message:“requirement failed: product.productType unspecified_product_type is not supported” … so please any help ill be so grateful and thanks in advance.
function sendproduct (){
$data1 = array (
"name" => "T-shirt" ,
"productType" => "physical" ,
"priceData" => array (
"price" => 10.5
),
"description" => "nice summer t-shirt" ,
//"sku" => "123df",
"visible" => false ,
"ribbon" => "Sale" ,
"brand" => "Nice" ,
"weight" => 0.2 ,
"discount" => array (
"type" => "AMOUNT" ,
"value" => 1
),
"manageVariants" => true ,
"productOptions" => array (
array (
"name" => "Size" ,
"choices" => array (
array (
"value" => "S" ,
"description" => "S"
),
array (
"value" => "L" ,
"description" => "L"
)
)
)
)
);
$curl = curl_init ();
$data = json_encode ( $data1 );
curl_setopt_array ( $curl , array (
CURLOPT_URL => ......
,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_ENCODING => “” ,
CURLOPT_MAXREDIRS => 10 ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST” ,
CURLOPT_POSTFIELDS => $data ,
CURLOPT_HTTPHEADER => array (
‘Content-Type: application/json’ ,
'Authorization: … ),
));
$response = curl_exec ( $curl );
curl_close ( $curl );
dd ( $response );
}