Get an invoice
Return everything stored about one invoice of the calling issuer: its version, the whole CFDI document (cfdi), and the stamp and cancellation data, which are null until the invoice is signed / canceled, and receiver_request: null, or the state of its receiver request link (status open, stamped, expired or revoked, failed_attempts and last_error, never the url). Also carries direction (issued or received) and origin (cefidia or sat), and template_id and template_note, which are the template a draft was made from and its note, null for any other invoice; the id is explicit, so a received CFDI is found by its id whatever list_cfdi' direction default is. Also carries downloads: null for a draft, otherwise {xml, pdf}, the links to download the stamped XML and PDF, each {filename, content_type, size_bytes, download_url} or {error} when its file cannot be checked or rendered. Open a link in a browser to save the file; the file never passes through this tool. A PDF not generated yet is generated once, here, before its link is returned. The links never expire, are the same on every call and show the CFDI's current state (a canceled one has its PDF marked as canceled). Anyone who holds a link can download the file, so it can be given to the receiver; do not post it anywhere public.
Alcance (scope): invoices:read · Características: Solo lectura, Idempotente
Parámetros¶
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
invoice_id |
string | Sí | |
direction |
string | No | Optional narrowing; all (default) finds any direction. |
origin |
string | No | Optional narrowing; every origin when omitted. |
issuer |
string | Sí | Id of the issuer the call acts for, from list_issuers. |
Esquema de entrada (JSON Schema)¶
{
"type": "object",
"properties": {
"invoice_id": {
"type": "string"
},
"direction": {
"type": "string",
"enum": [
"issued",
"received",
"all"
],
"description": "Optional narrowing; all (default) finds any direction."
},
"origin": {
"type": "string",
"enum": [
"cefidia",
"sat"
],
"description": "Optional narrowing; every origin when omitted."
},
"issuer": {
"type": "string",
"format": "uuid",
"description": "Id of the issuer the call acts for, from list_issuers."
}
},
"required": [
"invoice_id",
"issuer"
]
}