Sellbrite Developers

Welcome to the Sellbrite Developer Center

You can use the Sellbrite API to get and update your inventory, get your orders, and create shipments. Here you'll find comprehensive guides and documentation to help you start working with Sellbrite as quickly as possible.

Get Started
Ask A Question


Getting Error 403 while updating inventory

Posted by John 9 months ago

I am trying to update inventory for a product as a test but getting Error 403. I am using PHP. Here is the request which I am sending.

$inventory_array["inventory"][0] = array (
"sku" => "abcdefg",
"warehouse_uuid" => "<the id here>",
"on_hand" => 50,
$unamepwd = "abcdefgh:jklmnopq";
$unamepwd = base64_encode($unamepwd);
$api_call = "";

$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $api_call );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array ('Content-type: application/json', 'Accept: application/json') );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_HTTPHEADER, array("Authorization : Basic ".$unamepwd));
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $inventory_array);
$result = curl_exec( $ch );

$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo "HTTP Code ".$httpcode;

Please advice what is wrong in this request.

Loading comments...