PHP SDK - Payout Error
harrisonsmith
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Apr-05-2019
07:14 AM
I'm getting an error when using this code.
global $apiContext; $s = curl_init("https://api.sandbox.paypal.com/v1/payments/payouts"); curl_setopt($s, CURLOPT_URL, "https://api.sandbox.paypal.com/v1/payments/payouts"); curl_setopt($s, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Authorization: Bearer ' . $apiContext->getCredential()->getAccessToken(array()))); curl_setopt($s,CURLOPT_POST,true); curl_setopt($s, CURLOPT_POSTFIELDS, $payouts->toJSON([ 'batch_header' => [ 'sender_batch_header' => [ 'email_subject' => 'You\'ve been paid by XXXX' ] ], 'payout_item' => [ 'recipient_type' => 'EMAIL', 'amount' => [ 'value' => '1.00', 'currency' => 'USD', ], 'note' => 'XXX Ltd.', 'receiver' => 'email_here' ] ])); $result = curl_exec($s); curl_close($s);
This is my error:
{"name":"VALIDATION_ERROR","debug_id":"3e8d70b2b31a0","message":"Invalid request - see details","information_link":"https://developer.paypal.com/docs/api/payments.payouts-batch/#errors","details":[{"field":"items","issue":"size must be between 1 and 15000"},{"field":"sender_batch_header","issue":"may not be null"}]}
Any ideas on how to fix this? The request is coming up in my API calls, but it's not working. I read that it could be something to do with 'sync_mode'... HELP!
Labels:
- Labels:
-
Payouts Rest APIs
0 REPLIES 0
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Paypal express checkout, payment they error "Sorry, something went wrong. Please try again." in PayPal Payments Standard
- Add Others data in SDKs
- Getting errors when integrating standard checkout with my web site. Probably a beginner problem. in SDKs
- Get error message "Someting went wrong" when the sandbox account tap "Agree and Connect" button. in Sandbox Environment
- Connecting with site to take payments in Payflow