Facturación

Crear Billing Document PPD

Changed on

Emite un billing document PPD (pago en parcialidades o diferido) para un Invoice.

Genera el CFDI de tipo PPD ante Facturama y registra el evento de creación. La operación es idempotente por Invoice mediante un lock. Devuelve los billing documents emitidos.

post/billing-documents/ppd

Request

  • Base URL
    https://api.trytoku.com
  • URL
    https://api.trytoku.com/billing-documents/ppd
  • Auth
    API key in header x-api-key

Headers

x-account-keystring

Llave de API de una Account, para operar sobre esa Account en lugar de la principal.

Request body

checkout_session_idstring

Identificador de la Checkout Session, cuando el Invoice se identifica por ella. Alternativa a id_invoice.

id_accountstring required

Identificador público de la Account que emite el CFDI. Determina el certificado y el folio con que se timbra.

id_invoicestring

Identificador público del Invoice a timbrar. Se envía este o checkout_session_id, nunca los dos.

issue_datestring date-time

Fecha de emisión en formato ISO 8601. Si se omite, se usa la del momento del timbrado.

Example request

{
  "checkout_session_id": "cs_7Hn2kLm0QpXr7Zt3Wv1Nb8Yc4Ad6Ge5J",
  "id_account": "acc_Nkj5FQ4blAzg-ieIKeRpULgj4hjTf-UJ",
  "id_invoice": "in_K3a1P1_p_t5UHJHJXmpkQYmqXCHvXrNi",
  "issue_date": "2026-08-12T10:30:00"
}

Response

Successful Response

billing_addressstring
billing_emailstring
checkout_session_idstring
discountnumber required
fiscal_billing_idstring required
foliostring required
id_accountstring required
id_billing_documentstring required
id_customerstring
id_invoicestring
id_transactionstring
issue_datestring date-time required
pdf_urlstring required
provider_external_idstring required
public_pdf_urlstring
public_xml_urlstring
related_fiscal_billing_idstring
status'ISSUED' | 'FAILED' | 'CANCELLED' | 'PENDING_CANCELLATION'

Estado de un comprobante fiscal mexicano ante el SAT. Nace ISSUED, que es el documento ya timbrado y vigente. Pedir su cancelación lo deja en PENDING_CANCELLATION mientras el receptor la acepta, y el documento sigue vigente durante esa espera: pasa a CANCELLED si la acepta, y vuelve a ISSUED si la ventana de aceptación vence sin respuesta.

FAILED está declarado pero ningún flujo lo emite: el comprobante se registra solo después de timbrarse, así que un timbrado fallido no deja documento.

sub_totalnumber required
tax_idstring required
tax_regimestring required
tax_zip_codestring required
totalnumber required
type'INVOICE' | 'CREDIT_NOTE' | 'COMPLEMENT'

Clase de comprobante fiscal mexicano (CFDI) que se emitió: INVOICE es la factura de ingreso que documenta la venta, COMPLEMENT el complemento de pago que acusa el pago de una factura PPD ya emitida, y CREDIT_NOTE la nota de crédito que rebaja o revierte un comprobante anterior, relacionada al CFDI original.

xml_urlstring required

Changes

    • breaking

      request body became required

    • breaking

      the request property format changed from no format to date-time

    • breaking

      removed the success response with the status

    • info

      api operation id ppd removed and replaced with create_ppd_billing_document

    • info

      api tag Facturación added

    • info

      added the new optional header request parameter x-account-key

    • info

      added the new optional request property

    • info

      the request property became optional

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      added the success response with the status