Skip to main content

Products

Registering your product or service catalog in Facturapi allows you to store all the necessary data for centralized invoicing and reference that information in future invoices.

When creating an invoice, you can include the information of your product or service in 2 different ways:

  1. In the items > product field, by sending an object with the product or service information.
  2. In the items > product field, by sending the id of a previously registered product.

Both options are valid and we recommend using the one that best suits your use case.

Examples

The following examples show how to register the information of your product or service to be used in future invoices.

To learn about all the arguments you can include in the call, check the Create Product method reference.

Product with 16% VAT and taxes included (default)

By default, it is assumed that the price of a product includes taxes, and that the product has a 16% VAT tax.

Facturapi takes care of breaking down the taxes and calculating the unit price.

const product = await facturapi.products.create({
description: 'Ukelele',
product_key: '60131324',
price: 345.60,
sku: 'ABC1234'
});

which is equivalent to:

const product = await facturapi.products.create({
description: 'Ukelele',
product_key: '60131324',
price: 345.60,
sku: 'ABC1234',
tax_included: true,
taxes: [
{
type: 'IVA',
rate: 0.16
}
]
});

The product would be invoiced as:

Unit price297.93
IVA 16%47.67
Total price345.60

Product with unit price before taxes

const product = await facturapi.products.create({
description: 'Ukelele',
product_key: '60131324',
price: 345.60,
sku: 'ABC1234',
tax_included: false,
taxes: [
{
type: 'IVA',
rate: 0.16
}
]
});

The product would be invoiced as:

Unit price345.60
IVA 16%55.30
Total price400.90

Product with rate 0% VAT

const product = await facturapi.products.create({
description: 'Ukelele',
product_key: '60131324',
price: 345.60,
sku: 'ABC1234',
tax_included: false,
taxes: [
{
type: 'IVA',
rate: 0
}
]
});

Product with VAT exemption

const product = await facturapi.products.create({
description: 'Ukelele',
product_key: '60131324',
price: 345.60,
sku: 'ABC1234',
tax_included: false,
taxes: [
{
type: 'IVA',
factor: 'Exento',
rate: 0
}
]
});