InserirLogCancelarPassagem
Through the cancellation service, it is possible to insert boarding tickets canceled in a certain period.
URL
Production: POST https://antt.ns.eti.br/v1/antt/logcancelamento
Input Data
| Code | Description | Occurrence | Has return data? |
|---|---|---|---|
| 200 | Ok | Yes | |
| 400 | Bad Request | When the request is being performed with wrongly assembled data | No |
| 401 | Not authorized | When the consumer application tries to access some unauthorized resource | No |
| 403 | Access denied | When the access token entered is invalid | No |
| 404 | Not found | When the method URL is invalid or the requested information is not found | Yes ( but it may not contain if the error is a non-existent URL error ) |
| 501 | API internal error | When an unanticipated internal error occurs | Yes |
Request Example
InserirLogCancelarPassagem Request Example
{
"X-AUTH-TOKEN": "YOUR_TOKEN_AQUI",
"chPassagem": "2021080869855400016500000002352000000015",
"tpAmb": 2,
"codigoMotivoCancelamento": 1,
"dataHoraCancelamento": "2021-08-24T11:14:00"
}
Response Data
| Field | Description | Data Type | Parent | Note |
|---|---|---|---|---|
| status | Processing Status Code | Int | ||
| motivo | Literal description of processing status | String | ||
| retEvento | Object containing Sefaz cancellation processing data | Object | Only in Status = 200 | |
| cStat | Processing status code | Int | retEvento | |
| chave | Method processing access key | String or Int | retEvento | Only in cStat = 135 |
| idTransacao | Transaction ID of the InsertLogVendaPassagem method | String | retEvento | Only in cStat = 135 |
| log_doc | Objeto contendo os dados que foram processados no método InserirLogVendaPassagem | Object | retEvento | Only in cStat = 135 |
| idLog | Log Identified Code processed at ANTT | Int | log_doc | |
| cnpjEmpresaTransporte | Company's CNPJ | String | logEmissao | |
| numeroBilheteEmbarque | BPe number. (nBP) | String | log_doc | |
| sequenciamento | Sequential sorting code: Min: 0; Max: 999999; | Int | logEmissao | |
| idViagem | 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 | String | logEmissao | |
| identificacaoLinha | Line identification; prefix: road [8] or itinerary; semi-urban [4], if applicable (differentiated service) | String | log_doc | |
| dataViagem | Ticket travel date. UTC Standard: YYYYMMDD | String | log_doc | |
| horaViagem | Ticket Travel Time. UTC Standard: HHMMSS | String | log_doc | |
| codigoMotivoCancelamento | Reason for canceling the ticket: 1 = Refund; 2 = Redial; 3 = Transfer of ownership | Int | log_doc | |
| numeroNovoBilheteEmbarque | New boarding pass number generated: [1..9]; | String | log_doc | |
| dataHoraCancelamento | Cancellation date and time UTC Standard: YYYY-MMDDTHH:MM:SS | String | log_doc | |
| xMotivo | Literary description of cStat | String | retEvento |
Response Examples
Successful Response
{
"status": 200,
"motivo": "Log de Cancelamento processado com sucesso",
"retEvento": {
"cStat": "135",
"chave": "2021080869855400016500000002352000000015",
"idTransacao": "de2a37f6--8bcc-b657-3f7fc5403cd7",
"log_doc": {
"idLog": 11,
"numeroBilheteEmbarque": "000002536",
"identificacaoLinha": "00000001",
"dataViagem": "20210825",
"horaViagem": "093000",
"codigoMotivoCancelamento": 1,
"dataHoraCancelamento": "2021-08-25T14:20:00"
},
"xMotivo": "Ação executada com sucesso."
}
}
Rerturned 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. |
InserirLogCancelarPassagem method download
You can download the complete cancellation information in XML or JSON. For this check the method Download Cancellation.