I am trying to create the product via selly.gg
API and receive the following error:
400 {"message":"Validation failed","errors":["Theme is not included in the list"]}
What I've already tried: 100 times edit my json, copy pasted it exactly from documentation and etc, tried a lot of connect methods, already read a lot of resources for a find a mistake by myself... but nothing.
My current code:
<?php
$URL='https://selly.gg/api/v2/products';
$data = [
'title' => 'test title',
'description'=> 'test description',
'stock' => '1',
'private' => 'false',
"unlisted" => 'true',
"seller_note" => 'test seller note',
'price' => '9.99',
'currency' => 'USD',
'gateways' => ['paypal'],
'product_type' => '2',
'info' => 'FirstKey, SecondKey, ThirdKey'
];
$data_json = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Authorization: Basic " . base64_encode("mega4642179@gmail.com:3pnAUztziYgZDaAbNjYSuWSeNhtCjcfET8XLFxe8FH2W2kaoBg"),
'Content-Type: application/json',
'Content-Length: ' . strlen($data_json)
));
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_json);
curl_setopt($ch, CURLOPT_USERAGENT, "SellyDirection - selly.loc");
$result = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// Display errors
echo $status_code;
echo $result;
curl_close ($ch);
?>