Mint

Circle APIs: API and Entity Errors

Troubleshoot and fine-tune your code using Circle's detailed error responses.

The error codes used by Circle APIs fall into two categories, API response errors and entity errors. API response errors are returned immediately in response to API requests. Entity errors are associated with API entities such as payments and generally take seconds or minutes to return.

When an API request is made and the error is known immediately, Circle APIs will return the appropriate HTTP status code along with a JSON error response. Because HTTP status codes do not always provide sufficient information about the cause of an error, Circle's API errors provide more detailed JSON responses to help you determine what's gone wrong.

In the example below, the request is missing a required field. The HTTP status code in this case would be HTTP/1.1 400 Bad Request

JSON
{
  "code": 2,
  "message": "Invalid entity. metadata.email may not be empty (was null)",
  "errors": [
    {
      "error": "invalid_value",
      "location": "metadata.email",
      "message": "metadata.email may not be empty (was null)"
    }
  ]
}

You can automate the handling of certain error types. These include the following error names, which include example messages and constraints, where applicable:

errormessageconstraints
value_must_be_truefield1 must be true (was false)NA
value_must_be_falsefield1 must be false (was true)NA
requiredfield1 may not be null (was null)NA
not_requiredfield1 must be null (was foo)NA
min_valuefield1 must be greater than or equal to 2 (was 0)"constraints": { "min": 2 }
min_valuefield1 must be greater than 2.0 (was 2.0)"constraints": { "min": "2.0", "inclusive": false }
max_valuefield1 must be less than or equal to 99 (was 1024)"constraints": { "max": 99 }
max_valuefield1 be less than or equal to 99.99 (was 100)"constraints": { "max": "99.99", "inclusive": true }
length_outside_boundsfield1 must be between 2 and 5 (was qwerty)"constraints": { "min": 2, "max": 5 }
pattern_mismatchfield1 must match "[a-z]+" (was 123456)"constraints": { "pattern": "[a-z]+" }
date_not_in_pastfield1 must be in the past (was 2020-08-31T18:18:54.211Z)NA
date_not_in_futurefield1 must be in the future (was 2020-08-31T18:18:17.621Z)NA
number_formatfield1 numeric value out of bounds (<3 digits>.<2 digits> expected) (was 123.456)"constraints": { "max-integral-digits": 3, "max-fractional-digits": 2 }

Whenever an API request results in an error, the JSON response contains both an error code and a human-readable message in the body.

JSON
{
  "code": 2,
  "message": "Invalid entity.\n[<error-message1>...\n<error-messageN>]"
}

In some cases, you'll receive extended information about why a request has failed. For example, if you fail to supply a value for a required field, you'll receive the following error response:

JSON
{
  "code": 2,
  "message": "Invalid entity.\nfield1 may not be null (was null)",
  "errors": [
    {
      "error": "required",
      "message": "field1 may not be null (was null)",
      "location": "field1",
      "invalidValue": "null",
      "constraints": {}
    }
  ]
}

This extended error response contains one or more associated error descriptions. Error description attributes can be read as follows:

KeyDescriptionoptional
errortype of an errorfalse
messagehuman-friendly messagefalse
locationperiod-separated path to the property that causes this error. An example could be field1 or address.billingCountryfalse
invalidValueactual value of the property specified in location key, as received by the servertrue
constraintsspecial object that contains additional details about the error and could be used for programmatic handling on the client sidetrue

The table below shows the list of JSON error codes that may be returned in an API error response.

