InserirLogVendaPassagem
The InserirLogVendaPassagem method is responsible for sending the data to ANTT to include the ticket sold in the given period. It must be sent according to the data types defined by ANTT’s XML schemas and send the document for processing in ANTT’s WebService.
The return of this service contains the processing status of this ANTT method by the API and the nsNRec code for checking the processing status.
URL
Production: POST https://antt.ns.eti.br/v1/antt/logvenda
Input Data
The data to be sent in the request body must be in JSON format.
Sending data in JSON format
To send data in JSON, the Content-Type of the request must be defined as application/json.
Field | Occurrence | Data Type | Parent | Description |
---|---|---|---|---|
X-AUTH-TOKEN | 1-1 | String | User access token It can also be sent via Header or QueryString in the URL. |
|
chBPe | 1-1 | String | BPe Access Key Previously Authorized via NS API BPe | |
tpAmb | 1-1 | String | Type of environment for processing InsertLogVendaPassagem method 1 - Production 2 - Test Environment *Default value: 2 |
|
logEmissao | 1-1 | O | Object containing the data to be sent to the method |
|
cnpjEmpresa | 1-1 | String | logEmissao | |
codigoBilheteEmbarque | 1-1 | Int | logEmissao | ticket identifier code boarding: 0 = Normal; 1 = Free; |
codigoCategoriaTransporte | 1-1 | Int | logEmissao | Transport Category 01 = interstate 02 = international 03 = intercity 04 = municipal |
idPontoOrigemViagem | 1-1 | Int | logEmissao | ANTT municipality origin code. Use the table provided by antt to fill in this field. (https://portal.antt.gov.br/monitriip) |
idPontoDestinoViagem | 1-1 | Int | logEmissao | ANTT municipality destination code. Use the table provided by antt to fill in this field. (https://portal.antt.gov.br/monitriip) |
identificacaoLinha | 1-1 | String | logEmissao | Line identification; prefix: road [8] or itinerary; semi-urban [4], if applicable (differentiated service) |
codigoTipoServico | 1-1 | Int | logEmissao | Type of service offered in transport: 01: Conventional, with toilet; 02: Conventional, without toilet; 03: Semi-bed; 04: Bed, with air conditioning; 05: Bed, without air conditioning; 06: Executive; 07: Semi-urban; |
dataViagem | 1-1 | String | logEmissao | Ticket travel date. UTC Standard: YYYYMMDD |
horaViagem | 1-1 | String | logEmissao | Ticket Travel Time. UTC Standard: HHMMSS |
codigoTipoViagem | 1-1 | Int | logEmissao | Type of trip: 00: Regular; 01: extra01; 02: extra02; 03: extra03; 04: extra04; (...) NN: extraXX |
numeroPoltrona | 1-1 | Int | logEmissao | seat number |
plataformaEmbarque | 0-1 | String | logEmissao | Boarding platform code or numerical identification |
codigoMotivoDesconto | 1-1 | Int | logEmissao | Reason for discount: 01: Standard Rate – no discount; 02: Promotional Rate - Paragraph 3, art. 27 of Decree No. 2.521/98 05: Travel Ticket for the Elderly 100% - Item I, art. 40 of Law No. 10741/03; 06: Elderly Travel Ticket 50% - Item II, art. 40 of Law No. 10741/03 07: Travel Authorization - Free Pass - Art. 1 of Law No. 8.899/94; 08: Free Pass Auditors and Labor Agents - Art. 34 of the Decree No. 4,552/02; 09: Child Free - Item XVII, art. 29 of Decree No. 2,521/98; 10: Youth Travel Ticket 100% - Item I, art. 32 of Law No. 12,852/13; 11: Youth Travel Ticket 50% - Item II, art. 32 of Law No. 12,852/13; 12: Travel Authorization - Free Companion Pass - Art. 1 of Law No. 8.899/94; |
percentualDesconto | 1-1 | Float | logEmissao | Discount percentage. Formatting: 5.2 Min: 0.00; Max: 100.00; |
aliquotaICMS | 1-1 | Float | logEmissao | Percentage of the ICMS rate. Formatting: 5.2 Min: 0.00; Max: 100.00; |
Request example
Request Data in JSON Format
{
"X-AUTH-TOKEN":"YOUR_TOKEN_HERE",
"chBPe":"432108065998843000126630060000023521000000012",
"tpAmb": 2,
"logEmissao": {
"cnpjEmpresa":11111111111111,
"codigoBilheteEmbarque": 1,
"codigoCategoriaTransporte": "02",
"idPontoOrigemViagem":"1",
"idPontoDestinoViagem":"1",
"identificacaoLinha": "1",
"codigoTipoServico": 1,
"dataViagem": "20210823",
"horaViagem": "173145",
"codigoTipoViagem": 1,
"numeroPoltrona": "1",
"plataformaEmbarque": "5",
"codigoMotivoDesconto": 1,
"percentualDesconto": 0.0,
"aliquotaICMS": 17.0
}
}
Data returned
Campo | Descrição | Tipo | Ocorrência | Observação |
---|---|---|---|---|
Status | Código de status do processamento | N | 1-1 | |
Motivo | Descrição literal do status de processamento | A | 1-1 | |
nsNRec | ID do Processamento do método InserirLogVendaPassagem | N | 0-1 | Somente em status = 200 |
Response examples
Successful Response
{
"status": 200,
"motivo": "Log enviado para a ANTT",
"nsNRec": "112"
}
Unsuccessful Response
{
"status": -6,
"motivo": "Documento ja processado anteriormente e autorizado",
"nsNRec": "110"
}
Response Codes
Código | Descrição |
---|---|
200 | Log submission successfully executed. |
-2 | Request data validation error. |
-3 | Errors in log processing after sending to Core/ANTT |
-4 | Errors in log processing after sending to Core/ANTT |
-5 | Errors in log processing after sending to Core/ANTT |
-6 | Document already processed and authorized. Check the nsNRec informed of the response. |