Upload Supplier Payment Image (v1)
Method & Path
POST /api/v1/workspace/:workspaceId/suppliers/:supplierId/payment-image
Actual backend path: POST /v1/workspace/:workspaceId/suppliers/:supplierId/payment-image
Description
Upload a receipt or document image for a supplier payment (PNG, JPEG, or WebP). The file is converted to WebP and stored in workspace object storage. Use the returned url as imageUrl when creating or updating a payment.
Authentication
Required: Workspace JWT.
Persona access
- Workspace Owner: Allowed (suppliers section enabled for workspace).
- Staff: Allowed when suppliers access is granted via workspace menu/permissions; include
X-Staff-Idwhen acting as staff if your client does so for other workspace uploads. - Admin / Customer: Not applicable for this client workspace API.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <workspace_token> |
Content-Type | Yes | multipart/form-data |
X-Staff-Id | No | Staff identifier, if used by your integration |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
supplierId | string | Yes | Supplier identifier (must exist) |
Request Body
Multipart form:
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Image (PNG, JPEG, or WebP) |
Response 201 Created
{
"image": {
"url": "https://storage.googleapis.com/bucket/supplier-financial/.../img-....webp",
"path": "supplier-financial/.../img-....webp",
"width": 800,
"height": 600,
"sizeBytes": 45210,
"contentType": "image/webp"
}
}
Common Errors
- 400 Bad Request: Missing
fileor empty upload - 401 Unauthorized: Missing or invalid token
- 403 Forbidden: Workspace access denied
- 404 Not Found: Workspace or supplier not found
- 422 Unprocessable Entity: Unsupported MIME type or file too large; storage quota exceeded
- 500 Internal Server Error: Storage not configured or upload failure