Below we have a JSON with the minimum information that sefaz requires to authorize a BPe.
This same JSON will be detailed with the explanation of what makes up each tag of its structure.
OBS: All these tags must also be visualized in the sefaz layout manual, in it you will have all the complete information that can contain in a JSON or XML.
Example of a BPe with its tags commented out:
{
"BPe": { " //Default opening group, it will always be this name.
"infBPe": { //Group that contains all other BPe groups.
"versao": "1.00", //Emission layout version tag, by default it will always be version 1.00.
"ide": { //BPe identification group, it will always be this name.
"cUF": "43", //Tag of the federative unit of the BPe issuer, Use the IBGE table of federation units code. (Example: Bahia = 29, São Paulo = 31).
"tpAmb": "2", //Environment type tag, this tag can only contain two of these values 1 = production environment where the BPe has tax value and 2 = homologation environment where the BPe has no tax value. (Environment 2 is used for testing).
"mod": "63", //Tag to place the model of the document that will be issued in this case the model 63 = BPe.
"serie": "6", //BPe series tag, in this tag the number of the emission series must be passed, for example series 1 to series 999.
"nBP": "2770", //BPe number tag this tag is to pass the issue number of the document, from the number 1 to 999999999. (It is updated for each series).
"cBP": "" //Numerical Code field that composes the Access Key This code can be randomly generated by the issuer and will compose the BPe Access Key.
"cDV": "7", //Access Key Verifier Digit Tag This digit is calculated by applying the module 11 algorithm.
"modal": "1", //Tag of the BPe transport mode, which can be 1 = Road, 3 = Waterway, 4 = Rail.
"dhEmi": "2022-04-07T11:00:00-03:00", //BPe emission date and time tag YYYY-MMDDTHH:MM:DD TZD format.
"tpEmis": "1", //BPe emission type tag 1 = Normal 2 = Off-Line Contingency.
"verProc": "1.00", //Application version tag, inform the version of the BP-e issuing application.
"tpBPe": "0", //BPe type tag, inform the BPe type if it is 0 = Normal or 3 = Replacement.
"indPres": "1", //Tag of the buyer's presence indicator in the establishment at the time of the operation 1=In-person operation not shipped; 2=Operation not in person, via the Internet; 3=Operation not in person, Teleservice; 4=BP-e in operation with home delivery; 5=Onboard face-to-face operation; 9=Operation not in person, others.
"UFIni": "RS", //Tag of the initial federative unit abbreviation of the trip.
"cMunIni": "4314902", //Tag of the code of the municipality where the trip is being started.
"UFFim": "PR", //Tag of the abbreviation of the final federative unit of the trip.
"cMunFim": "4106902", //Code tag of the municipality where the trip ends.
}, //Closing the ide group.
"emit": { //BPe Issuer Information Group.
"CNPJ": "07364617000135", //CNPJ of the BPe issuer.
"IE": "0170108708", //State registration of the BPe issuer.
"xNome": "EMPRESA TESTE", //BPe Issuer Corporate Name Tag.
"IM": "516830", //State Registration Code of the BPe issuer.
"CNAE": "1234567", //Tag of the National Classification of Economic Activities, it is the official classification adopted by the National Statistical System of Brazil and by Organs federal, state and municipal bodies that manage administrative records and other institutions in Brazil.
"CRT": "1", //Tax Regime Code field, this field must contain some of this information. This field must be filled in with: 1 – Simples Nacional; 2 – Simples Nacional – gross revenue sub-limit excess; 3 – Normal Regime.
"enderEmit": { //Group to pass the BPe issuer address information.
"xLgr": "RUA ANTONIO DURO", //BPe Issuer street name tag.
"nro": "870", //Tag to pass the issuer's registered office number.
"xBairro": "CENTRO", //BPe issuer's Neighborhood tag.
"cMun": "4303509", //BPe issuer municipality code tag according to IBGE.
"xMun": "CAMAQUA", //Name tag of the issuer's municipality.
"UF": "RS" //Tag of the abbreviation of the issuer's federative unit. (This abbreviation is the UF code that was filled in the cUF field in the ide group)
}, //Closing the Issuer Address Group.
"TAR": "113645236" //Tag of the Term of Authorization for Regular Service, this registration is mandatory for the BP-e issuer with ANTT to carry out the activity
}," //Closing of the Issue Group.
"comp": { //BPe buyer identification group.
"xNome": "NOME DO PASSAGEIRO", //BPe buyer name tag.
"CPF": "76106255075", //Passenger's CPF (Individual Taxpayer Registration) tag.
Note: If the buyer is a foreigner, use the tag "idEstrangeiro", instead of CPF.
"enderComp": { //Buyer address data group.
"xLgr": "Rua Teste", //Street name tag.
"nro": "0", //Passenger address number tag.
"xBairro": "Centro", //Passenger neighborhood name tag.
"cMun": "4303509", //Passenger's municipality code tag.
"xMun": "CAMAQUA", //Municipality name tag.
"UF": "RS" //Federation unit acronym tag.
} //Closing of the buyer address information group.
}, //Closing of the comp Group.
"agencia": { //Agency group or third party that marketed the BPe.
"xNome": "AGENCIA LTDA DIFFERENTE DO EMISSOR", //Group of the corporate name or name of the agency.
"CNPJ": "26570113000116", //CNPJ group of the agency.
"enderAgencia": { //Agency address group.
"xLgr": "Largo Vespasiano Julio Veppo", //Street name tag.
"nro": "870", Address number tag.
"xBairro": "NEIGHBORHOOD", //Neighborhood tag of the agency.
"cMun": "4303509", //Tag of the agency's Municipality code.
"xMun": "CAMAQUA", //Tag of the name of the city of the municipality.
"UF": "RS" //"Tag of the acronym of the Agency's federative unit.
} //Closing the enderAgencia Group.
}, //Closing the agency Group.
"infPassagem": { //Group of ticket information.
"cLocOrig": "3550308", //Origin Locality Code Tag.
"xLocOrig": "SAO PAULO", //Origin city name tag.
"cLocDest": "4106902", //Destination Locality Code Tag.
"xLocDest": "CURITIBA", //Tag of destination city name
"dhEmb": "2022-04-07T18:00:00-03:00", //Date and time tag of shipment.(Format YYYY-MMDDTHH:MM:DD TZD)
"dhValidade": "2023-04-07T18:00:00-03:00", //Tag of the date and time of the BPe validity.(Format YYYY-MMDDTHH:MM:DD TZD)
"infPassageiro": { //BPe Passenger information group.
"xNome": "JOAO DOIS", //Passenger name tag
"tpDoc": "5", //Type of Identification Document. 1-RG 2-Voter Title 3-Passport 4-CNH 5-Others.
"nDoc": "29362322013" //Document number tag
} //Closing the infPassageiro Group
}, //Closing the infPassagem Group.
"infViagem": { //Group of trip information.
"cPercurso": "3550308-4106902", //Tag of city codes referring to the route.
"xPercurso": "SAO PAULO x CURITIBA", //Tag of the names of the cities referring to the route.
"tpViagem": "00", //Trip type tag. Informs the trip type code (00-regular, 01-extra).
"tpServ": "4", //Service type tag. Inform the type of service code (1-Conventional with toilet, 2-Conventional without toilet, 3-Semi-bed, 4-Bed with air conditioning, 5-Bed without air conditioning, 6-Executive, 7-Semiurban, 8-Longitudinal, 9-Crossing).
"tpAcomodacao": "1", // Accommodation type tag. Inform the accommodation type code (1- Seat/armchair, 2- Hammock, 3- Hammock with air conditioning, 4-Cabin, 5- Others).
"tpTrecho": "1", //Tag of the segment type. Inform the type of segment (1-Normal, 2-Initial Stretch, 3-Connection).
"dhViagem": "2022-03-09T09:18:00-03:00", //Tag of the date and time of the connection Inform if tpTrecho = 3.
"poltrona": 3 //Tag of seat number.
}, //Closing the infViagem Group.
"infValorBPe": { //Group referring to BPe value information.
"vBP": "139.99", //BPe value tag
"vDiscount": "0.00", //BPe discount amount tag.
"vPgto": "139.99", //Payment amount tag.
"vChange": "0.00", //Change value tag.
"Comp": [ //Group of ticket value components.
{
"tpComp": "01", //Component type tag 01 - RATE; 02 - TOLL; 03 - SHIPPING FEE; 04 - INSURANCE; 05 - ROAD MAINTENANCE FEE (TMR); 06 - INTEGRATED SALES SERVICE (SVI) ; 99 - OTHERS
"vComp": "123.59" //Tag referring to the value of the component.
},
{
"tpComp": "02", //Component type tag 01 - RATE; 02 - TOLL; 03 - SHIPPING FEE; 04 - INSURANCE; 05 - ROAD MAINTENANCE FEE (TMR); 06 - INTEGRATED SALES SERVICE (SVI) ; 99 - OTHERS
"vComp": "6.40" //Tag referring to the component's value.
},
{
"tpComp": "03", //Component type tag 01 - RATE; 02 - TOLL; 03 - SHIPPING FEE; 04 - INSURANCE; 05 - ROAD MAINTENANCE FEE (TMR); 06 - INTEGRATED SALES SERVICE (SVI) ; 99 - OTHERS
"vComp": "10.00" //Tag referring to the component's value.
},
{
"tpComp": "04", //Component type tag 01 - RATE; 02 - TOLL; 03 - SHIPPING FEE; 04 - INSURANCE; 05 - ROAD MAINTENANCE FEE (TMR); 06 - INTEGRATED SALES SERVICE (SVI) ; 99 - OTHERS
"vComp": "0.00" //Tag referring to the value of the component.
},
{
"tpComp": "05", //Component type tag 01 - RATE; 02 - TOLL; 03 - SHIPPING FEE; 04 - INSURANCE; 05 - ROAD MAINTENANCE FEE (TMR); 06 - INTEGRATED SALES SERVICE (SVI) ; 99 - OTHERS
"vComp": "0.00" //Tag referring to the value of the component.
},
{
"tpComp": "06", //Component type tag 01 - FEE; 02 - TOLL; 03 - SHIPPING FEE; 04 - INSURANCE; 05 - ROAD MAINTENANCE FEE (TMR); 06 - INTEGRATED SALES SERVICE (SVI) ; 99 - OTHERS
"vComp": "0.00""Tag referring to the value of the component.
},
{
"tpComp": "99", //Component type tag 01 - RATE; 02 - TOLL; 03 - SHIPPING FEE; 04 - INSURANCE; 05 - ROAD MAINTENANCE FEE (TMR); 06 - INTEGRATED SALES SERVICE (SVI) ; 99 - OTHERS
"vComp": "0.00" //Tag referring to the value of the component.
}
] //Closing the Component Group.
},
"imp": { //Group referring to taxes.
"ICMS": { //Tag of the Tax on the Circulation of Goods and Services.
"ICMS00": { //Group referring to the type of ICMS in this case is 00 = Tax on the Circulation of Goods and Services.
"vBC": "139.99", //ICMS Calculation Base value tag.
"pICMS": "12.00", //Tag of the value of the ICMS rate.
"vICMS": "16.79", //ICMS value tag.
"CST": "00" //Tag of the Tax classification of the Service.
}, //Closing the ICMS type group.
} //Closing the ICMS information group.
}, //Closing the Tax Group.
"pag": { //BPe payment data group.
"tPag": "01", //BPe payment method tag. :01-Money;02-Cheque;03-Credit Card;04-Debit Card;05-Vale Transportel;99 -Others.
"vPag": "139.99" //Tag of the amount paid.
}, //Closing the Payment Data Group.
"infRespTec": { //Technical responsible information group.
"xContato": "Name", //FernandoTechnical responsible name tag
"email": "teste@teste.com", //Technical responsible email tag
"fone": "5136921123", //Technician's phone tag.
"CNPJ": "07364617000135" //CNPJ tag of the technical manager.
}, //Closing of the technical responsible information group.
"infAdic": { //Additional information group, used to put some extra information in the bpe
"infCpl": "Lei Federal n. 12.741/12: ICMS R$ 16.79%), PIS 12%, COFINS 3%" //BPe supplementary information tag.
} //Closing the Additional Information Group.
} //Closing of the BPe Information Group.
} //Closing of the infBPe Group.
}