user1680697
user1680697

Reputation: 31

Invalid token error with Paypal Invoice api when executed using cURL

I am getting an invalid token error when I try to execute the following:

curl -s --insecure -H "X-PAYPAL-SECURITY-USERID:<paypal sandbox user id>" -H "X-PAYPAL-SECURITY-PASSWORD:<paypal sandbox password>" -H "X-PAYPAL-SECURITY-SIGNATURE:<paypal sandbox security signature>" -H "X-PAYPAL-REQUEST-DATA-FORMAT:NV" -H "X-PAYPAL-RESPONSE-DATA-FORMAT:JSON" -H "X-PAYPAL-APPLICATION-ID:APP-80W284485P519543T" https://svcs.sandbox.paypal.com/Invoice/CreateAndSendInvoice  -d "requestEnvelope.errorLanguage=en_US&[email protected]&[email protected]&invoice.currencyCode=USD&invoice.itemList.item(0).name=Banana+Leaf+--+001&invoice.itemList.item(0).description=Banana+Leaf&invoice.itemList.item(0).quantity=1&invoice.itemList.item(0).unitPrice=1&invoice.itemList.item(0).taxName=Tax1&invoice.itemList.item(0).taxRate=10.25&invoice.paymentTerms=Net10"

I get the following error:

{"responseEnvelope":{"timestamp":"2012-09-18T08:06:27.801-07:00","ack":"Failure","correlationId":"2d3c5f95a76d9","build":"3566933"},"error":[{"errorId":"570054","domain":"PLATFORM","subdomain":"Application","severity":"Error","category":"Application","message":"Invalid token"}]}

I am unable to find what is going wrong with the parameters being sent here for getting invalid token error. Please help.

Upvotes: 3

Views: 1496

Answers (1)

Freeman
Freeman

Reputation: 1190

Make sure your merchant email (invoice.merchantEmail) is the same with the merchant email address in your sandbox account.

Upvotes: 3

Related Questions