Skip to main content

Income invoices

The Income invoice, also known simply as an invoice, is a document used to record an income of money in exchange for the delivery of goods or a service. It details the conditions of the exchange, such as the payment method, and whether the payment is received at that time or agreed to be collected later.

The most common case is to issue an invoice for a sale, and send it by email to your customer, or make it available for download.

What if I don't have the customer's tax information?

If at the time of receiving a payment your customer does not ask for an invoice, you can create a Digital Receipt that you can send to the customer to complete their information on a self-service portal.

Examples

Below are some common use cases.

To fully understand all the options available when creating an invoice, detailed descriptions of each field and the most commonly used catalogs, consult the Create Invoice method reference.

In this example, the payment is received at the same time as the goods or service is delivered.

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

const invoice = await facturapi.invoices.create({
customer: {
legal_name: 'Dunder Mifflin',
email: 'email@example.com',
tax_id: 'ABC101010111',
tax_system: '601',
address: {
zip: '85900'
}
},
items: [{
quantity: 2,
product: {
description: 'Ukelele',
product_key: '60131324', // Product key from SAT's catalog
price: 345.60,
taxes: [
{
type: 'IVA',
rate: 0.16
}
]
}
}],
use: 'G01',
payment_form: "28" // key for "Debit card"
});

Non-paid invoices

In this example, the goods or service are delivered, but payment is not received yet.

Later, when you receive a payment, either for the full amount or a partial payment, you must issue a Payment invoice.

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

const invoice = await facturapi.invoices.create({
customer: {
legal_name: 'Dunder Mifflin',
email: 'email@example.com',
tax_id: 'ABC101010111',
tax_system: '601',
address: {
zip: '85900'
}
},
items: [{
quantity: 2,
product: {
description: 'Ukelele',
product_key: '60131324', // Product key from SAT's catalog
price: 345.60,
taxes: [
{
type: 'IVA',
rate: 0.16
}
]
}
}],
use: 'G01',
payment_form: "99", // key for "To be defined" from SAT's catalog
payment_method: 'PPD', // key for "Payment in installments or deferred" from SAT's catalog
conditions: 'Fecha límite de pago: 2022-01-01' // Free text specifying the payment conditions such as the due date
});