Skip to main content

Upload SMS Payment Receipt (v1)

Method & Path

POST /api/v1/workspace/:workspaceId/sms/payments/:paymentId/receipt-image

Description

Upload a receipt image for an SMS payment record.

Authentication

Required: Workspace authentication. User must be authenticated as Workspace Owner or Staff with workspace permissions.

Headers

Authorization: Bearer <workspace_token>
Content-Type: multipart/form-data

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
paymentIdstringYesPayment identifier

Request Body

Form data with file field:

  • file: Receipt image file (max 5MB, supported formats: image/*)

Response 200 OK

{
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"amount": 50.00,
"paymentMethod": "bank-transfer",
"receiptImage": {
"url": "https://storage.googleapis.com/...",
"path": "sms-payments/workspace-id/payment-id/receipt-1234567890-abc123.webp",
"sizeBytes": 50000,
"contentType": "image/webp"
},
"updatedAt": "2025-01-15T11:00:00.000Z"
}

Common Errors

400 Bad Request: Missing file or invalid file format

401 Unauthorized: Missing or invalid authentication token

403 Forbidden: User does not have permission to upload receipts

404 Not Found: Workspace or payment not found

413 Payload Too Large: File size exceeds 5MB limit

422 Unprocessable Entity: Storage quota exceeded

500 Internal Server Error: Server error occurred while processing the request

Notes

  • Image is automatically converted to WebP format
  • Maximum file size is 5MB
  • Storage quota is checked before upload
  • If payment already has a receipt, it will be replaced