Update Invoice Addition (v1)
Update an existing invoice addition for a workspace.
Method & Path
PATCH /api/v1/admin/workspaces/:workspaceId/invoice-additions/:additionId
Description
Updates an existing invoice addition. All fields are optional - only provided fields will be updated. The total is automatically recalculated as quantity × unitPrice.
Authentication
Required: Admin authentication with businesses.manage permission.
Headers
Authorization: Bearer <admin_token>
Content-Type: application/json
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | The workspace ID |
additionId | string | Yes | The invoice addition ID |
Request Body
{
"reason": "Additional 2GB storage",
"quantity": 2,
"unitPrice": 2.00
}
Request Body Schema
All fields are optional. Only provided fields will be updated.
| Field | Type | Required | Description |
|---|---|---|---|
reason | string | No | Description/reason for the addition (1-500 characters) |
quantity | number | No | Quantity (must be > 0) |
unitPrice | number | No | Unit price in USD (must be >= 0) |
Response 200 OK
{
"message": "Invoice addition updated successfully",
"addition": {
"id": "507f1f77bcf86cd799439013",
"reason": "Additional 2GB storage",
"quantity": 2,
"unitPrice": 2.00,
"total": 4.00,
"createdAt": "2024-01-15T10:00:00.000Z",
"createdBy": "507f1f77bcf86cd799439014"
}
}
Common Errors
- 401 Unauthorized: Missing or invalid admin authentication token
- 403 Forbidden: Insufficient permissions (missing
businesses.managepermission) - 404 Not Found: Workspace or invoice addition not found
- 400 Bad Request: Invalid request body or validation errors
- 422 Unprocessable Entity: Validation errors
- 500 Internal Server Error: Server error