Cancel Payment
POST
https://sand-api.monoova.com/au/card/ccm/CreditCardTransaction/cancel
Body Parameters
- bodyCancelCreditCardPaymentDtorequiredDescription
- clientTransactionUniqueReferencestringrequiredExampleDescriptionDefaultPAY-20261013-0001Pattern^[a-zA-Z0-9_-]{1,40}$
- reasonstringExampleDescriptionDefaultCustomer cancelled the orderPattern^[ -~]{1,250}$
Responses
200
- CancelCreditCardPaymentResponseExample
{ "traceId": "cdcc846a-16a4-5d5a-bfe5-bddad099eb37", "clientTransactionUniqueReference": "PAY-20261013-0001", "status": "Cancelled" }- traceIdstringExampleDescriptionDefault71170aca-7ed5-5045-b317-39f21a1d985ePattern^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
- clientTransactionUniqueReferencestringExampleDescriptionDefaultPAY-20261013-0001Pattern^[a-zA-Z0-9_-]{1,40}$
- statusstringExampleDescriptionDefaultCancelledPattern^[A-Za-z ]+$
- statusReasonCodestringExampleDescriptionDefault05Pattern^\S+$
- statusReasonDescriptionstringExampleDescriptionDefaultDo not honourPattern^.+$
400
- ErrorResponseExample
{ "traceId": "d8caa49d-5014-5cb8-8a2d-fefaf8a9e102", "errors": [ { "errorCode": "CCM_UID_INVALID", "errorMessage": "clientTransactionUniqueReference PAY.0001 must match ^[a-zA-Z0-9_-]{1,40}$" } ] }- traceIdstringExampleDescriptionDefault71170aca-7ed5-5045-b317-39f21a1d985ePattern^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
- errorsErrorDto[]Description
- errorCodestringExampleDescriptionDefaultCCM_VALIDATION_ERRORPattern^CCM_[A-Za-z0-9_]+$
- errorMessagestringExampleDescriptionDefaultError validating request message - amount.currencyAmount requiredPattern^.+$
- sourceErrorCodestringExampleDescriptionDefaultDECLINEDPattern^\S+$
- sourceErrorMessagestringExampleDescriptionDefaultTransaction declined by issuerPattern^.+$
401
403
- ErrorResponseExample
{ "traceId": "7562224d-f3b7-5626-a35d-405c53554a6e", "errors": [ { "errorCode": "CCM_ACC_DISABLED_ERROR", "errorMessage": "Card transactions disabled for accountId 6279059700012345" } ] }- traceIdstringExampleDescriptionDefault71170aca-7ed5-5045-b317-39f21a1d985ePattern^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
- errorsErrorDto[]Description
- errorCodestringExampleDescriptionDefaultCCM_VALIDATION_ERRORPattern^CCM_[A-Za-z0-9_]+$
- errorMessagestringExampleDescriptionDefaultError validating request message - amount.currencyAmount requiredPattern^.+$
- sourceErrorCodestringExampleDescriptionDefaultDECLINEDPattern^\S+$
- sourceErrorMessagestringExampleDescriptionDefaultTransaction declined by issuerPattern^.+$
404
- ErrorResponseExample
{ "traceId": "a6740ec2-e883-51b3-84fa-d3095bd9ae88", "errors": [ { "errorCode": "CCM_TRN_NOT_FOUND_ERROR", "errorMessage": "CreditCardTransaction not found for Account 6279059700012345 / clientTransactionUniqueReference PAY-20261013-0001" } ] }- traceIdstringExampleDescriptionDefault71170aca-7ed5-5045-b317-39f21a1d985ePattern^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
- errorsErrorDto[]Description
- errorCodestringExampleDescriptionDefaultCCM_VALIDATION_ERRORPattern^CCM_[A-Za-z0-9_]+$
- errorMessagestringExampleDescriptionDefaultError validating request message - amount.currencyAmount requiredPattern^.+$
- sourceErrorCodestringExampleDescriptionDefaultDECLINEDPattern^\S+$
- sourceErrorMessagestringExampleDescriptionDefaultTransaction declined by issuerPattern^.+$
500
- ErrorResponseExample
{ "traceId": "7b9b7e44-2f00-5e8c-a019-ce958688115a", "errors": [ { "errorCode": "CCM_UNEXPECTED_ERROR", "errorMessage": "Internal server error. Please contact Monoova support." } ] }- traceIdstringExampleDescriptionDefault71170aca-7ed5-5045-b317-39f21a1d985ePattern^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
- errorsErrorDto[]Description
- errorCodestringExampleDescriptionDefaultCCM_VALIDATION_ERRORPattern^CCM_[A-Za-z0-9_]+$
- errorMessagestringExampleDescriptionDefaultError validating request message - amount.currencyAmount requiredPattern^.+$
- sourceErrorCodestringExampleDescriptionDefaultDECLINEDPattern^\S+$
- sourceErrorMessagestringExampleDescriptionDefaultTransaction declined by issuerPattern^.+$
502
504
- ErrorResponseExample
{ "traceId": "aebffaac-71ce-5956-bfbb-7e9854bbba9e", "errors": [ { "errorCode": "CCM_CC_GWM_TIMEOUT", "errorMessage": "Timeout from CC Gateway Manager" } ] }- traceIdstringExampleDescriptionDefault71170aca-7ed5-5045-b317-39f21a1d985ePattern^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
- errorsErrorDto[]Description
- errorCodestringExampleDescriptionDefaultCCM_VALIDATION_ERRORPattern^CCM_[A-Za-z0-9_]+$
- errorMessagestringExampleDescriptionDefaultError validating request message - amount.currencyAmount requiredPattern^.+$
- sourceErrorCodestringExampleDescriptionDefaultDECLINEDPattern^\S+$
- sourceErrorMessagestringExampleDescriptionDefaultTransaction declined by issuerPattern^.+$
curl
curl --request POST \
--url https://sand-api.monoova.com/au/card/ccm/CreditCardTransaction/cancel \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"clientTransactionUniqueReference": "PAY-20261013-0001",
"reason": "Customer cancelled the order"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"clientTransactionUniqueReference": "PAY-20261013-0001",
"reason": "Customer cancelled the order"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://sand-api.monoova.com/au/card/ccm/CreditCardTransaction/cancel", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://sand-api.monoova.com/au/card/ccm/CreditCardTransaction/cancel")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"clientTransactionUniqueReference": "PAY-20261013-0001",
"reason": "Customer cancelled the order"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://sand-api.monoova.com/au/card/ccm/CreditCardTransaction/cancel"
payload = json.dumps({
"clientTransactionUniqueReference": "PAY-20261013-0001",
"reason": "Customer cancelled the order"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Success. The cancellation request was processed; check status for the outcome. The API can also return this response with HTTP status 201 Created.
{
"traceId": "71170aca-7ed5-5045-b317-39f21a1d985e",
"clientTransactionUniqueReference": "PAY-20261013-0001",
"status": "Cancelled",
"statusReasonCode": "05",
"statusReasonDescription": "Do not honour"
}400
// Bad request. The request failed validation - for example clientTransactionUniqueReference is missing or invalid, or the payment cannot be cancelled in its current status.
{
"traceId": "71170aca-7ed5-5045-b317-39f21a1d985e",
"errors": [
{
"errorCode": "CCM_VALIDATION_ERROR",
"errorMessage": "Error validating request message - amount.currencyAmount required",
"sourceErrorCode": "DECLINED",
"sourceErrorMessage": "Transaction declined by issuer"
}
]
}401
// Unauthorized. The bearer token is missing, malformed or expired. Generate a new bearer token and retry the request.
403
// Forbidden. Your mAccount is not permitted to perform this operation - for example card payments are not enabled for your account.
{
"traceId": "71170aca-7ed5-5045-b317-39f21a1d985e",
"errors": [
{
"errorCode": "CCM_VALIDATION_ERROR",
"errorMessage": "Error validating request message - amount.currencyAmount required",
"sourceErrorCode": "DECLINED",
"sourceErrorMessage": "Transaction declined by issuer"
}
]
}404
// Not found. No payment matches clientTransactionUniqueReference for your mAccount.
{
"traceId": "71170aca-7ed5-5045-b317-39f21a1d985e",
"errors": [
{
"errorCode": "CCM_VALIDATION_ERROR",
"errorMessage": "Error validating request message - amount.currencyAmount required",
"sourceErrorCode": "DECLINED",
"sourceErrorMessage": "Transaction declined by issuer"
}
]
}500
// Internal server error. An unexpected condition prevented Monoova from completing the request. Retry the request and contact Monoova support if the error persists.
{
"traceId": "71170aca-7ed5-5045-b317-39f21a1d985e",
"errors": [
{
"errorCode": "CCM_VALIDATION_ERROR",
"errorMessage": "Error validating request message - amount.currencyAmount required",
"sourceErrorCode": "DECLINED",
"sourceErrorMessage": "Transaction declined by issuer"
}
]
}502
// Bad gateway. A downstream service returned an invalid response, so the outcome of the request is unknown. Check the result with Get Transaction By Id before you retry.
504
// Gateway timeout. A downstream service did not respond in time, so the outcome of the request is unknown. Check the result with Get Transaction By Id before you retry.
{
"traceId": "71170aca-7ed5-5045-b317-39f21a1d985e",
"errors": [
{
"errorCode": "CCM_VALIDATION_ERROR",
"errorMessage": "Error validating request message - amount.currencyAmount required",
"sourceErrorCode": "DECLINED",
"sourceErrorMessage": "Transaction declined by issuer"
}
]
}