Error Handling

Berkeley follows standard HTTP response status codes to indicate success or failure of an API request.

All HTTP response status codes are separated into five classes (or categories). The first digit of the status code defines the class of response. The last two digits do not have any class or categorization role. Berkeley will return codes in the following ranges:

  • 2xx (Successful): The request was successfully received, understood, and accepted
  • 4xx (Client Error): The request contains bad syntax or cannot be fulfilled
  • 5xx (Server Error): The server failed to fulfill an apparently valid request

In the rare case of an error with Berkeley's system a 500 status code will be returned and the error message will contain an error code of internal_error.

Generic Errors

There are a few generic error codes that apply to any type of request. The following lists the error codes you may encounter when making an HTTP request into the Berkeley API.

The following table lists all the generic errors codes and messages.

Error TypeHTTP StatusError CodeMessageDescription
Genericresource_already_existsResource already existsUnable to create the request resource since it already exists
Generic404resource_not_foundUnable to find requested resourceCan not find the requested resource
Generic401invalid_credentials_suppliedInvalid credentials suppliedThe authorization token is invalid and Berkeley cannot process the request
Generic404url_invalidUrl is not validUrl is invalid
Generic429rate_limitToo many requests where received too quicklyToo may requests where received please wait and try again
Generic400invalid_content_typeInvalid Content TypeIncorrect value was sent in Content-Type Headers

Card Issuing Errors

If a request fails due to a client error it will contain a 400 HTTP status code with the corresponding body following below:

{
       "error": {
           "message": "Human readable error message, subject to change",
           "code": "Error code that can be programmatically checked against"
       }
}

Additional fields may be included when described below.

If a request fails with a 5xx series error the response will contain a tracking code. The example below shows the body of an HTTP 500 (Internal Server) error:

{
        "error": {
            "code": "internal_server_error",
            "message": "Internal Server Error",
            "tracking_code": "41519fff-439c-4d3d-ab33-4b74c763d2de"
        }
}

When reporting an issue, please return the "tracking_code" field to Berkeley to aid in resolving the issue.

CARD ISSUING - TRANSACTION ERROR CODES

Error TypeError CodeDescription
Card Issuingtransitory_failureThe request could be processed but, due to a temporary condition, cannot be processed now.
Card Issuinginvalid_parametersOne or more parameters of the request are invalid or missing.
Card Issuinginvalid_statusThe operation cannot complete due to the status of an entity. For example, trying to load an account that has been closed.
Card Issuinginvalid_{entity}The entity you passed us in the request is invalid. Entity can be replaced by program, value_load, cardholder, etc.
Value Loads and Unloadsload_limit_excededThe load amount requested is outside the limits of the program.
Value Loads and Unloadsload_failedOur processor failed to process the load. See the message for more detail.
Value Loads and Unloadsinsufficient_fundsThere are not enough funds on either the card or the MFA to complete the transaction.
Value Loads and Unloadslimit_excededThe load has violated a non-monetary limit set by the program.
Activate Cardactivate_card_failedThe card you attempted to activate could not be activated. This could mean the card was closed, already activated or some other issue.
Create Cardholdervelocity_check_failedVelocity check has failed while creating a cardholder.
Card Issuingnot_supportedThe operation is not supported given the current program configuration. For example, a feature specific to Canada will return this if accessed form a USA program.
Card Issuingnot_supported_by_programThe operation is not supported by the current configuration of the program. The most likely case is that the feature has not been enabled for your program.
Card Issuingprogram_inactiveThe program you are trying to modify has been marked as inactive and cannot be changed.
Card Issuinglist_exaustedThe list you are paging through has no more elements.

CARD ISSUING - KYC RESULTS

KYC Verifications will be rejected or sent for manual approval if the consumer information provided as part of the Create Cardholder is not correct or does not match the database records of our KYC provider. For a list of test cases, please go to this page

