Llistat de factures
sales:invoices.readhttps://api.holded.com/api/v2/invoicesRetorna una llista paginada de factures del teu compte. Els resultats estan paginats per cursor.
Paràmetres
Paràmetres de consulta
integeropcional= 50Nombre màxim de factures a retornar per pàgina. Per defecte 25, màxim 100
stringopcionalCursor opac per a la paginació. Utilitza el valor retornat a la resposta anterior
stringopcionalFiltrar factures per identificador de contacte
stringopcionalFiltrar factures per estat de pagament
"pending""completed""partial""cancelled""failed""overdue""outstanding"string<date-time>opcionalRetornar només factures emeses en aquesta data o després (RFC 3339)
string<date-time>opcionalRetornar només factures emeses en aquesta data o abans (RFC 3339)
string<date-time>opcionalFiltrar factures el venciment de les quals sigui en aquesta data o després. Accepta ISO 8601 o només data (YYYY-MM-DD)
string<date-time>opcionalFiltrar factures el venciment de les quals sigui en aquesta data o abans. Combina amb status=pending per llistar factures vençudes (posa aquí la data de tall). Accepta ISO 8601 o només data (YYYY-MM-DD)
stringopcionalOrdre dels resultats. Anteposa - per a ordre descendent.
"date""-date""dueDate""-dueDate""total""-total"stringopcionalFiltrar per estat d'aprovació. Utilitza "draft" per a esborranys i "approved" per a documents aprovats
"draft""approved"integeropcionalFiltrar factures amb almenys una línia imputada a aquest compte comptable, identificat pel seu codi PGC numèric (p. ex. 70000000). Només s'accepta el codi numèric; un valor no numèric retorna 400. En usar-se a través de l'assistent d'IA, el nom del compte es resol automàticament al seu codi abans d'arribar a l'endpoint
Petició
import requests
url = "https://api.holded.com/api/v2/invoices?limit=50&cursor=value&contact_id=value"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.get(url, headers=headers)
print(response.json())Respostes
Resposta
{
"items": [
{
"id": "507f1f77bcf86cd799439011",
"document_number": "INV-0001",
"contact_id": "507f1f77bcf86cd799439011",
"contact_name": "Acme Corp",
"description": "string",
"date": "2024-01-15",
"due_date": "2024-02-15",
"subtotal": "100.00",
"discount": "0",
"total": "121.00",
"tax": "21.00",
"currency": "EUR",
"status": "pending",
"tags": [
"string"
],
"lines": [
{
"line_id": "...",
"name": "...",
"description": "...",
"price": "...",
"units": "...",
"discount": "...",
"tax": "...",
"taxes": "...",
"tags": "...",
"product_id": "...",
"variant_id": "...",
"service_id": "...",
"sku": "...",
"weight": "...",
"cost_price": "...",
"account": "...",
"project_id": "...",
"retention": "...",
"unit_type": "...",
"supplied": "..."
}
],
"payment_method_id": "string",
"payments_total": "0",
"payments_pending": "121.00"
}
],
"has_more": false,
"cursor": "string"
}Respostes exitoses
200Llistat de facturesapplication/jsonUnique identifier of the document
Sequential number assigned to the document
Identifier of the contact associated with this document
Name of the contact associated with this document
Free-text description of the document
Issue date of the document in ISO 8601 format
Payment due date in ISO 8601 format
Sum of all line amounts before tax and discounts, as a decimal string
Total discount applied to the document, as a decimal string
Final amount including taxes and discounts, as a decimal string
Total tax amount, as a decimal string
ISO 4217 currency code
Current status of the document
failedcompletedpendingpartialcancelledList of tags attached to the document
Line items included in the document
Identifier of the default payment method for this invoice
Total amount already paid, as a decimal string
Remaining amount to be paid, as a decimal string
Opaque cursor to pass as ?cursor= to fetch the next page. Null on the last page.
Respostes d'error
400El paràmetre accounting_account_num ha de ser un enter positiu (codi PGC)application/json401API key no vàlida o no proporcionadaapplication/json403Permisos insuficientsapplication/json404No existeix cap compte comptable amb el número indicat al tenantapplication/json429Límit de sol·licituds exceditapplication/json