Aller au contenu
Sur cette page

InvoiceAttachment

List the invoice's attachments

GET /api/v1/invoices/{id}/attachments

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

Portée du jeton API : invoices.view

Metadata only (file_name, file_size, mime_type, description); bytes come from the download endpoint.

Paramètres

Nom Emplacement Type Requis Description
id path integer oui

Réponses

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

Exemple de requête

curl -X GET "https://kworia.com/api/v1/invoices/{id}/attachments" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json"

Upload an attachment to the invoice

POST /api/v1/invoices/{id}/attachments

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

Portée du jeton API : invoices.create

Multipart file (max 10 MB; pdf, images, office documents, csv, txt) + optional description.

Paramètres

Nom Emplacement Type Requis Description
id path integer oui

Réponses

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

Exemple de requête

curl -X POST "https://kworia.com/api/v1/invoices/{id}/attachments" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json"

Delete an invoice attachment

DELETE /api/v1/invoices/{id}/attachments/{attachmentId}

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

Portée du jeton API : invoices.delete

Soft-deletes the attachment record (it disappears from the listing); the model's deleting hook also removes the stored file, matching the Filament removal path. 404 when the attachment does not belong to the invoice or the organization.

Paramètres

Nom Emplacement Type Requis Description
id path integer oui
attachmentId path integer oui

Réponses

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

Exemple de requête

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

Download an invoice attachment

GET /api/v1/invoices/{id}/attachments/{attachmentId}/download

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

Portée du jeton API : invoices.view

Streams the stored file with its original filename.

Paramètres

Nom Emplacement Type Requis Description
id path integer oui
attachmentId path integer oui

Réponses

Statut Description
200
404

Exemple de requête

curl -X GET "https://kworia.com/api/v1/invoices/{id}/attachments/{attachmentId}/download" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json"