If a request is unsuccessful then it will contain a 400 status code with the corresponding body following below:

    {
        "code": "kyc_verification_rejected",
        "message": "The cardholder was rejected due to KYC verification failure.",
        "kyc_result_codes": [
                {
                    "code": "street_mismatch",
                    "description": "Street does not match records",
                    "found": "ENGELMANN DR",
                    "match_type": "partial_match",
                    "value": "49 ENGLEMANN DR"
                },
                {
                    "code": "insufficient_credit_record",
                    "description": "Insufficient credit history for a match"
                }
        ],
        "kyc_transaction_id": "bca156b3-0668-49f7-bdf8-11cc6b628120"
    }

KYC RESULT CODES

There are a number of result messages that can be returned when a KYC verification is executed. The full list of KYC result descriptions can be found here.

FieldTypeIs RequiredDescription
codeStringYesA code indicating a problem found during the KYC check
descriptionStringYesA human readable description of code
match_typeStringNoWhat kind of a match was made (full, partial, etc)
valueStringNoA reflection of the field value
foundStringNoThe field value found in the credit records
Result TypeResult CodeDescription
REJECTEDkyc_verification_rejectedThe KYC verification failed. One or more of the verification rules was triggered. Cardholder creation also failed due to this result.
MANUAL REVIEWkyc_verification_reviewThe KYC verification is under review. One or more of the verification rules was triggered. Cardholder creation is pending due to this result.

Card Issuing - Validation Failures

When a model fails validation, a field_errors field will be attached to the error message describing why each failing field did not pass validation. An example is below:

    {
        "error": {
            "code": "invalid_object",
            "field_errors": [
                {
                    "code": "valid_field",
                    "message": "Field Failed to pass validation",
                    "position": [
                        "test"
                    ],
                    "value": "Test"
                }
            ],
            "message": "Invalid field(s) in Object"
        }
    }

Possible fields for fields errors are:

FieldValueRequiredDescription
codeStringYesThe error code for the failure.
messageStringYesHuman readable error message.
positionStringYesThe location of the field in the request.
valueanyYesThe value of the field in the request
valid_valuesanyNoValid values for this field
invalid_elementsanyNoAny invalid elements in the request field.

DirectSend - Tokenization Errors

Tokenization errors may occur due to reasons as explained below. If a request fails and throws an error it will contain a 400 HTTP status code with the corresponding body following below:

    {
        "error": {
            "message": "Human readable error message, subject to change",
            "code": "Error code that can be programmatically checked against",
            "transaction_id": // With be part of response if this error was part of a transaction request
        }
    
    }

TOKENIZATION ERROR CODES

Error TypeError CodeMessageDescription
Tokenizationinvalid_financial_account_detailsFinancial Account details provided are invalidIncorrect values provided when creating a token for a financial account
Tokenizationaccount_not_verifiedThe payment card was not verified with the issuer. Do not proceed with the transactionCard not verified by the issuer
Tokenizationaccount_marked_lost_stolenThe payment card has been marked as lost or stolen. Please notify the issuer. Do not proceed with the transaction"Lost card, pick up (fraud account) or Stolen card, pick up (fraud account)"
Tokenizationsuspected_fraudThe card was not verified. Transaction may be fraudulentSuspected fraud
Tokenizationcvv_failureThe card was declined for CVV2 failureThe card failed the CVV security check
Tokenizationtest_cards_onlyOnly test cards can be used in this environmentThe supplied card is not a valid test card

DirectSend - Account Holder Errors

There are a few error codes related to Account Holders. The following lists the error codes you may encounter when making an HTTP request into the Berkeley API.

ACCOUNT HOLDER ERROR CODES

The following table lists all the errors codes and messages.

Error TypeError CodeMessageDescription
Account Holderinvalid_account_holderTransaction cannot be completed for Account Holder TypeThis Transaction Type cannot be processed by the given account holder type

