Skip to main content

Overview

The Payments API provides a complete workflow for processing payments through CommerceCash.
StepMethodEndpointDescription
1POST/api/payments/initiateInitiate a new payment transaction
2POST/api/payments/confirmConfirm a pending payment
3GET/api/payments/{transactionId}/statusQuery status by Transaction ID
3GET/api/payments/reference/{referenceNo}/statusQuery status by Merchant Reference No

Response Envelope

All endpoints return a unified BaseResponse<T> envelope.
{
  "isSuccess": true,
  "errorCode": null,
  "message": null,
  "data": {}
}
FieldTypeDescription
isSuccessbooleantrue if the operation succeeded
errorCodestringUppercase error code when isSuccess is false
messagestringHuman-readable outcome or error description
dataobjectResponse payload; null when isSuccess is false

Error Codes

CodeHTTP StatusDescription
VALIDATION_ERROR400Request model validation failed
INVALID_REQUEST400Malformed or logically invalid request
INVALID_SIGNATURE400Request signature verification failed
PRODUCT_NOT_FOUND400The specified product code does not exist
INVALID_EXTRA_PROPERTIES400The extraProperties JSON string is malformed
INVALID_TRANSACTION_ID400transactionId is missing or empty
INVALID_REFERENCE_NO400referenceNo is missing or empty
TRANSACTION_NOT_FOUND404No transaction matches the given ID or reference number
INTERNAL_ERROR500An unexpected server-side error occurred

Amount Handling

Payment amounts in the Initiate request and response are expressed in the smallest currency unit (e.g., cents for MYR) to avoid floating-point precision issues.
ValueEquivalent
1001.00 MYR
349134.91 MYR
15000150.00 MYR
The amount field in Confirm and Status responses is returned as a standard decimal value (e.g., 150.00).