Skip to main content

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-Id when acting as staff if your client does so for other workspace uploads.
  • Admin / Customer: Not applicable for this client workspace API.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <workspace_token>
Content-TypeYesmultipart/form-data
X-Staff-IdNoStaff identifier, if used by your integration

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
supplierIdstringYesSupplier identifier (must exist)

Request Body

Multipart form:

FieldTypeRequiredDescription
filefileYesImage (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 file or 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