Errors

When an error occurs, the API will respond with the parameters listed below.

Note

The details and documentation_url fields are returned if your platform is using API Version 2018-08-29 or later.

error A generic error category. Possible values include:

  • invalid_request: The API call had a malformed URI, or incorrect or invalid parameters.
  • access_denied:The API call tried to access a resource that it does not have permission to access.
  • invalid_scope: The API call provided non existent permissions in a scope parameter.
  • invalid_client: The API call provided a `client_id` for a client that does not exist, or has been disabled.
  • processing_error: There was an error on WePay's end. If you receive this message, please contact api@wepay.com.
error_description A human readable description that explains why the error happened. Use this error description to debug the problem. If you have questions about an error message, please contact api@wepay.com.
error_code A specific code that you can use to program responses to errors.
details An array of objects which contain more information.

  • target: Indicates what part of your request is responsible for this detail.
  • target_type: Describes what part of the request the target is referring to.
  • message: This message is intended to help your platform fix an error.
  • reason_code: Code returned to indicate the reason an error occurred.
documentation_url A URL which points to documentation about this resource.

Below is the typical error response structure:

{
    "error": "invalid_request",
    "error_description": "invalid payment method",
    "error_code": 4003,
    "details": [
        {
            "target": ["payment_method", "inline_credit_card", "cc_number"],
            "target_type": "HTTP_REQUEST_BODY",
            "reason_code": "INVALID_CREDIT_CARD_NUMBER",
            "message": "Invalid credit card number"
        }
    ],
    "documentation_url": "https://developer.wepay.com/api/general/errors#4003"
}

Generic Error Codes

  • 1001: You try to make an API call that doesn’t exist like /user/robots.
  • 1002: You are missing a required header such as User-Agent, Content-Type, or Authorization.
  • 1003: You passed an invalid parameter value such “robot” for the “fee_payer” parameter.
  • 1004: You did not pass a required parameter.
  • 1005: We were unable to parse the parameters you passed (ie your JSON is malformed).
  • 1006: We were completely unable to authenticate your request (probably your access_token doesn’t exist).
  • 1007: You have made too many requests in a short time period. See our throttling documentation for more details.
  • 1008: WePay encountered an unexpected error. Contact api@wepay.com.
  • 1009: This error can be displayed to the user and generally relates to user data - long term this code will be replaced by more specific error codes.
  • 1010: You do not have sufficient permissions to perform the requested action.
  • 1011: The access_token you passed has been revoked.
  • 1012: The code parameter (OAuth2) has expired.
  • 1013: The client_id you passed does not match the code parameter.
  • 1014: IP address you are making API calls from is not on the IP whitelist for your app.
  • 1015: API Version is invalid or expired.
  • 1016: The API version specified in the ‘Api-Version’ header used in the request is not valid for the app.

Payment Error Codes

  • 2001: The AVS check on the payment failed (invalid billing address).
  • 2002: The card type is not supported (i.e. not Visa, MasterCard, American Express, Discover, JCB, or Diners Club).
  • 2003: The issuing bank indicated that the card is not supported.
  • 2004: The issuing bank declined the charge but did not tell us why (generally due to a fraud check on their side).
  • 2005: The payment method does not have sufficient funds to make the payment.
  • 2006: The card has been lost or stolen.
  • 2007: The card has expired (some issuing banks don’t care though and we only care if they do).
  • 2008: Some of the card data was invalid (CVV, expiration date, card number, name on card).
  • 2009: The credit_card object is in an invalid state for that action.

Account Error Codes

  • 3001: The account you are trying to access does not exist.
  • 3002: The access_token you have passed belongs to a user that does not have permission to view/modify that account.
  • 3003: The account has been deleted.
  • 3004: The account cannot transact.
  • 3005: The account lacks sufficient funds for the action requested.
  • 3006: The account already provided KYC information.
  • 3007: The account must go through KYC before this call can be made.
  • 3008: The account must complete settlement information before requesting account review.
  • 3009: The account must supply a 9-digit social security number when completing KYC.
  • 3010: The account KYC state must be in state “require_docs” when calling /account/kyc/modify.
  • 3011: The account does not own the files specified when calling /account/kyc/modify.
  • 3012: The account is required to supply the account_owner KYC field, however, KYC was attempted to be completed without it.

Membership Error Codes

  • 3302: You must use the financial administrator’s access token.
  • 3306: Cannot change financial administrator once withdrawals have started.

Checkout Error Codes

  • 4001: The checkout you are trying to view/edit does not exist.
  • 4002: The access_token you have passed belongs to a user that does not have permission to view/modify that checkout.
  • 4003: The payment method you passed does not exist or does not belong to the user/app you are authenticated as.
  • 4004: The checkout is in an invalid state for that action.
  • 4005: Cannot add signature to this checkout.
  • 4006: The unique_id you passed has failed permanently. Please pass a different unique_id.

Preapproval Error Codes

  • 5001: The preapproval does not exist.
  • 5002: The access_token you have passed belongs to a user that does not have permission to view/modify that checkout.
  • 5003: If you authenticated with a client_id/client_secret (for app-level preapprovals) then your app cannot access that preapproval.
  • 5004: You are trying to execute a preapproval where the start time has not passed.
  • 5005: You are trying to execute a preapproval where the end_time has already passed.
  • 5006: The preapproval is in the incorrect state for that action.
  • 5007: You have tried to authorize the payment method unsuccessfully too many times with this preapproval.
  • 5008: You are trying to make a payment to an account that this preapproval is not tied to.
  • 5009: You have already executed as many checkouts on this period as you are allowed to based on the frequency parameter you set.
  • 5010: You have already reached the amount per period limit you set for this preapproval.
  • 5011: You tried to execute two simultaenous payments on a single preapproval.

Withdrawal Error Codes

  • 6001: The withdrawal you are trying to access does not exist.
  • 6002: The access_token you have passed belongs to a user that does not have permission to view/modify that withdrawal.

User Error Codes

  • 7001: You are trying to access a user that does not exist or that you do not have permission to access.
  • 7002: The user is an invalid state for that action.
  • 7003: The user has been deleted.

Subscription Error Codes

  • 8001: The subscription plan you are trying to view/modify does not exist.
  • 8002: The access_token you have passed belongs to a user that does not have permission to view/modify that subscription plan.
  • 8003: The app cannot access the subscription plan.
  • 8004: The subscription plan has been deleted.
  • 8005: The subscription you are trying to view/modify does not exist.
  • 8006: The access_token you have passed belongs to a user that does not have permission to view/modify that subscription.
  • 8007: The app cannot access the subscription.
  • 8008: The subscription you are trying to view/modify has expired.
  • 8009: The subscription charge you are trying to view/modify does not exist.
  • 8010: The access_token you have passed belongs to a user that does not have permission to view/modify that subscription charge.
  • 8011: The app cannot access that subscription charge.