Skip to content

WS012 - Send Route to Verify with Pre-Registered Documents

Click here to see version history
Update date Service publication date Changes
04/15/2021 04/15/2021 Creation of v3

Objective

This integration aims to allow the sending of a route to be tracked by Comprovei©, using only the keys of documents pre-registered in the system.

Method description

Método uploadRouteUsingDocumentKey
Versão 3
WSDL principal https://soap.comprovei.com.br/importQueue/v3/index.php?wsdl
WSDL de contingência https://soapcontingencia.comprovei.com.br/importQueue/v3/index.php?wsdl
XSD https://soap.comprovei.com.br/importQueue/v3/schemas/validation/WS012.xsd

Important

  1. The connection to our service must be made to our main server, however we strongly suggest that a connection to our contingency server is also made available, as a guarantee of the availability of our services. The contingency server is only turned on in situations where our main server is unavailable. Making the connection url parameterizable is also a good practice;
  2. Our connections are secure using the SSL protocol. For security reasons, our certificates are constantly changed without prior notice. Therefore, it is recommended that you do not develop integrations based on a fixed certificate.
  3. We constantly (and without prior notice) add new fields and structures to both requests and responses from our web services. Anyone who uses our webservices must implement it in such a way that the programs that consume these webservices do not stop working when the mentioned field changes occur.

Version

You are accessing version 3 of our integration system. If you wish to consult the previous version, click here.

Features

  • Calls will be made via SOAP over HTTPS;
  • The origin of the Web Service call will be the client's system;

Important

Documents must be previously registered with Comprovei©, using WS013 or WS015, otherwise the route will be completely rejected.

Important

The user of this Web Service must store the protocol generated in the response. Support tickets regarding this integration will require this protocol.

Authentication

  • Calls will have message-level authentication (SOAP Header);
  • Request the username / password from the account administrator.

Request

The request for our Web Service is composed as follows:

Within the <Credentials> TAG:

TAG Type Description
Usuario string User for authentication.
Senha string User password for authentication

Body

Inside the <uploadRouteUsingDocumentKey> TAG:

TAG Type Description
Rotas root Root of the xml and composed of Rota.
nomeArquivo string Name of the sent file, with the extension. Example: route.xml.

Request Example

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Header>
        <Credenciais xmlns="WebServiceComprovei">
            <Usuario>usuario</Usuario>
            <Senha>teste</Senha>
        </Credenciais>
    </Header>
    <Body>
        <uploadRouteUsingDocumentKey xmlns="WebServiceComprovei:uploadRouteUsingDocumentKey">
            <Rotas xmlns="WebServiceComprovei:WS012">
                <Rota numero="String">
                    <rotadestino>String</rotadestino>
                    <rotanome>String</rotanome>
                    <Data>String</Data>
                    <Regiao>String</Regiao>
                    <Transportadora>
                        <Codigo>String</Codigo>
                        <Razao>String</Razao>
                    </Transportadora>
                    <Motorista>
                        <Usuario>String</Usuario>
                        <PlacaVeiculo>String</PlacaVeiculo>
                        <TipoVeiculo>String</TipoVeiculo>
                        <Nome>String</Nome>
                        <Telefone>String</Telefone>
                        <CNH>
                            <Numero>String</Numero>
                            <Vencimento>String</Vencimento>
                        </CNH>
                        <CPF>String</CPF>
                    </Motorista>
                    <Base>
                        <Origem codigo="String">
                            <Nome>String</Nome>
                            <Rua>String</Rua>
                            <Numero>Int</Numero>
                            <Complemento>String</Complemento>
                            <Bairro>String</Bairro>
                            <Cidade>String</Cidade>
                            <Estado>String</Estado>
                            <CEP>String</CEP>
                            <Pais>String</Pais>
                            <Contato>String</Contato>
                            <Email>String</Email>
                            <Telefone>String</Telefone>
                            <Cnpj>String</Cnpj>
                            <CnpjMatriz>String<CnpjMatriz>
                            <TipoMatriz>String ("courier" ou "shipper")</TipoMatriz>
                            <CodigoIBGE>String</CodigoIBGE>
                            <Posicao>
                                <Latitude>String</Latitude>
                                <Longitude>String</Longitude>
                            </Posicao>
                        </Origem>
                        <Destino codigo="String">
                            <Nome>String</Nome>
                            <Rua>String</Rua>
                            <Numero>Int</Numero>
                            <Complemento>String</Complemento>
                            <Bairro>String</Bairro>
                            <Cidade>String</Cidade>
                            <Estado>String</Estado>
                            <CEP>String</CEP>
                            <Pais>String</Pais>
                            <Contato>String</Contato>
                            <Email>String</Email>
                            <Telefone>String</Telefone>
                            <Cnpj>String</Cnpj>
                            <CnpjMatriz>String</CnpjMatriz>
                            <TipoMatriz>String ("courier" e "shipper")</TipoMatriz>
                            <CodigoIBGE>String</CodigoIBGE>
                            <Posicao>
                                <Latitude>String</Latitude>
                                <Longitude>String</Longitude>
                            </Posicao>
                        </Destino>
                    </Base>
                    <limites>
                        <inicio>String</inicio>
                        <fim>String</fim>
                    </limites>
                    <TipoRota>String ("D", "T", "P", "R")</TipoRota>
                    <TipoMaterial>String</TipoMaterial>
                    <Fornecimento>String</Fornecimento>
                    <TipoFrete>String</TipoFrete>
                    <Modal>String</Modal>
                    <CamposLivres>
                        <CampoLivre1>String</CampoLivre1>
                        <CampoLivre2>String</CampoLivre2>
                        <CampoLivre3>String</CampoLivre3>
                        <CampoLivre4>String</CampoLivre4>
                        <CampoLivre5>String</CampoLivre5>
                    </CamposLivres>
                    <Paradas>
                        <Parada numero="String">
                            <Documento>
                                <ChaveNota>String</ChaveNota>
                                <Agendamento>String</Agendamento>
                                <Itinerario>
                                    <ChaveUnica>String</Chaveunica>
                                    <Codigo>String</Codigo>
                                    <Descricao>String</Descricao>
                                    <CodigoDeBarras>String</CodigoDeBarras>
                                    <Data>String</Data>
                                    <Turno>String</Turno>
                                    <Prioridade>String</Prioridade>
                                    <Tipo>String</Tipo>
                                    <PontoTransbordo1>String</PontoTransbordo1>
                                    <CnpjTransportador1>String</CnpjTransportador1>
                                    <NomeTransportador1>String</NomeTransportador1>
                                    <Filial>String</Filial>
                                </Itinerario>
                            </Documento>
                        </Parada>
                    </Paradas>
                </Rota>
            </Rotas>
            <nomeArquivo>String</nomeArquivo>
        </uploadRouteUsingDocumentKey>
    </Body>
