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.
Metadata only (file_name, file_size, mime_type, description); bytes come from the download endpoint. (#847)
Paramètres
| Nom | Emplacement | Type | Requis | Description |
|---|---|---|---|---|
id |
path | integer | oui |
Réponses
| Statut | Description |
|---|---|
| 200 | For non-paginated data, return as before |
Exemple de requête
curl -X GET "https://app.encryptinvoice.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.
Multipart file (max 10 MB; pdf, images, office documents, csv, txt) + optional description. (#847)
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://app.encryptinvoice.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.
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. (#981)
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://app.encryptinvoice.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.
Streams the stored file with its original filename. (#847)
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://app.encryptinvoice.com/api/v1/invoices/{id}/attachments/{attachmentId}/download" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"