Problems using Mail Freight Webservice ERROR[-888]

Asked

Viewed 1,511 times

-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.

2 answers

1

Hello.

The dimensions have to be within those limits:

MIN - MAX
Length (C): 15 cm - 100 cm
Width (L): 10 cm - 100 cm
Height (A): 1 cm - 100 cm
Sum of dimensions (C+L+A): 25 cm - 200 cm

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.