</Envelope>

Response

Our Web Service responds to you as follows:

TAG Type Description
status string Success or error message for the method call.
protocolo string Protocol for checking the progress of the import request.

Protocol

When a file is accepted into our system, a protocol is generated so that the import process can be monitored. This can be done using the WS501 method.

Response Example

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:WebServiceComprovei" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <ns1:uploadRouteUsingDocumentKeyResponse>
         <status xsi:type="xsd:string">Arquivo adicionado para a fila de importação!</status>
         <protocolo xsi:type="xsd:string">2017022258add9af06990</protocolo>
      </ns1:uploadRouteUsingDocumentKeyResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Our Route XML

Our XML for importing a route is composed of the following TAGs:

TAG Type Required Description
Rotas root Yes Root of the xml and composed of Rota.

Route

TAG Type Required Description
rotadestino string No Indication of the destination or route itinerary (limited to 30 characters).
rotanome string No Indication of the route name.
Data string Yes Route operation start date. The format YYYYMMDD is mandatory.
Regiao string No Route region.
Transportadora element Yes Structure initial element that contains information about the Transporter that will execute the route.
Motorista element Yes Structure initializer element that contains information about the Driver that will execute the route.
Base element No Structure initial element that contains information about the Base of origin and destination of the route.
limites element No Initializing element of the structure that contains information about the dates and times Limits of the start and end of the route.
TipoRota string No Type of route sent. Allowed values:
- D (Distribution)
- T (Transshipment)
- P (Place)
- R (Return)
TipoMaterial string No Type of route material.
Fornecimento string No Route supply code.
TipoFrete string No Type of freight contracted for the route.
Modal string No Mode of transport contracted for the document.
CamposLivres element No These fields are not replicated. CamposLivres
Paradas element Yes Structure initializer element that contains information about all Stops that will be made by the driver.
Atributo Type Required Description
numero string Yes Route attribute. Corresponds to the route number in the system.

Carrier

Conveyor structure start indicator. A route can contain a single carrier.

TAG Type Required Description
Codigo string Yes Carrier code. Normally it is the CNPJ. Send numbers only.
Razao string Yes  Name of the carrier. You can use a short name (business name).

If you do not have this information, the fields must be sent without content (empty).

Driver

Driver structure start indicator. A route can contain a single driver.

