Skip to content
On this page

InvoiceAttachment

List the invoice's attachments

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

Requires authentication (Bearer token) and the X-Organization-Id header.

API token scope: invoices.view

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

Parameters

Name In Type Required Description
id path integer yes

Responses

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

Example request

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

Requires authentication (Bearer token) and the X-Organization-Id header.

API token scope: invoices.create

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

Parameters

Name In Type Required Description
id path integer yes

Responses

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

Example request

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}

Requires authentication (Bearer token) and the X-Organization-Id header.

API token scope: 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.

Parameters

Name In Type Required Description
id path integer yes
attachmentId path integer yes

Responses

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

Example request

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

Requires authentication (Bearer token) and the X-Organization-Id header.

API token scope: invoices.view

Streams the stored file with its original filename.

Parameters

Name In Type Required Description
id path integer yes
attachmentId path integer yes

Responses

Status Description
200
404

Example request

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"