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; 2 = Discount Provided by Law |
| codigoCategoriaTransporte | 1-1 | Int | logEmissao | Transport Category 1 = interstate 2 = international |
| 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: (Regular Road Transport) [8], [11] ou [12] |
| codigoTipoServico | 1-1 | Int | logEmissao | Type of service offered in transport: 1: A (Bed); 2: B (Bed) - leito; 3: C (Semi-bed); 4: D (Executive); 5: E (basic) |
| 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: 0 - Does not meet Minimum Regularity/Frequency 1 - Meets Minimum Regularity/Frequency |
| 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: 0 - Standard Rate – no discount; 1 - Promotional Rate 2 - Elderly Person (free) 3 - Elderly Person (minimum 50% discount) 4 - Holder of Free Pass Credential 5 - Companion of Holder of Free Pass Credential 6 - Youth (free) 7 - Youth (minimum 50% discount) 8 - Lap Child (up to 6 years old) 9 - Auditor or Labor Agent |
| 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; |
| tipoDocumentoIdentificacao Passageiro | 1-1 | Int | logEmissao | 1 = RG; 2 = Título de Eleitor; 3 = Passaporte; 4 = CNH 5 = Certidão de Nascimento; 9 = Outro |
| valorICMS | 1-1 | Float | logEmissao | Min: 0.00; Max: 99999999.99; NumeroChar(); |
| origemEmissao | 1-1 | Int | logEmissao | 01 = In-person; 02 = Embarked; 03 = Internet; 04 = Self-service terminal (kiosk |
| sequenciamento | 1-1 | Int | logEmissao | Código sequencial de ordenação Min: 0; Max: 99 |
| idViagem | 1-1 | String | logEmissao | Trip Identifier Code (Regular Bus Service) Information in the sequence presented and separated by hyphens. Below, the explanation of each item that should be included in the idViagem. Scheduled Date of the Trip at the Initial Line Point: YYYYMMDD Scheduled Time of the Trip at the Initial Line Point:HHMMSS Trip Type Code: NN 00 = Does not meet the Minimum Regularity; 01 = Meets the Minimum Regularity Line Direction Code: 0 = Return; 1 = Outbound Line Prefix SGP/SIGMA: 8, 11, or 12 characters Example request: YYYYMMDD-HHMMSS-NN-N-PPPPPPPPPPPP |
Request example
Request Data in JSON Format
{
"X-AUTH-TOKEN":"YOUR_TOKEN_HERE",
"chBPe":"43230407364617000135630060000028941000000019",
"tpAmb": "2",
"logEmissao": {
"cnpjEmpresa": "07364617000135",
"idPontoOrigemViagem": "4314915",
"idPontoDestinoViagem": "4106910",
"codigoBilheteEmbarque": 1,
"codigoCategoriaTransporte": "2",
"identificacaoLinha": "2",
"codigoTipoServico": 1,
"dataViagem": "20230419",
"horaViagem": "140000",
"codigoTipoViagem": 1,
"numeroPoltrona": "1",
"plataformaEmbarque": "5",
"codigoMotivoDesconto": 1,
"percentualDesconto": 0.0,
"aliquotaICMS": 17.0,
"sequenciamento": 0,
"idViagem": "20240620-174900-01-1-123456789101"
}
}
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. |