TAG Type Required Description
Usuario string Yes Driver code registered with Comprovei.
PlacaVeiculo string Yes Vehicle plate in the format: AAA9999 (without dash or space).
TipoVeiculo string No Type of vehicle that will be used to complete the route.
Nome string No Driver's name. This field will only be used when automatic driver registration is necessary!.
Telefone string No Driver's telephone number, in the format DDDNNNNNNNNN. This field will only be used when automatic driver registration is necessary!.
CNH element No Driver's license. This element will only be used when automatic driver registration is necessary!.
CPF element No Driver's CPF. This element will only be used when automatic driver registration is necessary!.

If you do not have this information, the fields must be sent without content (empty) and the route must be associated with a driver manually.

The CNH element is composed as follows:

TAG Type Required Description
Numero string * Driver's driver's license number.
Vencimento string * Expiration date of the driver's driver's license, in the format YYYMMDD.

*

The fields are mandatory if you want to provide the driver's driver's license.

Base

Indicator of the beginning of the structure of the source and destination bases. This information is optional and must be filled in when using routing.

TAG Type Required Description
Origem element * Route start location.
Destino element * Route end location.

Source and Destination are composed as follows:

TAG Type Required Description
Nome string * Base registration name.
Rua string *  Street of the base of origin (Street, Avenue, Square, etc.).
Numero integer * Base number.
Complemento string * Complement of the base address.
Bairro string * Base neighborhood.
Cidade string * Base city.
Estado string * UF of the base (For example: SP, MG).
CEP string * ZIP code (only numbers, without dashes or spaces) of the base.
Pais string * Base country, in alpha-2 (BR), alpha-3 (BRA) or in full (Brazil). See the list here.
Contato string No Name of the person responsible for the base to contact.
Email string No Email of the person responsible for the base to get in touch.
Telefone string No Telephone number of the person responsible for the base to contact, in the format DDDNNNNNNNNN.
Cnpj string No CNPJ of the base, using only numbers.
CnpjMatriz string No If the base is a branch or associated with a carrier/shipper with a different CNPJ, the CNPJ of the associated company in question must be informed, using only numbers.
TipoMatriz string No If this is the case mentioned above, inform the type of matrix. Allowed values:
- courier (Carrier)
- shipper (Shipper).
CodigoIBGE string No Municipality identifier code.
Posicao element No Element for sending position of the base.
Atributo Type Required Description
codigo string * Base identification code (Ideally, it should be unique).
Base Position

Element for sending the base location.

TAG Type Required Description
Latitude decimal * Base latitude, in decimal. Ex.: -23.5489
Longitude decimal * Base length, in decimal. Ex.: 46.6388

*

If you want to send the location of origin and final destination of the route, all TAGs that make up these elements become mandatory.

Limits

TAG Type Required Description
inicio string No Deadline date/time for starting the route. Format: YYYYMMDD HHMM .
fim string No Deadline date/time for the end of the route. Format: YYYYMMDD HHMM .

CamposLivres

TAG Type Required Description
CampoLivre1 string No Free Field
CampoLivre2 string No Free Field
CampoLivre3 string No Free Field
CampoLivre4 string No Free Field
CampoLivre5 string No Free Field

Stops

Element responsible for grouping all Stop elements of the route.

TAG Type Required Description
Paradas element Yes Stop structure start indicator. A route can be composed of several elements Stop.
Stop

Indicator of the start of a stop structure.

Atributo Type Required Description
numero string Yes Stop attribute. Corresponds to the stop number in the system.
TAG Type Required Description
Documento element Yes Document structure start indicator. In the case of deliveries with more than one document, a new stop must be created for each document. The system identifies several documents at the same address and performs consolidation.
Document

Indicator of the beginning of a document's structure. A stop must have a single document. In the case of several documents for the same location, a stop must be created for each document, as the system automatically recognizes the address and consolidates these documents on the route.

TAG Type Required Description
ChaveNota string Yes Document key. Normally it is the tax document key (barcode). This field is mandatory and its content must be unique for different documents.
Agendamento string No Indicator of agreed delivery date. This field should not be sent if scheduling is not applied to the note.
Itinerario element No Itinerary data
Atributo Type Required Description
numero string Yes Route attribute. Corresponds to the route number in the system.

Itinerary

TAG Type Required Description
ChaveUnica string * Unique itinerary key
Codigo string * Itinerary code
Descricao string * Itinerary description
CodigoDeBarras string * Itinerary barcode
Data string * Itinerary date
Turno string * Itinerary shift
Prioridade string * Itinerary priority
Tipo string * Itinerary type
PontoTransbordo1 string * Itinerary transfer point
CnpjTransportador1 string * CNPJ of the itinerary carrier
NomeTransportador1 string * Name of itinerary carrier
Filial string * Itinerary branch