cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with Payouts API

Member

Trouble with Payouts API

When I use the code below, it works...but as soon as I change the note from"ERRPYO002" to anything (eg: "thanks for your help"), I get a 

MALFORMED_REQUEST_ERROR error: "Json request malformed".  Google searches show that only a handful of other people get this error, and there is no help to be found.  It makes zero sense that the string in the "note" field has to be exactly "ERRPYO002".

 

Also, it seems that no one from paypal ever answers any questions here.  I've seen forum posts where people ask if anyone ever helps with questions and it seems like the answer is no.

 

Is there some magic thing we're supposed to do to get developer support?  Or is paypal pretty much saying "Good luck. You're on your own"?

 

 

 

curl -X POST https://api.sandbox.paypal.com/v1/payments/payouts \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [THISISMYACCESSTOKEN]" \
-d '{
"sender_payout_header": {
"sender_batch_id": "1524086406556",
"email_subject": "This email is related to simulation"
},
"items": [
{
"recipient_type": "EMAIL",
"receiver": "[EMAILADDRESS]",
"note": "ERRPYO002",
"sender_item_id": "15240864065560",
"amount":
{
"currency": "USD",
"value": "1.00"
}
}
]
}'

 

2 REPLIES
Member

Re: Trouble with Payouts API

I was able to replicate this same error and I was able to fix it by changing "sender_payout_header" to "sender_batch_header".

 

This documentation says you must use "sender_payout_header", but I was never able to get it to work:

https://developer.paypal.com/docs/payouts/integrate/api-integration/#2-create-payout

 

This documentation shows that you should use "sender_batch_header" with everything else remaining the same and it seems to work:

https://developer.paypal.com/docs/api/payments.payouts-batch/v1/

 

And the note you mentioned is PayPal's way to force errors. You can see others here:

https://developer.paypal.com/docs/payouts/integrate/test-payouts/#test-values

 

This seems to get checked first, which is why the post call still went through. Not a great workflow, but I wouldn't get too hung up on it.

Member

Re: Trouble with Payouts API

Hi,

 

As is, I ran the same exact curl command from Git Bash (Windows) and got the following response:

 

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 386 100 83 100 303 108 395 --:--:-- --:--:-- --:--:-- 503{"error":"invalid_token","error_description":"Token signature verification failed"}

 

So looks like it is not considered to be malformed json.  

 

Nick

www.docpadz.com