Trouble with Payouts API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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"
}
}
]
}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- when I payout , webhook URL cannot receive callbacks. in Sandbox Environment
- Handling payouts that are being on hold/blocked in REST APIs
- Refunding an order via HATEOAS URL failing with NOT_AUTHORIZED error in Sandbox Environment
- Payouts not working with live Credentials in REST APIs
- I am trying to use Payments Standard and having trouble... in PayPal Payments Standard