Saltar al contingut principal
POST

Aprovar factures en lot

Scope:sales:invoices.write
https://api.holded.com/api/v2/invoices/bulk/approve

Aprova múltiples factures en una única sol·licitud. Cada factura es processa de forma independent: un error en una no bloqueja les altres.

Cos de la petició

object
filterobject | null

Optional scoping filter for the invoices to approve. This endpoint ALREADY targets only invoices pending approval, so for "approve all pending" pass an EMPTY object `{}` — do NOT add a payment status. Narrow only by date range (start_date/end_date) and/or contact (contact_id). The server resolves and approves every matching unapproved invoice (up to 200 per call). Provide either `filter` or `ids`, not both.

start_datestring<date-time>
end_datestring<date-time>
contact_idstring
ids[]string[] | null

Explicit invoice ids to approve (alternative to `filter`, for a specific selection). Max 100.

Petició

python
import requests

url = "https://api.holded.com/api/v2/invoices/bulk/approve"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

payload = {
    "filter": {
        "start_date": "2026-05-01",
        "end_date": "2026-05-31",
        "contact_id": "string"
    },
    "ids": [
        "string"
    ]
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())

Respostes

Respostes exitoses

204Totes les factures aprovades correctament
207Algunes factures no s'han pogut aprovarapplication/json
object
messagestringrequired

Human-readable summary

errors[]string[]optional

Failed document ids (with any reason produced)

success_countintegeroptional

Invoices approved (or already approved)

total_countintegeroptional

Invoices attempted in this request

truncatedbooleanoptional

Present and true when more invoices matched than the per-call limit; narrow the filter to approve the rest

Respostes d'error

400Sol·licitud incorrectaapplication/json
401API key no vàlida o no proporcionadaapplication/json
403Permisos insuficientsapplication/json
422Cap de les factures s'ha pogut aprovarapplication/json
429Límit de sol·licituds exceditapplication/json