Aller au contenu
Sur cette page

Batch

Batch create/update/send of invoices and bulk resource deletion

Batch create invoices

POST /api/v1/batch/invoices/create

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : invoices.create

Creates up to 100 invoices. Each item is held to exactly the rules of POST /api/v1/invoices (tax resolved from the organization defaults, invoice quota checked per item). Partial success: a refused item is listed in errors with its index and the rest are created.

Corps de la requête

Champ Type Requis Description
invoices array oui

Réponses

Statut Description
201 Batch processed; created lists the created invoices, errors the refused items.
422

Exemple de requête

curl -X POST "https://kworia.com/api/v1/batch/invoices/create" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "invoices": []
}'

Batch send invoices

POST /api/v1/batch/invoices/send

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : invoices.send

Sends multiple invoices via email and/or PEPPOL e-invoicing network. Supports partial failures - some invoices may succeed while others fail.

Corps de la requête

Champ Type Requis Description
method string non
message string non
attach_pdf boolean non
invoice_ids array oui
peppol_recipient object non

Réponses

Statut Description
200 For non-paginated data, return as before
422

Exemple de requête

curl -X POST "https://kworia.com/api/v1/batch/invoices/send" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "string",
    "message": "string",
    "attach_pdf": true,
    "invoice_ids": [],
    "peppol_recipient": {}
}'

Batch update invoices

POST /api/v1/batch/invoices/update

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : invoices.update.any

Updates up to 100 invoices. Each item's data is held to exactly the rules of PUT /api/v1/invoices/{id} and applied through the same service, so locked or issued invoices are refused and totals are recomputed. Partial success: refused items are listed in errors.

Corps de la requête

Champ Type Requis Description
updates array oui

Réponses

Statut Description
200 Batch processed; updated lists the updated invoices, errors the refused items.
422

Exemple de requête

curl -X POST "https://kworia.com/api/v1/batch/invoices/update" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "updates": []
}'

Batch delete resources

DELETE /api/v1/batch/resources

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : l’une de invoices.delete, quotes.delete, expenses.delete, customers.delete

Deletes up to 100 invoices, quotes, expenses or customers of the organization, with the same rules as the single delete (e.g. a billed expense is refused). Partial success: refused ids are listed in errors.

Paramètres

Nom Emplacement Type Requis Description
resource query string oui
ids[] query array oui

Réponses

Statut Description
200 Batch processed; deleted lists the deleted ids, errors the refused ones.
422

Exemple de requête

curl -X DELETE "https://kworia.com/api/v1/batch/resources" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json"