Payments Internal REST APIs
Mapping for rejection reasons
The rejection reason is mapped based on the failure codes received by the payments service.
The following examples show the mapping between the failure codes and the resulting rejection reason.
Case 1
The failure code starts with:
urn:plmr-internal:workflow:payments
Case 1.1
The failure code is:
{
"code": "urn:plmr-internal:workflow:payments:INITIATE_PAYMENT_ORDER:ACCOUNT_ACCESS_RESTRICTED",
"message": "" // ignored
}
The resulting rejection reason becomes:
"rejectionReason": {
"code": "urn:plmr:payments:initiation:ACCOUNT_ACCESS_RESTRICTED",
"message": "Payment rejected due to incorrect IBAN"
}
Case 1.2
The failure code is:
{
"code": "urn:plmr-internal:workflow:payments:INITIATE_PAYMENT_ORDER:ACCOUNT_CURRENCY_MISMATCH",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:initiation:ACCOUNT_CURRENCY_MISMATCH",
"message": "Payment rejected due to debtor account currency mismatch"
}
Case 1.3
The failure code doesn’t match any of the known failure codes:
{
"code": "urn:plmr-internal:workflow:payments:NOT_HANDLED_ERROR",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:initiation:INTERNAL_TECHNICAL_ERROR",
"message": "Internal technical error"
}
Case 2
The failure code starts with:
urn:plmr-internal:transactions:
Case 2.1
The failure code matches the following regular expression:
urn:plmr-internal:transactions:.+:INSUFFICIENT_FUNDS
Example:
{
"code": "urn:plmr-internal:transactions:ANY_SOURCE:INSUFFICIENT_FUNDS",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:core:INSUFFICIENT_FUNDS",
"message": "Payment rejected due to insufficient funds"
}
Case 2.2
The failure code matches the following regular expression:
urn:plmr-internal:transactions:.+:INVALID_ACCOUNT_STATE
Example:
{
"code": "urn:plmr-internal:transactions:ANY_SOURCE:INVALID_ACCOUNT_STATE",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:core:INVALID_ACCOUNT_STATE",
"message": "Payment rejected due to invalid account state"
}
Case 2.3
The failure code doesn’t match any of the above regular expressions.
Example:
{
"code": "urn:plmr-internal:transactions:NOT_HANDLED",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:core:BLOCKED_BY_CORE",
"message": "Payment blocked by the CORE system"
}
Case 3
The failure code starts with:
urn:plmr-internal:transaction-monitoring:
Example:
{
"code": "urn:plmr-internal:transaction-monitoring:MONITORING_EXCEPTION",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:aml:BLOCKED_BY_AML",
"message": "Payment blocked by the AML system"
}
Case 4
The failure code starts with:
urn:plmr-internal:payment-gateway:
Example:
{
"code": "urn:plmr-internal:payment-gateway:GATEWAY_EXCEPTION",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:pgw:BLOCKED_BY_PGW",
"message": "Payment blocked by the Payment Gateway"
}
Case 5
The failure code starts with:
urn:plmr:payments:aml:
Case 5.1
The failure code is:
{
"code": "urn:plmr:payments:aml:BLOCKED_BY_FRAUD",
"message": "The message was blocked by fraud checks."
}
For this case, the rejection reason message is the same as the failure message.
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:core:INSUFFICIENT_FUNDS",
"message": "The message was blocked by fraud checks." // same as failure message
}
Case 5.2
The failure code doesn’t match any of the codes above.
{
"code": "urn:plmr:payments:aml:UNHANDLED",
"message": "The message was blocked by fraud checks."
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:initiation:INTERNAL_TECHNICAL_ERROR",
"message": "Internal technical error"
}
Case 6
The failure code starts with:
urn:plmr-internal:payments:
Case 6.1
The failure code matches the following regular expression:
urn:plmr-internal:payments:.+:ACC_NOT_FOUND
Example:
{
"code": "urn:plmr-internal:payments:connector:ACC_NOT_FOUND",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:core:ACCOUNT_NOT_FOUND",
"message": "Payment rejected due to account not found"
}
Case 6.2
The failure code matches the following regular expression:
urn:plmr-internal:payments:.+:ACC_BLOCKED
Example:
{
"code": "urn:plmr-internal:payments:connector:ACC_BLOCKED",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:core:ACCOUNT_BLOCKED",
"message": "Payment rejected due to blocked account"
}
Case 6.3
The failure code matches the following regular expression:
urn:plmr-internal:payments:.+:ACC_NOT_ACTIVE
Example:
{
"code": "urn:plmr-internal:payments:connector:ACC_NOT_ACTIVE",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:core:ACCOUNT_NOT_ACTIVE",
"message": "Payment rejected due to account not active"
}
Case 6.4
The failure code matches the following regular expression:
urn:plmr-internal:payments:.+:INSUFF_FUNDS
Example:
{
"code": "urn:plmr-internal:payments:connector:INSUFF_FUNDS",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:core:INSUFFICIENT_FUNDS",
"message": "Payment rejected due to insufficient funds"
}
Case 6.5
The failure code matches the following regular expression:
urn:plmr-internal:payments:.+:TRANSACTION_AMOUNT_RESERVATION_FAILED
Example:
{
"code": "urn:plmr-internal:payments:connector:TRANSACTION_AMOUNT_RESERVATION_FAILED",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:core:INSUFFICIENT_FUNDS",
"message": "Payment rejected due to insufficient funds"
}
Case 6.6
The failure code matches the following regular expression:
urn:plmr-internal:payments:.+:RESERVED_TRANSACTION_AMOUNT_REVERSAL_FAILED
Example:
{
"code": "urn:plmr-internal:payments:connector:RESERVED_TRANSACTION_AMOUNT_REVERSAL_FAILED",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:core:INSUFFICIENT_FUNDS",
"message": "Payment rejected due to insufficient funds"
}
Case 6.7
The failure code doesn’t match any of the codes above.
{
"code": "urn:plmr-internal:payments:connector:OTHER_REASON",
"message": "" // ignored
}
The resulting rejection reason:
"rejectionReason": {
"code": "urn:plmr:payments:core:BLOCKED_BY_CORE",
"message": "Payment blocked by the CORE system"
}
Default case
If none of the cases above apply, the rejection reason is:
"rejectionReason": {
"code": "urn:plmr:payments:initiation:INTERNAL_TECHNICAL_ERROR",
"message": "Internal technical error"
}