CodeMessageDescription
-1Unknown ErrorAn unknown error occurred processing the API request
1Malformed authorization. Is the authorization type missing?API Key is missing or malformed
2Invalid EntityError with the JSON object passed in the request body
3ForbiddenAPI Key used with request does not have one of the roles authorized to call the API endpoint
1077Payment amount is invalidPayment amount must be greater than zero
1078Payment currency not supportedAn invalid currency value was used when making a payment
1083Idempotency key already bound to other requestThe idempotency key used when making a request was used with another payment. Please retry with a different value
1084This item cannot be canceledA cancel or refund request cannot be canceled
1085This item cannot be refundedA cancel or refund request cannot be refunded
1086This payment was already canceledThis payment was already canceled
1087Total amount to be refunded exceeds payment amountTotal amount to be refunded exceeds payment amount
1088Invalid source accountAn invalid source account was specified in a payout or transfer request
1089The source account could not be foundUnable to find the source account specified in a payout or transfer request
1093Source account has insufficient fundsThe source account has insufficient funds for the payout or transfer amount
1096Encryption key id could not be foundAn encryption key id must be provided if request includes encrypted data
1097Original payment is failedAttempting to cancel or refund a failed payment
1101Invalid country formatAn invalid ISO 31660-2 country code was provided
1106Invalid district formatInvalid district format, must be a 2 character value
1107Payout limit exceededPayout can't be accepted as it would exceed the given limit
1108Unsupported CountryCountry not supported for customer
1143Checkout session not foundThe checkout session id passed in the request doesn't exist in the DB
1144Checkout session is already in a completed stateThe checkout session cannot be extended because it is already in a complete state
2003The recipient address already existsThe blockchain address has already been associated with the account
2004The address is not a verified withdrawal addressThe blockchain address must first be verified before it can be used as a destination in a transfer request
2005The address belongs to an unsupported blockchainThe blockchain type used as a transfer destination is not supported
2006Wallet type is not supportedThe wallet type specified when creating an end user wallet is not supported
2007Unsupported transferA transfer from the provided source to the provided destination is not supported
5000Invalid travel rule identity typeThe provided identity type must be either "individual" or "business"
5001Payout not foundPayout doesn't exist based on the ID provided. Please check the payout id
5002Invalid payout amountPayout amount must be more than 0
5003Inactive destination addressCannot send payout to an inactive destination address. If you have just added the address, you may have to wait for 24 hours before use
5004Destination address not foundThe destination address for this payout could not be found
5005Source wallet not foundSource wallet for this payout could not be found
5006Insufficient fundsThe source wallet has insufficient funds for this payout
5007Unsupported currencycurrency not currently supported for this operation
5011Invalid destination addresscannot send payout to an invalid destination address
5012Invalid destination location typescannot search for both crypto and fiat payouts
5013Invalid source wallet idsource wallet id must be a number for payouts search
5014The address is not valid for the blockchainProvided blockchain address is not valid for the corresponding blockchain
5015Invalid destination chainProvided blockchain address has an invalid chain in respect to the currency used
500000Unsupported currency for reporting daily user balanceUser provided a currency other than USDC or EURC
500001Custody balance asOfDate is too far from today's dateasOfDate provided was before or after today's date
500002Custody balance cannot be less than zeroNegative balances were provided
500003Local custody balance can't be greater than total custody balanceTotal balance must be greater than or equal to local balance
500004Idempotency key can't be reusedThe same idempotency key was used for different requests
500005Custody balance report already existsA custody balance report was already created for the provided date and currency. Contact customer care for edits.

With entities such as payments, cards, bank wires, and transfers, an error is generally not known immediately, so no error code can be returned at the time of the request.

For instance, when making a payment, the transaction is processed asynchronously and the create payment request will have a status of pending. After processing, the status will eventually be set to approved or failed.

API entities such as payments and cards are processed asynchronously after the initial create request is made. If a problem occurs while processing the request (the status is shown as failed), the errorCode property is set on the entity and can be retrieved either by polling the GET endpoint or via a notification. The response explains why the payment was unsuccessful.

Here are some Entity error codes associated with payments, cards, bank wires, and transfers.

CodeDescription
payment_failedPayment failed due to an unknown reason
payment_fraud_detectedSuspected fraud detected by Issuing bank. Please instruct your user to contact their bank directly to resolve
payment_deniedPayment denied by Circle Risk Service, see payment riskReasonCode for more details
payment_not_supported_by_issuerIssuer bank was unable to process the transaction
payment_not_fundedThere were insufficient funds to cover the payment amount
payment_stopped_by_issuerA stop has been placed by the issuer or customer
payment_canceledPayment was canceled
payment_failed_balance_checkPayment failed the Plaid balance check due to insufficient funds
payment_unprocessableThe provided encryptedData could not be processed
CodeDescription
insufficient_fundsInsufficient funds
transaction_failedTransaction failed due to an unknown reason
payout_canceledThe payout was canceled
CodeDescription
transfer_failedThe transfer failed due to unknown reasons
transfer_deniedThe transfer was denied by Circle Risk Service, see transfer riskEvaluation for more details
blockchain_errorThere was an error processing the transfer on-chain
insufficient_fundsThere was not enough funding to cover the transfer amount
Did this page help you?
© 2023-2025 Circle Technology Services, LLC. All rights reserved.