-1
So, I was doing a Webservie Post Office Freight test, where I get the product and zip code data, and Webservice gives you the Freight amount back. However, when I go to test I usually give this error. [Error] => -888 [Msgerro] => No pricing found. ERP-008: Dimensions not located or dimensions exceed the accepted limits for this type of object(-1)."
Here is the code :
public function setFreight($nrzipcode)
{
$nrzipcode = str_replace('-', '', $nrzipcode);
$qs = http_build_query([
'nCdEmpresa'=>'',
'sDsSenha'=>'',
'nCdServico'=>'04014',
'sCepOrigem'=>'09853120',
'sCepDestino'=>$nrzipcode,
'nVlPeso'=> '0.900',
'nCdFormato'=>1,
'nVlComprimento'=>0.5,
'nVlAltura'=>0.5,
'nVlLargura'=>0.5,
'nVlDiametro'=>0.5,
'sCdMaoPropria'=>'S',
'nVlValorDeclarado'=>15.00,
'sCdAvisoRecebimento'=>'N'
]);
$xml = simplexml_load_file("http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx/CalcPrecoPrazo?".$qs);
echo var_dump($xml);
exit;
$result = $xml->Servicos->cServico;
$this->setnrdays($result->PrazoEntrega);
$this->setvlfreight(Cart::formatValueToDecimal($result->Valor));
$this->setdeszipcode($nrzipcode);
$this->save();
return $result;
}
I did a var_dump to see the error, and it says that I posted it up there. I tested several values, but still the same error, no longer know how to solve. I’d really appreciate it if you could help me.
Looking at the dimensions (e.g..,
nVlComprimento
) are in centimeters. You are passing half a centimeter in each dimension, which makes me think that are invalid values, because if each dimension has half a centimeter (0.5
), gives a tiny square packet, less than 1 centimeter, which is not valid. Try to increase these values (maybe the size of a shoe box) or look in the Post Office manual for the minimum values of a package that the Post Office accepts.– Sam