Reputation: 35
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
Upvotes: 0
Views: 453
Reputation: 83
If you are trying to access with live PayPal credentials (not sandbox), you can set:
API_ENVIRONMENT = "PRODUCTION"
Upvotes: 3