Overview
The Payments API provides a complete workflow for processing payments through CommerceCash.| Step | Method | Endpoint | Description |
|---|---|---|---|
| 1 | POST | /api/payments/initiate | Initiate a new payment transaction |
| 2 | POST | /api/payments/confirm | Confirm a pending payment |
| 3 | GET | /api/payments/{transactionId}/status | Query status by Transaction ID |
| 3 | GET | /api/payments/reference/{referenceNo}/status | Query status by Merchant Reference No |
Response Envelope
All endpoints return a unifiedBaseResponse<T> envelope.
| Field | Type | Description |
|---|---|---|
isSuccess | boolean | true if the operation succeeded |
errorCode | string | Uppercase error code when isSuccess is false |
message | string | Human-readable outcome or error description |
data | object | Response payload; null when isSuccess is false |
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
VALIDATION_ERROR | 400 | Request model validation failed |
INVALID_REQUEST | 400 | Malformed or logically invalid request |
INVALID_SIGNATURE | 400 | Request signature verification failed |
PRODUCT_NOT_FOUND | 400 | The specified product code does not exist |
INVALID_EXTRA_PROPERTIES | 400 | The extraProperties JSON string is malformed |
INVALID_TRANSACTION_ID | 400 | transactionId is missing or empty |
INVALID_REFERENCE_NO | 400 | referenceNo is missing or empty |
TRANSACTION_NOT_FOUND | 404 | No transaction matches the given ID or reference number |
INTERNAL_ERROR | 500 | An unexpected server-side error occurred |