DirectSend - Financial Account Errors

There are a few error codes related to Financial Accounts The following lists the error codes you may encounter when making an HTTP request into the Berkeley API.

FINANCIAL ACCOUNT ERROR CODES

The following table lists all the errors codes and messages.

Error TypeError CodeMessageDescription
Financial Accountinvalid_tokenToken provided is invalidToken provided can not be located
Financial Accountinvalid_financial_account_for_account_holderFinancial Account is incorrect type for Account HolderThis financial account can not be attached to the account holder, ex(business card attached to an individual)

DirectSend - Transaction Errors

Transaction errors may occur due to reasons such as: invalid card information, the inability to process a transction on a payment network, etc.

If a request is unsuccessful then it will contain a 400 or 500 status code with the corresponding body following below:

    {
        "error": {
            "message": "Human readable error message, subject to change",
            "code": "Error code that can be programmatically checked against",
            "transaction_id": // Will be part of response if this error was part of a transaction request
        }
    
    }

TRANSACTION ERROR CODES

The following table lists all the errors codes and messages.

Error TypeError CodeMessageDescription
Transactionunsupported_transaction_typeTransaction Type can not be completed for Financial AccountFinancial Account Provided can not create Transactions of the request type
Transactioninvalid_transaction_detailsInvalid parameters provided in the transaction payloadIncorrect values provided in the transaction payload
Transactionnot_sufficient_fundsNo sufficient funds to process the transactionNot sufficient funds to process transaction
Transactionduplicate_transactionTransaction was seen as a duplicate and discardedDuplicate transaction received due to idempotency key repeat
Transactionidempotent_request_still_processingOriginal idempotent request is still processing, please try again with same idempotency keyAnother request with the same idempotency key and parameters is still being processed and we don't have the result available to return at this point
Transactionpayment_network_errorPayment Network has failed to process transactionPayment Network failed to process transaction
Transactiontransaction_declinedTransaction has been declined: < contains additional details regarding decline >Transaction was declined by payment network
Transactiontransaction_already_reversedReverseable total exceededThe full amount of the parent transaction has been reversed already
Transactionreverse_time_window_exceedTime window for reverse transaction has been exceededDepending on the Payment Network a Reverse Transaction can only be created within a given time limit after the original Pull transaction
Transactionreverse_parent_transaction_invalidOrignal Pull Transaction can not be reversedA Reverse Transaction cannot be created for the given Pull Transaction
Transactionsibling_transaction_outstandingA sibling transaction tied to the Parent Pull Transaction is still outstanding and must be processedA sibling transaction linked by the parent pull transaction is still outstanding
Transactioncan_not_locate_linked_transactionCan not find linked transactionThe linked transaction can not be located
Transactiontransaction_exceeds_limitTransaction value exceeds limitsTransaction amount exceeds approved limits
Transactionsubscription_limits_reachedYou have reached your subscription limit for this periodYou have reached the limits of your subscription plan
Transactionno_active_subscriptionYou don't have an active subscription for this productYou must purchase this product in order to use this api service
Transactioninvalid_account_statusThere's something wrong with the merchant account. Please contact BerkeleyMerchant account has been suspended
Transactioninvalid_tds_authentication3D Secure Authentication provided cannot be used for this transaction3DSecure Authentication can no be used for Pull Transcation

DirectSend - 3D-Secure Errors

There are a few error codes related to 3DSecure Authentications. The following lists the error codes you may encounter when making an HTTP request into the Berkeley API.

3D-SECURE ERROR CODES

The following table lists all the errors codes and messages.

Error TypeError CodeMessageDescription
3DSecure Authenticationtds_not_applicableFinancial Account doesn't use the 3DSecure ProcessThe Financial Account provided doesn't use the 3DSecure Process, for example bank accounts
3DSecure Authenticationtransaction_exceeds_limitTransaction value exceeds limitsTransaction amount exceeds approved limits