Saltar a contenido

Replace a draft's CFDI document

Replace the whole CFDI document of a draft: cfdi is the complete new Comprobante, and nothing of the old one is kept. expected_version is the draft's revision counter (the version field of get_cfdi, which starts at 1 and goes up on every change), not the CFDI Version attribute (4.0). A stale expected_version answers a conflict with the current version. Drafts only: a signed or canceled CFDI answers invalid_state, and so does a draft with an open receiver request (revoke_receiver_request closes it). Returns the stored CFDI in the get_cfdi shape with the new version.

Alcance (scope): invoices:write · Características: Destructiva, Idempotente

Parámetros

Parámetro Tipo Obligatorio Descripción
invoice_id string Sí
expected_version integer Sí The draft's version from get_cfdi (starts at 1), not the CFDI Version attribute.
cfdi object Sí The CFDI 4.0 Comprobante document.
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"
    },
    "expected_version": {
      "type": "integer",
      "minimum": 1,
      "description": "The draft's version from get_cfdi (starts at 1), not the CFDI Version attribute."
    },
    "cfdi": {
      "type": "object",
      "description": "The CFDI 4.0 Comprobante document."
    },
    "issuer": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the issuer the call acts for, from list_issuers."
    }
  },
  "required": [
    "invoice_id",
    "expected_version",
    "cfdi",
    "issuer"
  ]
}