Create SMS Payment (v1)
Method & Path
POST /api/v1/workspace/:workspaceId/sms/payments
Description
Create a new 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: application/json
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
Request Body
{
"amount": 50.00,
"paymentMethod": "bank-transfer",
"description": "SMS payment for January 2025",
"notes": "Payment received",
"paymentDate": "2025-01-15T10:30:00.000Z"
}
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Payment amount (must be positive) |
paymentMethod | string | Yes | Payment method (cash, bank-transfer, card, other) |
description | string | No | Payment description |
notes | string | No | Additional notes |
paymentDate | string | No | Payment date (ISO 8601 datetime format) |
Response 201 Created
{
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"amount": 50.00,
"paymentMethod": "bank-transfer",
"description": "SMS payment for January 2025",
"notes": "Payment received",
"paymentDate": "2025-01-15T10:30:00.000Z",
"receiptImage": null,
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z"
}
Common Errors
400 Bad Request: Invalid request body (e.g., invalid amount, invalid payment method)
401 Unauthorized: Missing or invalid authentication token
403 Forbidden: User does not have permission to create SMS payments
404 Not Found: Workspace not found
422 Unprocessable Entity: Validation error
500 Internal Server Error: Server error occurred while processing the request