Skip to main content

Payment Invoice

The Payment Invoice, also known as Electronic Payment Receipt (EPR) or simply payment complement, is used to provide fiscal proof that the organization has received a payment for goods or services delivered in the past.

To issue a Payment Invoice, there must be an Income Invoice that is created at the time of delivery of the goods or services and whose payment method is registered with the value "PPD" (Partial or Deferred Payment).

Examples

Below are some common use cases.

To fully understand all the available options when creating a Payment Invoice, detailed descriptions of each field, and the most commonly used catalogs, please refer to the Create Invoice method reference, and then click on the Payment invoice type.

Full payment of a pending invoice

In this example, a single payment is received to fully settle a pending invoice for $345.60 MXN.

const Facturapi = require('facturapi');
const facturapi = new Facturapi('sk_test_API_KEY');

const invoice = await facturapi.invoices.create({
type: 'P',
customer: {
legal_name: 'Dunder Mifflin',
email: 'email@example.com',
tax_id: 'ABC101010111',
tax_system: '601',
address: {
zip: '85900'
}
},
complements: [
{
type: 'pago',
data: {
payment_form: '28', // Tarjeta de Crédito
related_documents: [
{
uuid: '39c85a3f-275b-4341-b259-e8971d9f8a94',
amount: 345.60,
installment: 1,
last_balance: 345.60,
taxes: [
{
base: 297.93,
type: 'IVA',
rate: 0.16
}
]
}
]
}
}
]
});

Partial payment of a pending invoice

In this example, $100 MXN is received as payment for the second installment of a pending invoice with a total of $345.60 MXN. It is assumed that $100 MXN was also paid in the first installment.

const Facturapi = require('facturapi');
const facturapi = new Facturapi('sk_test_API_KEY');

const invoice = await facturapi.invoices.create({
type: 'P',
customer: {
legal_name: 'Dunder Mifflin',
email: 'email@example.com',
tax_id: 'ABC101010111',
tax_system: '601',
address: {
zip: '85900'
}
},
complements: [
{
type: 'pago',
data: {
payment_form: '28', // Tarjeta de Crédito
related_documents: [
{
uuid: '39c85a3f-275b-4341-b259-e8971d9f8a94',
amount: 100, // Monto de la factura relacionada que se paga en la presente parcialidad
installment: 2, // Esta es la segunda parcialidad
last_balance: 245.60, // Saldo insoluto de la primera parcialidad
taxes: [
{
base: 86.21, // Base de IVA de la segunda parcialidad
type: 'IVA',
rate: 0.16
}
]
}
]
}
}
]
});