These docs are for v2.0. Click to read the latest docs for v3.0.

Comunidade

Ask a Question
Back to All

Erro na cotação

Eu estou buscando a cotação abaixo, mas dá erro. Se eu mudar apenas o DestinationZipCode para 89218220, ele funciona. Porque para esse cep válido 08900000, ele da erro?

curl --location --max-time 10 'https://quotation-apigateway.rte.com.br/api/v1/gera-cotacao'
--header 'Accept: application/json'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer xxxxx'
--data '{
"OriginZipCode": "95110251",
"OriginCityId": 7566,
"DestinationZipCode": "08900000",
"DestinationCityId": 9176,
"TotalWeight": 2.5,
"EletronicInvoiceValue": 500,
"CustomerTaxIdRegistration": "05047273000296",
"ReceiverCpfcnp": "07335871000105",
"ContactName": "Fabio",
"ContactPhoneNumber": "47992868261",
"TotalPackages": 1
}'

ERRO 500:

{
"ErrorMessage": "Object reference not set to an instance of an object.",
"StackTrace": " at Rodonaves.Quotation.Bll.Customer.SetAdressDependenciesByStreetInfo(AddressInfo addressInfo, StreetInfo streetInfo, Boolean IsFirstQuotation) in /src/Rodonaves.Quotation.Bll/Customer.cs:line 350\n at Rodonaves.Quotation.Bll.Customer.GetByZipCodeAsync(AddressInfo addressInfo, Boolean IsFirstQuotation) in /src/Rodonaves.Quotation.Bll/Customer.cs:line 343\n at Rodonaves.Quotation.Bll.Customer.SetReceiverCustomerAsync(QuotationInfo info, Boolean isSimulation) in /src/Rodonaves.Quotation.Bll/Customer.cs:line 264\n at Rodonaves.Quotation.Bll.Quotation.SetCustomers(QuotationInfo info, Boolean isSimulation) in /src/Rodonaves.Quotation.Bll/Quotation.cs:line 313\n at Rodonaves.Quotation.Bll.Quotation.DoQuotationAsync(QuotationInfo info, Boolean isSimulation) in /src/Rodonaves.Quotation.Bll/Quotation.cs:line 119\n at Rodonaves.Quotation.Bll.Quotation.CreateQuotationAsync(QuotationInfo info) in /src/Rodonaves.Quotation.Bll/Quotation.cs:line 156\n at Rodonaves.Quotation.Controllers.QuotationController.PostQuotationAsync(CreateQuotationRequest request) in /src/Rodonaves.Quotation/Controllers/QuotationController.cs:line 61\n at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n at System.Threading.Tasks.ValueTask`1.get_Result()\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()\n at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)\n at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)\n at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)"
}


Inicialmente, imaginei que pudesse estar recusando o cep, porém a Rodonaves confirma o cep pelo ByZipCode.

{
"Id": 9176,
"Description": "Guararema",
"ReducedDescription": "Guararema",
"Status": "0",
"Type": "M",
"SubCityId": 0,
"ZipCode": "08900000",
"IbgeCityCode": 3518305,
"UnitFederation": "SP",
"UnitFederationDescription": "S",
"ZipCodeRanges": [
{
"CityId": 9176,
"StartingZipCode": "08900000",
"EndingZipCode": "08939999",
"Type": "T"
}
]
}