Capture Payment Error Codes
This section documents validation and business rule errors for the Capture Payment (/payments/{paymentId}/capture) endpoint.
Error Code Summary – Capture Payment
| Error Title Reference | Error Title | HTTP Status | Detail Message | Scenario | Resolution |
|---|---|---|---|---|---|
| Invalid Amount | INVALID_REQUEST | 400 BAD REQUEST | amount Invalid amount ${amount}, it must be between 1 and 99999999 | Amount is zero, negative, or out of allowed range | Provide a positive integer amount between 1 and 99999999 |
| Invalid Decimal Amount | INVALID_REQUEST | 400 BAD REQUEST | amount Invalid amount ${amount}, it must be between 1 and 99999999 | Amount is not a valid integer (decimal provided) | Use whole number amounts without decimals or fractional values |
| Capture Exceeds Authorized | INVALID_REQUEST | 400 BAD REQUEST | Capture amount exceeds authorized amount or no amount authorized for capture | Capture amount is greater than pre-authorized amount or no pre-authorization exists | Ensure capture amount is less than or equal to the authorized amount |
| Metadata Key Size | INVALID_REQUEST | 400 BAD REQUEST | payment.metadata Metadata key size bigger than: 40 | Metadata key exceeds 40 characters | Keep metadata keys to 40 characters or less |
| Metadata Value Size | INVALID_REQUEST | 400 BAD REQUEST | payment.metadata Metadata value size bigger than: 100 | Metadata value exceeds 100 characters | Keep metadata values to 100 characters or less |
| Metadata Entry Limit | INVALID_REQUEST | 400 BAD REQUEST | payment.metadata Exceeded the max number of entries in metadata. Max 20 | More than 20 metadata entries provided | Limit metadata entries to a maximum of 20 key-value pairs |
| Invalid Payment Status | INVALID_REQUEST | 400 BAD REQUEST | Payment with ${paymentId} is in invalid status: COMPLETED | Attempt to capture a payment that is already completed | Only attempt to capture payments that are in AUTHORIZED status |
Error Codes Details
Capture Payment Errors
Invalid Amount
Invalid Amount
Occurs when the amount is zero, negative, or outside the allowed range (1–99,999,999).
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "amount Invalid amount 0, it must be between 1 and 99999999"
}
Invalid Decimal Amount
Invalid Decimal Amount
Occurs when the amount is not a valid integer (decimal provided).
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "amount Invalid amount 1.23, it must be between 1 and 99999999"
}
Capture Exceeds Authorized
Capture Exceeds Authorized
Occurs when the capture amount is greater than the pre-authorized amount or no pre-authorization exists.
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "Capture amount exceeds authorized amount or no amount authorized for capture"
}
Metadata Key Size
Metadata Key Size
Occurs when a metadata key exceeds 40 characters.
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "payment.metadata Metadata key size bigger than: 40"
}
Metadata Value Size
Metadata Value Size
Occurs when a metadata value exceeds 100 characters.
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "payment.metadata Metadata value size bigger than: 100"
}
Metadata Entry Limit
Metadata Entry Limit
Occurs when more than 20 metadata entries are provided.
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "payment.metadata Exceeded the max number of entries in metadata. Max 20"
}
Invalid Payment Status
Invalid Payment Status
Occurs when attempting to capture a payment that is already completed.
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "Payment with 12345 is in invalid status: COMPLETED"
}