Upload Expense Receipt (v1)
Method & Path
POST /api/v1/client/workspace/:workspaceId/expenses/:expenseId/receipt
Description
Upload a receipt image for an expense record. The image will be processed, optimized, and stored in cloud storage.
Authentication
Required: Workspace authentication. User must be authenticated as Workspace Owner or Staff with financial permissions.
Headers
Authorization: Bearer <workspace_token>
Content-Type: multipart/form-data
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
expenseId | string | Yes | Expense identifier |
Request Body
The request must be sent as multipart/form-data with a file field named file.
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Receipt image file (max size: 10MB). Supported formats: JPEG, PNG, WebP |
Response 201 Created
{
"url": "https://storage.googleapis.com/bucket/workspace-expenses/expense-id/receipt-1234567890-abc123.webp",
"path": "workspace-expenses/expense-id/receipt-1234567890-abc123.webp",
"width": 1000,
"height": 1000,
"sizeBytes": 50000,
"contentType": "image/webp"
}
Response Fields
url(string): Public URL to access the receipt imagepath(string): Server path to the receipt imagewidth(number | null): Image width in pixels (if available)height(number | null): Image height in pixels (if available)sizeBytes(number | null): Image file size in bytes (if available)contentType(string): MIME type of the image (typicallyimage/webpafter processing)