Skip to main content
Version: v1

Update Payment Method Error Codes

This document provides a comprehensive reference for validation errors related to payment method update operations in the Convenient Checkout API. These errors help identify issues with payment method update requests and guide you in resolving them.

tip

Error Codes Summary

Error Code Summary
Error Title ReferenceError & StatusDetail MessageScenarioResolution
Agent ValidationINVALID_REQUEST 400 BAD REQUESTAgent is required to update manufacturer cardAgent object is missing when updating manufacturer cardInclude a valid agent object when updating a manufacturer card
Manufacturer Card ValidationINVALID_REQUEST 400 BAD REQUESTManufacturer card cannot be defaultBoth manufacturerCard and default are set to trueSet either manufacturerCard=false or default=false; a manufacturer card cannot be the default payment method
Payment Method Type ValidationINVALID_REQUEST 400 BAD REQUESTPayment method type in request does not match the existing payment methodType mismatch between request and existing payment methodEnsure the payment method type in the request matches the existing payment method type
Payment Method Status ValidationFORBIDDEN 403 FORBIDDENCannot update invalid payment methodAttempt to update a payment method with INVALIDATED statusOnly update payment methods that are in a valid (non-invalidated) status
Payment Method ID ValidationINVALID_REQUEST 400 BAD REQUESTInvalid paymentMethodIdPayment method ID does not exist or has invalid formatProvide a valid, existing paymentMethodId
Field ValidationPAYMENT_METHOD_ERROR 400 BAD REQUESTAccount type must not be blank.Missing required account type fieldInclude a valid account type in the request
PAYMENT_METHOD_ERROR 400 BAD REQUESTZipCode must be exactly 5 digits long.Invalid zip code formatProvide a valid 5-digit zip code
Expiry Date ValidationPAYMENT_METHOD_ERROR 400 BAD REQUESTinvalid expiryMonthExpiry month is invalid (zero, negative, or greater than 12)Provide a valid expiry month (1-12)
PAYMENT_METHOD_ERROR 400 BAD REQUESTexpiry month and year cannot be in the pastExpired date providedProvide a valid expiry date that is not in the past
PAYMENT_METHOD_ERROR 400 BAD REQUESTexpiryYear cannot be more than 50 years from current yearExpiry year too far in futureProvide an expiry year that is within 50 years from the current year
PAYMENT_METHOD_ERROR 400 BAD REQUESTexpiryMonth is required when expiryYear is presentIncomplete expiry dateProvide both expiry month and year
PAYMENT_METHOD_ERROR 400 BAD REQUESTexpiryYear is required when expiryMonth is presentIncomplete expiry dateProvide both expiry month and year

Error Codes Details

Agent Validation

Agent is required to update manufacturer card

The Update Payment Method API requires an agent object to update the manufacturerCard flag for any card payment method. If the agent is missing or null, the request will fail.

Sample Invalid Request:

{
"agent": null
}

Sample Error Response:

{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "Agent is required to update manufacturer card"
}

Manufacturer Card Validation

Manufacturer card cannot be default

A manufacturer card cannot be designated as the default option, as manufacturer and default cards are mutually exclusive. If both manufacturerCard and default are set to true, the request will fail.

Sample Invalid Request:

{
"default": true,
"manufacturerCard" : true
}

Sample Error Response:

{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "Manufacturer card cannot be default"
}

Payment Method Type Validation

Payment method type mismatch

The payment method type in the update request must match the existing payment method type. For example, you cannot update a card payment method with bank account details or vice versa.

Sample Invalid Request:

{
"paymentMethodDetails": {
"type": "BANK_ACCOUNT",
"nameOnAccount": "John Doe",
"accountType": "checking"
}
}

Sample Error Response:

{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "Payment method type in request does not match the existing payment method"
}

Payment Method Status Validation

Cannot update invalid payment method

Payment methods with an INVALIDATED status cannot be updated. This could happen if the payment method was previously invalidated by the system or an administrator.

Sample Error Response:

{
"title": "INVALID_REQUEST",
"status": 403,
"detail": "Cannot update invalid payment method"
}

Payment Method ID Validation

Invalid payment method ID

The payment method ID provided in the request must exist in the system and be associated with the customer. If an invalid, non-existent, or improperly formatted ID is provided, this error occurs.

Sample Error Response:

{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "Invalid paymentMethodId"
}

Field Validation

Account type must not be blank

When updating a bank account payment method, the account type field is required and must have a value.

Sample Invalid Request:

{
"paymentMethodDetails": {
"type": "BANK_ACCOUNT",
"nameOnAccount": "John Doe",
"accountType": ""
}
}

Sample Error Response:

{
"title": "PAYMENT_METHOD_ERROR",
"status": 400,
"detail": "Account type must not be blank."
}
Invalid ZIP code format

When updating a card payment method, the ZIP code must be exactly 5 digits long.

Sample Invalid Request:

{
"paymentMethodDetails": {
"type": "CARD",
"nameOnCard": "John Doe",
"zipCode": "123"
}
}

Sample Error Response:

{
"title": "PAYMENT_METHOD_ERROR",
"status": 400,
"detail": "ZipCode must be exactly 5 digits long."
}

Expiry Date Validation

Invalid expiry month

The expiry month must be a number between 1 and 12.

Sample Invalid Request:

{
"paymentMethodDetails": {
"type": "CARD",
"nameOnCard": "John Doe",
"expiryMonth": 13,
"expiryYear": 2030
}
}

Sample Error Response:

{
"title": "PAYMENT_METHOD_ERROR",
"status": 400,
"detail": "invalid expiryMonth"
}
Expired card date

The expiry date (month and year) cannot be in the past.

Sample Invalid Request:

{
"paymentMethodDetails": {
"type": "CARD",
"nameOnCard": "John Doe",
"expiryMonth": 6,
"expiryYear": 2024
}
}

Sample Error Response:

{
"title": "PAYMENT_METHOD_ERROR",
"status": 400,
"detail": "expiry month and year cannot be in the past"
}
Expiry year too far in future

The expiry year cannot be more than 50 years from the current year.

Sample Invalid Request:

{
"paymentMethodDetails": {
"type": "CARD",
"nameOnCard": "John Doe",
"expiryMonth": 6,
"expiryYear": 2080
}
}

Sample Error Response:

{
"title": "PAYMENT_METHOD_ERROR",
"status": 400,
"detail": "expiryYear cannot be more than 50 years from current year"
}
Missing expiry month with expiry year

When providing an expiry year, the expiry month is also required.

Sample Invalid Request:

{
"paymentMethodDetails": {
"type": "CARD",
"nameOnCard": "John Doe",
"expiryYear": 2030
}
}

Sample Error Response:

{
"title": "PAYMENT_METHOD_ERROR",
"status": 400,
"detail": "expiryMonth is required when expiryYear is present"
}
Missing expiry year with expiry month

When providing an expiry month, the expiry year is also required.

Sample Invalid Request:

{
"paymentMethodDetails": {
"type": "CARD",
"nameOnCard": "John Doe",
"expiryMonth": 6
}
}

Sample Error Response:

{
"title": "PAYMENT_METHOD_ERROR",
"status": 400,
"detail": "expiryYear is required when expiryMonth is present"
}