Wix store API

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 );

}

Hi @roudaynajhinaoui88 ,

From Dev Docs , it states:

Currently, only creating physical products ( “productType”: “physical” ) is supported via the API.

Please only use “physical”.

Does it solve your question?

hello^^
I tried to physically create it but it doesn’t work… i created the product without adding the media and image, is the productType have to do with it somehow and causing this error

@roudaynajhinaoui88 No idea, you can try to contact the Dev Center support. This forum is for Velo development, not the same as Dev Center’s one. You can always post the solution here once you find that out.

Hi @certified-code that’s the code that help …and i checked error in json request it’s been solved thank you^^

@roudaynajhinaoui88 Yes you must add some details to your parameter without these details it will not allow you to create the product.