Update Status of Payment Method Token
PATCH
https://sand-api.monoova.com/au/card/ccm/PaymentMethodToken/{customerId}/{clientPaymentTokenUniqueReference}
Path Parameters
- customerIdstringrequiredExampleDescriptionDefaultCUST-10045Pattern^[a-zA-Z0-9_-]{1,40}$
- clientPaymentTokenUniqueReferencestringrequiredExampleDescriptionDefaultTOKEN-0001Pattern^[a-zA-Z0-9_-]{1,40}$
Body Parameters
- bodyUpdatePaymentMethodTokenStatusDtorequiredDescription
- statusstringrequiredExampleDescriptionDefaultPausedPattern^(Active|Paused|Deleted)$
Responses
200
- UpdatePaymentMethodTokenStatusResponseExample
{ "traceId": "0c326cdb-ae66-5b11-9c2b-0001fe492e96" }- 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}$
400
- ErrorResponseExample
{ "traceId": "4fa948dd-3148-5f84-8c7d-7921c705b116", "errors": [ { "errorCode": "CCM_STATUS_INVALID", "errorMessage": "Status Suspended is invalid - must be one of [Active, Paused, Deleted]" } ] }- 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": "264734fe-1bf3-561a-b377-b95d7ee48ce7", "errors": [ { "errorCode": "CCM_PM_DISABLED_ERROR", "errorMessage": "PaymentMethodTokens 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": "bd4e05e6-f7be-5681-ab3b-ce23d3a6f989", "errors": [ { "errorCode": "CCM_PM_NOT_FOUND_ERROR", "errorMessage": "Payment method token not found" } ] }- 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": "20956445-fd95-52c2-80bd-0dc165e1c811", "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": "4359384c-7d0a-55bf-9c57-8133d6af5686", "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 PATCH \
--url https://sand-api.monoova.com/au/card/ccm/PaymentMethodToken/{customerId}/{clientPaymentTokenUniqueReference} \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"status": "Paused"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"status": "Paused"
});
var requestOptions = {
method: 'PATCH',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://sand-api.monoova.com/au/card/ccm/PaymentMethodToken/{customerId}/{clientPaymentTokenUniqueReference}", 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/PaymentMethodToken/{customerId}/{clientPaymentTokenUniqueReference}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"status": "Paused"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://sand-api.monoova.com/au/card/ccm/PaymentMethodToken/{customerId}/{clientPaymentTokenUniqueReference}"
payload = json.dumps({
"status": "Paused"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
200
// Success. The status of the payment method token was updated.
{
"traceId": "71170aca-7ed5-5045-b317-39f21a1d985e"
}400
// Bad request. The request failed validation - for example status is not Active, Paused or Deleted.
{
"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 payment method tokens 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 method token matches the customerId and clientPaymentTokenUniqueReference in the path.
{
"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 Payment Method Token Details 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 Payment Method Token Details 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"
}
]
}