The MDF-e API (model 58, layout PL-MDFe 3.00) allows you to issue, query, cancel and close transport manifests. The MDF-e aggregates NF-es and/or CT-es linked to a transport operation, supporting 4 modes: road, air, waterway and rail. All operational information (driver, vehicle, contracting party, CIOT, toll voucher, payment) goes in the body of the /create — there are no inclusion/amendment events after issuance.
Issues an MDF-e from the submitted body. The fields cMDF, cDV, cUF, dhEmi, mod, tpEmis, procEmi, verProc are calculated automatically by the server. The client sends only the business fields. The fields serie and nMDF are optional: they are allocated automatically when omitted (or set to 0), but are honored when sent (useful for skipping the numbering, e.g. after a duplicate at the tax authority).
Required headers
Header
Type
Description
token
string
Token of the issuing company
sign
string
MD5 signature: MD5(token + path + body + timestamp)
timestamp
string
Unix timestamp in seconds (5-minute window)
Body — root
Field
Type
Description
ide *
object
Identification of the MDF-e
emit *
object
Issuer data
infModal *
object
Mode information (only ONE of the four: rodo, aereo, aquav, ferrov)
infDoc *
object
Linked fiscal documents
tot *
object
Cargo totalizers
prodPred
object
Predominant product of the cargo
seg
array
Insurance information
lacres
array
Seals of the MDF-e
autXML
array
CNPJs/CPFs authorized to access the XML
infAdic
object
Additional information (tax authority and taxpayer)
MDF-e series (3 digits of the access key). Optional — auto-allocated (the company's MDF-e series) when omitted or 0; respected when sent
nMDF
int
MDF-e number (part of the access key). Optional — auto-incremented by the server when omitted or 0; respected when sent (useful for skipping numbering, e.g.: after a duplicate)
Closes an MDF-e at the end of the trip. After closing, it is no longer possible to cancel. The fields dtEnc, cUF and cMun are optional — when omitted, the system infers them from the original MDF-e (current date, UF and municipality of the issuer).
Required headers
Header
Type
Description
token
string
Token of the issuing company
sign
string
MD5 signature
timestamp
string
Unix timestamp in seconds
Body
Field
Type
Description
chMDFe *
string
Access key of the MDF-e (44 digits)
dtEnc
string
Closing date (YYYY-MM-DD). Default: current date
cUF
int
IBGE code of the UF where the closing occurred. Default: UF of the issuer
cMun
string
IBGE code of the municipality where the closing occurred. Default: municipality of the issuer
Lists the company's MDF-e with pagination. Parameters are passed via query string (not in the body). The time filter is optional, but if used, both start_create_time and end_create_time are required.
Required headers
Header
Type
Description
token
string
Issuing company token
sign
string
MD5 signature (path includes the query string)
timestamp
string
Unix timestamp in seconds
Query string
Parameter
Type
Description
page *
int
Page number (≥ 1)
page_size *
int
Page size (1–50)
start_create_time
long
Unix timestamp in milliseconds — start (requires end_create_time)