Event for the issuer of the CT-e OS of the Transport of Values to inform the GTVs related to the provision of the service.
URL
Production: POST https://cte.ns.eti.br/cte/gtv
Input data
| Field | Description | Parent | Occurrence | Data Type | Notes |
|---|---|---|---|---|---|
| X-AUTH-TOKEN | User access token | 0-1 | String | Can also be sent in the request header | |
| chCTe | CT-e access key | 1-1 | Int | ||
| tpAmb | CT-e authorization environment type | 1-1 | Int | 1 - Production 2 - Homologation |
|
| dhEvento | Date and time of the event | 1-1 | Date | Sefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC E.g.: 2016-06-13T15:04:10-02:00 |
|
| nSeqEvento | Event sequential number | 1-1 | Int | In most cases it will be 1. However, when more than one event of the same type is generated for the same CT-e, this number must be sequentially incremented | |
| infGTV | Object or array of objects containing the data to be changed | 1-N | Object or array | This field can contain an object ({...}) or several objects within an array ([{...}, {...}, ...]) making it possible to link several GTVs to the CT-e in the same event | |
| nDoc | GTV number | infGTV | 1-1 | String | Must contain 20 characters |
| id | Identifier to differentiate GTV from the same number (Use AIDF number or internal company identifier) | infGTV | 1-1 | String | Must contain 20 characters |
| serie | GTV series | infGTV | 0-1 | String | |
| subserie | GTV subseries | infGTV | 0-1 | String | |
| dEmi | Issuance date | infGTV | 0-1 | Date | YYYY-MM-DD format |
| nDV | Verifying digit number | infGTV | 1-1 | Int | |
| qCarga | Number of volumes/pouches | infGTV | 1-1 | Int | |
| placa | Vehicle plate | infGTV | 0-1 | String | |
| UF | FU of the plate where the vehicle is registered | infGTV | 0-1 | String | Example: "RS" |
| RNTRC | RNTRC of the carrier | infGTV | 0-1 | String | |
| infEspecie | Information of the transported species | infGTV | 1-N | Object or array | This field can contain an object ({...}) or several objects within an array ([{...}, {...}, ...]) making it possible to inform several different species |
| tpEspecie | Species type | infEspecie | 1-1 | 1 | 1 - Cash; 2 - Check; 3 - Currency; 4 - Others |
| vEspecie | Amount carried in the indicated type | infEspecie | 0-1 | Int | |
| rem | GTV sender information | infGTV | 1-1 | Object | |
| CNPJ | CNPJ number | rem | 0-1 | Int | Inform CNPJ or CPF according to the sender's registration |
| CPF | CPF number | rem | 0-1 | Int | |
| IE | State registration | rem | 0-1 | Int | |
| UF | FU acronym | rem | 0-1 | String | Example: "RS" |
| xNome | GTV sender's business name | rem | 1-1 | String | |
| dest | GTV recipiet information | infGTV | 1-1 | Object | |
| CNPJ | CNPJ number | dest | 0-1 | Int | Inform CNPJ or CPF according to the recipient's registration |
| CPF | CPF number | dest | 0-1 | Int | |
| IE | State registration | dest | 0-1 | Int | |
| UF | FU acronym | dest | 1-1 | String | Example: "RS" |
| xNome | GTV recipient's business name | dest | 1-1 | String |
Request example
GTV Information Event Request
curl -X POST
\-H "Content-Type: application/json"
\-d '{
"X-AUTH-TOKEN": "YOUR_TOKEN",
"chCTe": "43171211111111111111670000000000051000000051",
"tpAmb": "2",
"dhEvento": "2017-12-19T18:43:00-02:00",
"nSeqEvento": "2",
"infGTV": {
"nDoc": "11111111111111111111",
"id": "11111111111111111111",
"dEmi": "2017-12-19",
"nDV": "1",
"qCarga": "1.0000",
"infEspecie": [
{
"tpEspecie": "3",
"vEspecie": "100.00"
},
{
"tpEspecie": "3",
"vEspecie": "100.00"
}
],
"rem": {
"CNPJ": "11111111111111",
"UF": "RS",
"xNome": "NS Tecnologia"
},
"dest": {
"CNPJ": "11111111111111",
"UF": "RS",
"xNome": "EMITENTE DO CTE"
}
}
}' \
https://cte.ns.eti.br/cte/gtv
Returned data
| Field | Description | Parent | Occurrence | Data Type | Notes |
|---|---|---|---|---|---|
| status | Processing status code | Int | |||
| motivo | Processing status literal description | String | |||
| retEvento | Object containing the CT-e processing data at Sefaz | 0-1 | Object | ||
| cStat | Code of the processing situation at Sefaz | retEvento | 1-1 | Int | |
| xMotivo | Literal description of the processing situation at Sefaz | retEvento | 1-1 | String | |
| chCTe | CT-e access key | retEvento | 1-1 | Int | |
| dhRegEvento | Date and time of event registration at Sefaz | retEvento | 1-1 | Date | Sefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC E.g.: 2016-06-13T15:04:10-02:00 |
| nProt | Document receipt number by Sefaz | retEvento | 1-1 | Int | |
| xml | Distribution XML of the GTV information event | retEvento | 1-1 | String | |
| erros | Array containing the list of errors during the information validation of the event according to the data type | 0-1 | Array | Only when status = -5 | |
| codigo | Error code returned by Sefaz | 0-1 | Int | Only when status = -4 | |
| descricao | Error literal description returned by Sefaz | 0-1 | String | Only when status = -4 |
Return example
Successful return
{
"status": 200,
"motivo": "GTV vinculada ao CT-e com sucesso",
"retEvento": {
"cStat": 135,
"xMotivo": "Evento registrado e vinculado a CT-e",
"chCTe": "43171211111111111111670000000000051000000051",
"dhRegEvento": "2017-12-19T19:14:04-02:00",
"nProt": "143170000994263",
"xml": "<?xml version=\"1.0\" encoding=\"utf-8\"?><procEventoCTe versao=\"3.00\" xmlns=\"http://www.portalfiscal.inf.br/cte\">...</procEventoCTe>"
}
}
Return codes
| Code | Description |
|---|---|
| 200 | GTV linked to the CT-e successfully |
| -2 | Invalid access key |
| -3 | CT-e not found |
| -4 | Error when linking the event to the CT-e returned by Sefaz. Verify the "codigo" and "descricao" fields for more information |
| -5 | Information error according to the data type |