Create an invoice
sales:invoices.writehttps://api.holded.com/api/v2/invoicesCreates a new sales invoice for an existing contact. Invoices track amounts owed to you by customers and are the primary document for revenue recognition. You must provide a `contact_id` referring to an existing contact. Include line items in the `items` array with product/service details, quantities, and prices. Taxes are calculated automatically based on the tax keys provided. The response returns the new invoice `id`. The invoice is created in draft status unless your account settings auto-approve new documents. Use the numbering series (`number_line_id`) to control the document number format.
Request body
Do not reuse an active numbering series format
Do not send number with a value that follows the format of an existing numbering series. The series keeps its own counter and ignores manually assigned numbers. If a series is at number 24 and you create a document manually with 27, the series will keep issuing 25 and 26, and when it reaches 27 it will try to create a number that already exists: the request will fail and you will have lost the correlativity and the order of the series. If you need custom numbering, use a prefix or a format that does not match any active series, or manage every document in that series with number_line_id.
Identifier of an existing contact
Name of the contact
Free-text description of the invoice
Issue date in ISO 8601 format. Accepts date (YYYY-MM-DD) or datetime (e.g. 2026-01-15T00:00:00+00:00)
Payment due date in ISO 8601 format. Accepts date (YYYY-MM-DD) or datetime (e.g. 2026-01-15T00:00:00+00:00)
Internal notes visible only to your team
When true, a line with no taxes of its own, not linked to a catalog product or service, for a contact without default taxes takes the account's default taxes: its sales taxes on a sales document, its purchases taxes on a purchase document. When false or omitted, such a line is created untaxed.
falseRich-text content printed on the invoice
ISO 639-1 language code for the invoice
ISO 4217 currency code
Exchange rate to apply when the currency differs from your account currency
Line items to include in the invoice
Kind of line. `product` and `service` are billable lines whose amount (`units` × `price`, less `discount`, plus `taxes`) is added to the document total. `title` is a section-header line that shows only its `name` and carries no amount — it does not contribute to the total. Other values are special-purpose lines. Omit this field for an ordinary priced line item.
productservicetitleIdentifier of an existing catalog product to link this line to. The id is stored as a reference associating the line with the product (used for stock and reporting). Each line field (`price`, `taxes`, ...) is taken as sent; api2 stores the line values you provide and does not itself read them back from the product record. Leave unset for a free-text line that is not a catalog product.
Identifier of the variant of `product_id` to link this line to. Requires `product_id`. Leave unset for a line without variant.
Identifier of an existing catalog service to link this line to. When provided, the line type is automatically set to `service`. Leave unset for a free-text line that is not a catalog service.
Tax keys applied to this line. When omitted, the contact default tax applies, or, if the contact has none, the account default tax when the request asks for it, else no tax.
Unit cost price for margin calculations
Whether this line is a supply expense (suplido) paid on behalf of the client. Excluded from the tax base.
IRPF withholding percentage to apply to this line. Reduces the invoice total.
Tags to attach to the invoice
Custom field values to set on the invoice
Custom field identifier
Value stored in the custom field
Custom document number. Use only if you do not want to assign the number via one of the numbering series created in Holded (e.g. to replicate exactly the number from another platform). The value is saved as-is, without correlativity validation. If this field is sent, number_line_id is ignored. Warning: do not use a value that matches the format of an existing numbering series. The series keeps its own counter regardless of manually assigned numbers -- e.g. if a series is at number 24 and you manually create a document with 27, the series will keep issuing 25, 26, and when it reaches 27 it will try to create a number that already exists: the request will fail and the series will have lost its correlativity and order. If you need custom numbering, use a prefix or format that does not match any active series, or manage every document in that series with number_line_id.
Identifier of the numbering series used to automatically assign the next correlative number. This is the recommended option, as it preserves the document order and correlativity. If both fields are sent, number takes priority and number_line_id is ignored.
Identifier of the warehouse for stock movements
Identifier of the sales channel
Global discount percentage to apply
Identifier of the default payment method
Direct debit provider used to collect the document. Requires `contact_id` and a `payment_method_id` matching the provider connection, and the contact must have an active mandate. The payment is requested when the document is approved; on accounts without sales draft mode, saving approves the document, so sending this field requests the payment at once, with no confirmation step: it means you accept the charge.
gocardlessIdentifier of the design template to apply to the document
Structured shipping address. Omit to leave unchanged (update) or unset (create). Pass null to clear it. The address fields (name, address_line_1, city, ...) are only used with type=manual; with billing, hidden or contact they are ignored. Use type=contact with contact_address_id to point to an address saved on the contact.
Address mode: manual (uses the address fields), billing (the billing address of the contact), hidden (no address displayed) or contact (an address saved on the contact, requires contact_address_id)
billinghiddenmanualcontactName of the shipping recipient (the given name when family_name is also sent)
Family name of the shipping recipient
Company or organization of the shipping recipient
Primary address line
Secondary address line
City or locality
Postal or ZIP code
State, province, or region
Country name
ISO 3166-1 alpha-2 country code
Contact email for shipping
Contact phone number for shipping
Mobile number for shipping
Identifier of an address saved on the contact (shipping_id in the contact shipping_addresses). Required when type is contact
Request
import requests
url = "https://api.holded.com/api/v2/invoices"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
payload = {
"contact_id": "string",
"contact_name": "string",
"description": "string",
"date": "2026-01-15",
"due_date": "2026-01-31",
"notes": "string",
"default_taxes": false,
"body": "string",
"language": "es",
"currency": "EUR",
"currency_change": 0,
"items": [
{
"name": "string",
"type": "product",
"description": "string",
"product_id": "string",
"variant_id": "string",
"service_id": "string",
"units": 0,
"price": 0,
"discount": 0,
"taxes": [
"s_iva_21"
],
"tags": [
"string"
],
"sku": "string",
"weight": 0,
"cost_price": 0,
"account": "string",
"project_id": "string",
"unit_type": "string",
"supplied": false,
"retention": 0
}
],
"tags": [
"string"
],
"custom_fields": [
{
"field": "string",
"value": "string"
}
],
"number": "string",
"number_line_id": "string",
"warehouse_id": "string",
"sales_channel_id": "string",
"discount": 0,
"payment_method_id": "string",
"direct_debit_provider": "gocardless",
"design_id": "string",
"shipping_address": {
"type": "manual",
"name": "string",
"family_name": "string",
"organization": "string",
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"postal_code": "string",
"province": "string",
"country": "string",
"country_code": "ES",
"email": "string",
"phone": "string",
"mobile": "string",
"contact_address_id": "string"
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())Responses
Response
{
"id": "507f1f77bcf86cd799439011"
}Success responses
201Invoice createdapplication/jsonError responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json422Validation errorapplication/json429Rate limit exceededapplication/json