POST
/api/nfce/createIssue NFC-e
Issues an NFC-e (model 65, always intrastate outbound, no shipping). Key differences from the NFe endpoint: the consumer object is called client (not cliente); the address number is client.number; the consumer is optional; impostos.ipi, shipping_address, delivery_address and transportation do not exist. The value field in pag_info is named amount.
Required headers
tokenstring | string | NFC-e company token |
signstring | string | MD5 signature: MD5(token + path + body + timestamp) |
timestampstring | string | Unix timestamp in seconds (5-minute window) |
Body (root)
nature_*string | string | Operation nature (e.g. "Goods sale") |
issuance_*string | string | Issuance type: send "1" (normal).Offline contingency is triggered automatically when the tax authority does not respond; sending "9" sends the invoice to the tax authority with tpEmis=9 without the contingency data, and it is likely to be rejected |
ambiente*string | string | "1" production, "2" homologation. In homologação the invoice always carries a recipient: without client, CPF 12345678909 with the standard homologação name is added; with client, only the name is replaced |
products*array | array | Product list (see details below) |
name*string | string | Product name (xProd).Only unaccented letters, digits, space, - and / are kept: accented letters, punctuation and CJK characters are removed (e.g. "Pão de Açúcar" → "Po de Acar"). In homologação the name is replaced by the standard text "NOTA FISCAL EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL" |
ncm*string | string | NCM (8 digits) |
count*decimal | decimal | Quantity |
unit*string | string | Commercial unit (e.g. "UN", "KG") |
unit_*decimal | decimal | Unit price |
total_*decimal | decimal | Item total. Required, but not checked: the XML vProd is always unit_price × count |
origem*int | int | Merchandise origin (0..8) |
indicador_*int | int | 1 = included in the invoice total; 0 = not included |
category_string | string | NFC-e tax category ID (required if impostos not sent).Check the IDs: the error "Categoria fiscal NFC-e não encontrada" only appears when none is found; if only some are found (or impostos is mixed in), the items without a category have no ICMS group and issuance fails at schema validation, before the tax authority |
impostosobject | object | Manual taxes (alternative to category_id; no IPI).In NFC-e only these are read: icms.codigo_cfop and icms.situacao_tributaria (there is no inline ICMS rate — use a CSOSN/CST with no separately stated ICMS, e.g., 102, 500, 60), pis/cofins (situacao_tributaria, aliquota) and ibs_cbs (situacao_tributaria, classificacao_tributaria, p_ibs_uf, p_ibs_mun, p_cbs, p_red_aliq, p_dif, p_red_bc). is and the 221/620/830 fields are ignored — for those cases use category_id. Do not mix category_id and impostos in the same invoice: with one inline item, the categories of the other items are not loaded. Use CSOSN (e.g. 102, 500) for Simples and CST (e.g. 40, 60) for the regular regime — a mismatch with the company's CRT is refused before the tax authority (Rejection 590/591); an empty codigo_cfop becomes 5102 The Selective Tax (is) is not emitted on NFC-e, neither inline nor by category. The IBSCBSTot total only goes out when every item of the invoice has IBS/CBS. |
codigo*string | string | Internal product code (cProd).Required — without it issuance fails with an internal error |
ceststring | string | CEST |
gtinstring | string | Commercial GTIN/EAN |
gtin_string | string | Taxable GTIN |
discount_decimal | decimal | Item discount |
nItemPedint | int | Purchase Order Item (I61). Sequential item number within the order referenced by xPed (which comes from root id). Valid range: 1–999999. Default: omitted. Accepted alias: n_item_ped. |
desconta_boolean | boolean | Deducts the line's ICMS before computing PIS/COFINS — tax on (amount − ICMS), floor 0 (Supreme Court Tema 69); default false (no deduction, higher tax). Combined (OR) with the category flag: either one being true is enough |
desconta_boolean | boolean | Computes the IBS/CBS base with the official RFB formula (unified base of the regular-regime calculator): item value (product + freight + insurance + other − discount) + II − ICMS − FCP − single-phase ICMS − DIFAL and destination-state FCP − ISSQN − PIS − COFINS, floor 0 (PIS and COFINS are only deducted in 2026); if desconta_icms_pis_cofins is also true, the already-reduced PIS/COFINS is used; default false. Combined (OR) with the category flag: either one being true is enough |
idstring | string | External identifier — goes to xPed without spaces and cut to 15 characters.NFC-e has no deduplication: resending the same id issues another invoice |
ind_string | string | Buyer presence: "1" in person (default) or "4" home delivery — the values the tax authority accepts for model 65 ("5", in person outside the establishment, depending on the UF)."0", "2", "3" and "9" are passed through and the tax authority rejects them; any other value silently becomes "1" |
ind_string | string | Use "0" (no intermediary).There is no field for the infIntermed group (intermediary CNPJ), which the tax authority requires with "1" |
total_decimal | decimal | Total invoice discount. Warning: it only fills the vDesc total and is not apportioned across the items, which causes a rejection. Prefer products[].discount_price and omit this field |
trocodecimal | decimal | Change value (vTroco).The tax authority requires change = sum of the amount values − invoice total, so the cash amount must include the change |
segurodecimal | decimal | Insurance amount — split in proportion to each item's quantity (not its value) and rounded per item; the sum may differ from the amount sent by a few cents |
outras_decimal | decimal | Other ancillary expenses — split in proportion to each item's quantity (not its value) and rounded per item; the sum may differ from the amount sent by a few cents |
informacoes_string | string | Complementary info for the consumer |
informacoes_string | string | Info of interest to the tax authority |
clientobject | object | Consumer data (optional — see table) Provide only if the consumer is identified. CPF or CNPJ must be sent as digits only. |
cpfstring | string | CPF (identifies an individual) |
cnpjstring | string | CNPJ (legal entity) |
iestring | string | State registration — ignored in NFC-e (the indIEDest indicator is always 9) |
namestring | string | Name / corporate name |
enderecostring | string | Street |
numberstring | string | Address number (note: different from NFe, which uses numero) |
complementostring | string | Complement |
bairrostring | string | Neighborhood |
citystring | string | City |
ufstring | string | UF (replaced by the CEP's UF, if a CEP is sent) |
cepstring | string | Postal code (digits only). The consumer address only goes into the XML with ind_pres="4" and a postal code provided |
telefonestring | string | Phone |
emailstring | string | |
pag_array | array | Payments (default: cash, paid in full — see table) |
payment_*string | string | "0" paid in full, "1" deferred / installments |
payment_*string | string | Payment method (01=cash, 03=credit card, 04=debit card, 17=PIX, 99=other, etc.). Avoid "99": NFC-e does not send the description (xPag) yet and the tax authority rejects it (441). Always send the 2-digit code ("01", "03", "17"…): on NFC-e the API does not validate the value, and "1" or "3" make issuance fail while building the XML (success:false), without reaching the tax authority |
amountdecimal | decimal | Amount paid in this method (includes the change, if any). If omitted, the method receives the invoice total — with more than one payment method, provide it in all of them |
card_object | object | |
integration_string | string | "1" integrated, "2" not integrated.Optional; if card_info is sent, this field and brand_code are required. Today card_info data does not reach the XML: the card group goes out with tpIntegra=2, with no brand, CNPJ or authorization, for cards, PIX and other electronic methods (every method except 01, 02, 14, 15, 16, 90, 91 and 99) |
brand_string | string | Card brand (required if card_info is sent; not emitted — see above) |
acquirer_string | string | Acquirer CNPJ |
authorization_string | string | Authorization code |
* Required field. category_id or impostos, one of them is required.
Response fields (data)
uuidstring | string | Internal NFC-e identifier. Use it in follow-up calls ( /api/nfce/get_detail, /api/nfce/get_danfe) |
statusstring | string | Situation: "Success" (authorized), "Failed" (rejected/failed), "Contingencia" (issued in offline contingency, pending transmission) |
motivostring | string | Tax authority text for the cStat; mapped rejections come in PT / 中文.Today an authorization comes back as "Rejeição 100: Autorizado o uso da NF-e" — decide by success/status, never by the text |
nfceint | int | Issued NFC-e number (note: the field is named nfce, not nfe) |
serieint | int | NFC-e series |
chavestring | string | 44-digit access key (empty when the invoice was not authorized) |
modelostring | string | Document model: "nfce" |
xmlstring | string | URL of the authorized XML |
danfestring | string | NFC-e DANFE URL — empty at issuance; generate it on demand with /api/nfce/get_danfe |
In offline contingency (triggered automatically when the tax authority is unavailable), the response comes with
status: "Contingencia" plus the extra fields contingencia: true and tpEmis: 9; the invoice must be transmitted to the tax authority later.
Response — rejection / error
When the tax authority rejects the invoice,
success is false and data.motivo holds the reason; chave comes back empty. Field validation errors (before reaching the tax authority) return success: false with the message in message and no data object.
{
"success": false,
"data": {
"uuid": "65f8b9a1c2d3e4f5a6b7c8d9",
"status": "Failed",
"motivo": "Rejeição 226: Código da UF do Emitente diverge da UF autorizadora / 拒绝 226: 发件人所在州代码与授权州不一致",
"nfce": 5,
"serie": 1,
"chave": "",
"modelo": "nfce",
"xml": "",
"danfe": ""
}
}Examples
# sign = md5(token + path + body + timestamp) # Template generated from the endpoint path; replace the placeholders curl -X POST "https://api.tffiscal.com/api/nfce/create" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"nature_of_operation": "Venda de mercadoria",
"issuance_type": "1",
"ambiente": "2",
"ind_pres": "1",
"client": {
"cpf": "12345678909",
"name": "Consumidor Final"
},
"products": [
{
"codigo": "PROD001",
"name": "Refrigerante 2L",
"ncm": "22021000",
"count": 2,
"unit": "UN",
"unit_price": 10.50,
"total_price": 21.00,
"origem": 0,
"indicador_total": 1,
"category_id": "TF123"
}
],
"pag_info": [
{
"payment_indicator": "0",
"payment_method": "17",
"amount": 21.00
}
]
}
{
"id": "PED-2026-0001",
"nature_of_operation": "Venda de mercadoria",
"issuance_type": "1",
"ambiente": "2",
"ind_pres": "1",
"ind_intermed": "0",
"total_discount_amount": 0.00,
"troco": 0.00,
"seguro": 0.00,
"outras_despesas": 0.00,
"informacoes_complementares": "Pedido entregue na loja",
"informacoes_fisco": "ICMS recolhido conforme legislação",
"client": {
"cpf": "12345678909",
"cnpj": "",
"ie": "",
"name": "Consumidor Final",
"endereco": "Rua das Flores",
"number": "100",
"complemento": "Sala 5",
"bairro": "Centro",
"city": "São Paulo",
"uf": "SP",
"cep": "01001000",
"telefone": "11999998888",
"email": "cliente@exemplo.com"
},
"products": [
{
"codigo": "PROD001",
"name": "Refrigerante 2L",
"ncm": "22021000",
"cest": "0300100",
"gtin": "7891234567895",
"gtin_tributavel": "7891234567895",
"count": 2,
"unit": "UN",
"unit_price": 10.50,
"total_price": 21.00,
"discount_price": 0.00,
"origem": 0,
"indicador_total": 1,
"category_id": "TF123",
"nItemPed": 1
},
{
"codigo": "PROD002",
"name": "Salgadinho 100g",
"ncm": "19053100",
"count": 1,
"unit": "UN",
"unit_price": 8.00,
"total_price": 8.00,
"origem": 0,
"indicador_total": 1,
"category_id": "TF124",
"nItemPed": 2
}
],
"pag_info": [
{
"payment_indicator": "0",
"payment_method": "03",
"amount": 29.00,
"card_info": {
"integration_type": "1",
"brand_code": "01",
"acquirer_cnpj": "01234567000195",
"authorization_code": "AUTH123456"
}
}
]
}
{
"success": true,
"data": {
"uuid": "65f8b9a1c2d3e4f5a6b7c8d9",
"status": "Success",
"motivo": "Rejeição 100: Autorizado o uso da NF-e",
"nfce": 5,
"serie": 1,
"chave": "35260111444777000161650010000000051234567893",
"modelo": "nfce",
"xml": "https://oss.example.com/.../chave.xml",
"danfe": ""
}
}NFC-e Complete Examples
Example 1 — In-Person Sale (no recipient)
{
"nature_of_operation": "Venda de mercadoria",
"issuance_type": "1",
"ambiente": "2",
"ind_pres": "1",
"products": [
{
"codigo": "001",
"name": "Refrigerante 350ml",
"ncm": "22021000",
"count": 3,
"unit": "UN",
"unit_price": 5.50,
"total_price": 16.50,
"category_id": "TF123",
"origem": 0,
"indicador_total": 1
}
],
"pag_info": [
{ "payment_indicator": "0", "payment_method": "17" }
]
}Example 2 — Home Delivery (with recipient)
{
"nature_of_operation": "Venda de mercadoria",
"issuance_type": "1",
"ambiente": "2",
"ind_pres": "4",
"client": {
"cpf": "12345678909",
"name": "Maria Silva",
"endereco": "Rua das Flores",
"number": "456",
"bairro": "Jardim Primavera",
"city": "São Paulo",
"uf": "SP",
"cep": "04567000"
},
"products": [
{
"codigo": "PIZZA01",
"name": "Pizza Grande Marguerita",
"ncm": "19059090",
"count": 1,
"unit": "UN",
"unit_price": 45.90,
"total_price": 45.90,
"category_id": "TF124",
"origem": 0,
"indicador_total": 1
}
],
"pag_info": [
{ "payment_indicator": "0", "payment_method": "03" }
],
"informacoes_complementares": "Entrega em até 40 minutos"
}