WePay

WePay API Errors

When an error occurs the API will respond with three parameters:

  1. a generic "error" category.
  2. a human readable "error_description" that explains why the error happened.
  3. a specific "error_code" that you can use to program responses to errors.

The possible values for the "error" parameter are listed below:

invalid_request
The API call had either 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

The error response will also include an error description that will tell you more about why the error occurred. You can use this error description to debug the problem. If you have any questions about an error message, please contact api@wepay.com. Below is a typical error response:

HTTP/1.1 401
Server: nginx/0.8.54
Date: Fri, 15 Jul 2011 16:36:15 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive

{"error":"access_denied","error_description":"applications can only modify accounts they have created","error_code":3002}

The possible values for the "error_code" parameter are listed below. Please note that this feature is still in beta so we may need to change or add error_codes as we receive feedback from our API partners.

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.

Payment Error Codes

  • 2001: The AVS check on the payment failed (invalid billing address)
  • 2002: The card type is not supported (ie something besides Visa, MasterCard, Amex, or Discover)
  • 2003: The issuing bank indicated that the card is not supported
  • 2004: The issuing bank declined the charge but didnt 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 dont 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
  • 3007: The account must go through KYC before this call can be made

Membership Error Codes

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

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

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 subcription charge
  • 8011: The app cannot access that subscription charge