0

I'm trying to use the Paypal classic api with python but I keep getting the 10002 error. I understand this is to do with authentication, so I have checked all of the authentication details, but all seems fine.

Here is the code:

from paypal import PayPalInterface

paypal_api = PayPalInterface(API_USERNAME="xxxxx",\
API_PASSWORD="xxxxx",\
API_SIGNATURE="xxxxx",\
DEBUG_LEVEL=0,\
HTTP_TIMEOUT=30)

balance = paypal_api._call('GetBalance')

Here I try to get the account balance, but get the error code:

paypal.exceptions.PayPalAPIResponseError: u'Security header is not valid' (Error Code: 10002)

I also get the same error code using the TransactionSearch method. Any ideas as to what could be wrong?

Thanks

  • http://stackoverflow.com/questions/23261766/paypal-gateway-has-rejected-request-security-header-is-not-valid-10002-secur/23265150#23265150 – Vimalnath Dec 17 '14 at 05:56

1 Answers1

3

If you are trying to access with live PayPal credentials (not sandbox), you can set:

API_ENVIRONMENT = "PRODUCTION"