Documentação do Mercado Livre
Confira todas as informações necessárias sobre as APIs Mercado Livre.
Documentação do
Gestão e Consulta de Notas Fiscais
Tipos de Notas Fiscais
As notas fiscais possuem vários tipos que definem um tipo de operação. Os tipos de notas são:
- SALE: nota fiscal de venda de mercadorias (saída).
- SALE_RETURN: retorno de mercadoria não entregue ao comprador.
- CREDIT_NOTE: nota de crédito emitida para retorno por recusa total, recusa parcial ou não localização da entrega, conforme o modelo de emissão adotado pelo seller.
- DEVOLUTION: devolução de mercadorias pelo comprador.
- INBOUND: nota fiscal de entrada/remessa para depósito temporário ou transferência para estabelecimento filial.
- INBOUND_RETURN: retorno de depósito temporário.
- SYMBOLIC_INBOUND: remessa simbólica para depósito temporário.
- SYMBOLIC_INBOUND_RETURN: retorno simbólico de depósito temporário.
- REMOVAL: retirada de mercadoria / transferência para estabelecimento filial.
- INPUT: alta de estoque (entrada física).
- OUTPUT: baixa de estoque (saída física/simbólica).
- CORRECTION_LETTER: carta de correção.
- CTE: conhecimento de transporte.
Para identificar o tipo de operação na resposta da API, consulte o campo fiscal_data.transaction_type. Nos retornos por insucesso de entrega, o valor pode ser sale_return ou credit_note, conforme o modelo de emissão adotado pelo seller.
Consultar Notas Fiscais
A cada mudança de status da nota fiscal, uma notificação é enviada via feed de invoices. Para consultar os dados da nota fiscal, use uma das três formas abaixo:
- Por invoice_id: quando você tem o identificador da nota.
- Por order_id: quando você quer buscar a nota a partir de uma venda específica.
- Por shipment_id: quando você quer buscar a nota a partir de um envio específico.
Por invoice_id
Busca diretamente pelo identificador da nota fiscal:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/$USER_ID/invoices/$INVOICE_ID
Por order_id
Busca a nota fiscal associada a uma venda específica:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/$USER_ID/invoices/orders/$ORDER_ID
Por shipment_id
Busca a nota fiscal associada a um envio específico:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/$USER_ID/invoices/shipments/$SHIPMENT_ID
Exemplo de resposta
Resposta de exemplo de venda:
{
"id": "123123",
"status": "authorized",
"transaction_status": "authorized",
"issuer": {
"name": "name",
"identifications": {
"cnpj": "11111111111111",
"crt": "normal",
"ie": "11111111111111",
"iest": null,
"ie_type": "contribuinte"
},
"phone": {
"area_code": "01",
"number": "11111111"
},
"address": {
"street_name": "street_name",
"street_number": "123",
"complement": "complement",
"neighborhood": "neighborhood",
"city": "city",
"zip_code": "123123",
"state": "SP",
"country": "BR"
},
"user_id": "123123",
"issuer_identification": null,
"brand_name": null,
"start_activity_date": null,
"origin": null
},
"recipient": {
"name": "name",
"identifications": {
"cnpj": "11111111111111",
"crt": "normal",
"ie": "11111111111111",
"iest": null,
"ie_type": "contribuinte"
},
"phone": null,
"address": {
"street_name": "street_name",
"street_number": "123",
"complement": "complement",
"neighborhood": "neighborhood",
"city": "city",
"zip_code": "123123",
"state": "SC",
"country": "BR"
},
"external_recipient_id": "123123",
"receiver": null,
"discriminated_billing": null
},
"shipment": {
"id": "9876",
"site_id": "MLB",
"mode": "me2",
"logistic_type": "fulfillment",
"buyer_cost": 0,
"paid_by": "third_party",
"carrier": {
"name": "name",
"identifications": {
"cnpj": "11111111111111",
"crt": null,
"ie": "11111111111111",
"iest": null,
"ie_type": "contribuinte"
},
"phone": {
"area_code": "11",
"number": "123123"
},
"address": {
"street_name": "street_name",
"street_number": "123",
"complement": "complement",
"neighborhood": "neighborhood",
"city": "Osasco",
"zip_code": "123123",
"state": "SP",
"country": "Brasil"
}
},
"volumes": [
{
"quantity": null,
"net_weight": 1.92,
"gross_weight": 1.92,
"volume": null
}
],
"fiscal_model_id": "OLSS",
"cte": null,
"logistic_center": null,
"freight": null,
"shipping_locations": null,
"estimated_delivery_date": null,
"destination": null
},
"items": [
{
"id": "123123123_HOMOLOGATION_1704629_1",
"invoice_id": "1704629",
"seller_id": "123123123",
"external_order_id": "LHD_SP_1712997106500",
"external_product_id": "MLB2076036012",
"external_user_product_id": null,
"external_variant_id": null,
"attributes": {
"sku": "101010",
"ean": "123123",
"tributary_ean": "123123",
"type": "single",
"bundle_quantity": null,
"net_weight": null,
"gross_weight": null
},
"product_name": "product_name",
"quantity": 1,
"tributary_quantity": 5,
"total_amount": 8000,
"gross_product_value": null,
"shipping_buyer_cost": 0.0,
"discount_amount": {
"unconditional": 0,
"conditional": null
},
"fiscal_data": {
"attributes": {
"tax_rule_id": 4846,
"ncm": "95065100",
"cest": "2806400",
"origin_type": "reseller",
"origin_detail": "0",
"cfop": "6102",
"measurement_unit": "UN",
"tributary_measurement_unit": "CX",
"tax_substitution": null,
"extipi": "001",
"fci": "29873699-8348-2874-9278-123123123123",
"csosn": null
},
"messages": [
{
"type": "ITEM",
"content": "Total aproximado de tributos federais, estaduais e municipais: R$4.409,60"
}
],
"rules": [
{
"name": "COFINS_COMPOSITION",
"attributes": {
"composition": [
"addition_interest",
"freight",
"exclude_difal"
]
}
},
{
"name": "ICMS_ST_COMPOSITION",
"attributes": {
"composition": [
"item_amount",
"freight",
"discount",
"ipi"
]
}
},
{
"name": "IBS",
"attributes": {
"uf": {
"vibsuf": 3.2,
"predaliq": 60.0,
"paliqefet": 0.04,
"pibsuf": 0.1
},
"vibs": 3.2,
"predaliq": 60,
"mun": {
"vibsmun": 0.0,
"predaliq": 60.0,
"paliqefet": 0.0,
"pibsmun": 0.0
},
"vbcibs": 8000.0,
"pibsuf": 0.1
}
},
{
"name": "ICMS_COMPOSITION",
"attributes": {
"composition": [
"freight",
"addition_interest",
"ipi",
"ibs",
"cbs"
]
}
},
{
"name": "IBPT",
"attributes": {
"municipal_tax": 0.0,
"vibpt": 4409.6,
"pibpt": 55.120000000000005,
"federal_national_tax": 30.12,
"messages": [
{
"type": "item",
"value": "Total aproximado de tributos federais, estaduais e municipais: R$$IBPT_ITEM_VALUE"
}
],
"federal_imported_tax": 48.79,
"state_tax": 25.0
}
},
{
"name": "CBS_COMPOSITION",
"attributes": {
"composition": [
"item_amount"
]
}
},
{
"name": "CBS",
"attributes": {
"pcbs": 0.9,
"vbccbs": 8000.0,
"predaliq": 60.0,
"vcbs": 28.8,
"paliqefet": 0.36
}
},
{
"name": "IBS_COMPOSITION",
"attributes": {
"composition": [
"item_amount"
]
}
},
{
"name": "IBSCBS",
"attributes": {
"cst": "200",
"vbc": 8000.0,
"cclasstrib": "200038",
"vbcibscbs": 8000.0
}
},
{
"name": "PIS_COMPOSITION",
"attributes": {
"composition": [
"addition_interest",
"freight",
"exclude_difal"
]
}
},
{
"name": "ICMS",
"attributes": {
"cst": "00",
"vicms": 963.84,
"vicmsufdest": 0,
"picms": 12.0,
"modbc": 3,
"vbcufdest": 0,
"vfcpufdest": 0,
"vbcfcpufdest": 0,
"vbc": 8032.0,
"pfcp": 0,
"aggregate_invoice_amount": false,
"predbcdest": 0,
"vicmsufremet": 0
}
},
{
"name": "ORIGINAL_VALUE",
"attributes": {
"value": 8000
}
},
{
"name": "IPI",
"attributes": {
"cst": "53",
"aggregate_invoice_amount": false,
"cenq": "999"
}
},
{
"name": "PIS",
"attributes": {
"cst": "08"
}
},
{
"name": "IPI_COMPOSITION",
"attributes": {
"composition": [
"freight",
"addition_interest",
"discount"
]
}
},
{
"name": "COFINS",
"attributes": {
"cst": "08"
}
}
]
},
"original_item": null,
"other_amount": 0,
"reference_quantity": null,
"reference_measure": null,
"payments": null,
"pack_id": null,
"additional_info": null,
"batches": null,
"resale_tax_substitution": null
}
],
"issued_date": "2025-09-19T21:10:49.677Z",
"invoice_series": "813",
"invoice_number": 28790,
"attributes": {
"authorization_date": "2025-09-19T21:10:57",
"invoice_creation_date": "2025-09-19T21:10:49",
"order_source": "external",
"invoice_source": "internal",
"environment_type": "homologation",
"invoice_type": null,
"invoice_key": "99999999999999999999999999999999",
"xml_version": "4.00",
"status_code": 100,
"status_description": "Autorizado o uso da NF-e",
"receipt": null,
"receipt_date": null,
"protocol": "123123123123123",
"emission_type": "normal",
"cancellation_protocol": null,
"cancellation_date": null,
"cancellation_reason": null,
"cancellation_error_code": null,
"cancellation_error_description": null,
"danfe": "http://api.mercadolibre.com/stage/users/123123123/invoices/sites/MLB/documents/danfe/HOMOLOGATION/1704629",
"document": "http://api.mercadolibre.com/stage/users/123123123/invoices/documents/xml/HOMOLOGATION/1704629/authorized",
"cnf": "123123123",
"correction_letter": null,
"reference_invoice": null,
"reference_invoices": [],
"danfe_location": "/users/123123123/invoices/sites/MLB/documents/danfe/1704629",
"xml_location": "/users/123123123/invoices/documents/xml/1704629/authorized",
"include_freight": null,
"external_id": null,
"series_number_history": [],
"third_party_authorizations": null,
"events": null
},
"fiscal_data": {
"customer_type": "b2b",
"transaction_type": "sale",
"transaction_type_description": "Venda de mercadoria para consumidor",
"messages": [
{
"type": "COMPL",
"content": "a"
}
],
"fiscal_amounts": [
{
"name": "icms",
"attributes": {
"vicms": 963.84,
"vicmsufdest": 0,
"vfcp": 0,
"vicmsdeson": 0,
"vbcufdest": 0,
"vfcpufdest": 0,
"vbcst": 0,
"vbcfcpufdest": 0,
"vst": 0,
"vbc": 8032.0,
"vfcpstret": 0,
"vfcpst": 0,
"vicmsufremet": 0
}
},
{
"name": "ipi",
"attributes": {
"vipi": 0
}
},
{
"name": "cbs",
"attributes": {
"pcbs": 0.9,
"vbccbs": 8000.0,
"predaliq": 60.0,
"vcbs": 28.8,
"paliqefet": 0.36
}
},
{
"name": "ibs",
"attributes": {
"vibs": 3.2,
"vibsuf": 3.2,
"vibsmun": 0.0,
"vbcibs": 8000.0
}
},
{
"name": "pis",
"attributes": {
"vpis": 0
}
},
{
"name": "ibpt",
"attributes": {
"vtottrib": 4409.6
}
},
{
"name": "ibscbs",
"attributes": {
"vbcibscbs": 8000.0
}
},
{
"name": "cofins",
"attributes": {
"vcofins": 0
}
},
{
"name": "discount",
"attributes": {
"amount": 0.0
}
}
],
"state_calculation_type": "technical_default",
"customer_transaction": "consumption",
"is_fiscal_order_split": null,
"billing_warehouse_id": null,
"fiscal_data_owner_id": null
},
"payments": null,
"amount": 8000.0,
"items_amount": 8000.0,
"items_gross_amount": null,
"errors": [],
"items_quantity": 1,
"site_id": "mlb",
"other_amount": 0,
"additional_info": null,
"requester_information": null
}
Notas de crédito
Quando fiscal_data.transaction_type retornar credit_note, consulte attributes.invoice_type para identificar o cenário. O valor delivery_refusal corresponde à recusa total ou não localização da entrega; partial_delivery_refusal corresponde à recusa parcial.
Na recusa total ou não localização, a NF-e de origem é informada em attributes.reference_invoices. No XML, a referência aparece em ide/NFref/refNFe. Na recusa parcial, a resposta apresenta a NF-e e o item de origem em items[].reference_item; no XML, a referência aparece em det/DFeReferenciado.
Exemplo de nota de crédito por recusa total (trecho da resposta):
{
"fiscal_data": {"transaction_type": "credit_note"},
"attributes": {
"invoice_type": "delivery_refusal",
"reference_invoices": [{"invoice_key": "<chave da NF-e de origem>"}]
}
}
Exemplo de nota de crédito por recusa parcial (trecho da resposta):
{
"fiscal_data": {"transaction_type": "credit_note"},
"attributes": {"invoice_type": "partial_delivery_refusal"},
"items": [{"reference_item": {
"invoice_key": "<chave da NF-e de origem>",
"item_number": 2
}}]
}
Referência da NF-e por item
Nas NF-e de devolução com finalidade finNFe=4 e referenciamento por item habilitado, cada item devolvido traz a NF-e de origem e o número do item original. Na resposta da API, consulte items[].reference_item.invoice_key e items[].reference_item.item_number. No XML, essas informações aparecem em det/DFeReferenciado/chaveAcesso e det/DFeReferenciado/nItem.
A resposta retorna a referência no mesmo campo items[].reference_item quando esse fluxo está habilitado; não são adicionados novos campos. attributes.reference_invoices relaciona notas fiscais no nível do documento e não substitui a referência de cada item. O referenciamento por item também se aplica à recusa parcial descrita acima; ele não deve ser generalizado para todas as notas de crédito.
Exemplo de devolução com referência por item (trecho da resposta):
{
"fiscal_data": {"transaction_type": "devolution"},
"attributes": {"invoice_type": "devolution"},
"items": [{"reference_item": {
"invoice_key": "<chave da NF-e de origem>",
"item_number": 1
}}]
}
Exemplo de referência por item no XML:
<det nItem="1">
<DFeReferenciado>
<chaveAcesso>chave da NF-e de origem</chaveAcesso>
<nItem>1</nItem>
</DFeReferenciado>
</det>
Download individual de XML
Baixar o XML da nota fiscal
Quando o status da nota for authorized, acesse o XML pelo caminho informado em attributes.xml_location.
Exemplo de chamada:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/$USER_ID/invoices/documents/xml/$INVOICE_ID/authorized
Auditoria da cadeia de notas fiscais
Se você opera no modelo Fulfillment Portaria e precisa de controle detalhado sobre a emissão de notas fiscais, você pode consultar toda a cadeia de notas vinculadas a uma operação.
O campo attributes.reference_invoices na resposta da API contém as notas fiscais relacionadas, como:
- Nota de transferência (inbound)
- Nota de retorno simbólico
Você pode consultar o status de qualquer nota através dos campos status e transaction_status.
Fluxo da cadeia de notas no Fulfillment Portaria
- NF-e de inbound (Matriz Vendedor → Armazém Mercado Livre): envio do inventário.
- NF-e de retorno simbólico (Armazém Mercado Livre → Matriz Vendedor): quando ocorre uma venda.
- NF-e de venda (Vendedor → Comprador): nota fiscal da venda ao consumidor.
Referências
Download em lote
Para solicitar e baixar múltiplos documentos fiscais em arquivos ZIP, consulte Download em lote de documentos fiscais.
Tabela de processos Fulfillment
Consulte a Tabela de processos Fulfillment para relacionar processos operacionais, tipos de transação, naturezas, movimentos e CFOPs.
Seguinte: Mensagens adicionais.