Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in

Le Forum de la communauté n’est pas disponible pour les nouveaux messages ou les réponses; les articles précédents restent disponibles pour vérification. Afin de connaître les options d’assistance complètes, rendez-vous sur PayPal.com/HelpCenter

Si vous souhaitez signaler du contenu illégal et contraire au Règlement sur les services numériques de l’Union Européenne (DSA), veuillez cliquer ici.

since ‎Sep-23-2017
Lunardi
Lunardi Contributor
Contributor
2
Posts
2
Kudos
0
Solutions
Your 3rd PayPal Anniversary
Your PayPal Anniversary
The Return
Liked
Ice Breaker
Active
View all
Latest Contributions by Lunardi
  • Topics Lunardi has Participated In
  • Latest Contributions by Lunardi

Re: Payout API I get Error 422

by Lunardi Contributor in REST APIs
‎Sep-23-2017 03:10 PM
2 Kudos
‎Sep-23-2017 03:10 PM
2 Kudos
I have solved the problem. In the catch paragraph I added this line echo "PayPal Payout GetData:<br>". $ex->getData() . "<br><br>"; which reported INSUFFICIENT FUNDS. Then I discovered that we can't add funds to a sandobox account. We have to create a new sambox account with large funds, then re-create the App Rest, get new credentials, add the Webhook, the Return URL, change the Credentials in our php code... A mess. ... View more

Payout API I get Error 422

by Lunardi Contributor in REST APIs
‎Sep-23-2017 09:43 AM
‎Sep-23-2017 09:43 AM
I try to execute the payout API with a payout using this code   require __DIR__ . '/PayPal-PHP-SDK/autoload.php'; $apiContext = new \PayPal\Rest\ApiContext( new \PayPal\Auth\OAuthTokenCredential( '123456...', // ClientID '789012...' // ClientSecret ) ); $payouts = new \PayPal\Api\Payout(); $senderBatchHeader = new \PayPal\Api\PayoutSenderBatchHeader(); $senderBatchHeader->setSenderBatchId(uniqid()) ->setEmailSubject("You have a payment from us") ->setRecipientType("Email"); // We try one only payment for now for($i = 0; $i < 1; $i++) { $senderItem = new \PayPal\Api\PayoutItem( array( "receiver" => "existing_paypal_account_email", "note" => "Thank you.", "sender_item_id" => uniqid(), "amount" => array( "value" => (($i+1) * 0.11), "currency" => "EUR" ) ) ); $payouts->setSenderBatchHeader($senderBatchHeader) ->addItem($senderItem); } $request = clone $payouts; try { $output = $payouts->create(null, $apiContext); } catch (Exception $ex) { echo "PayPal Payout Error: ". $ex . "<br><br>"; echo "Batch Payout: ". $request . "<br><br>"; exit(1); }   And I get this error   EX: exception 'PayPal\Exception\PayPalConnectionException' with message 'Got Http response code 422 when accessing https://api.sandbox.paypal.com/v1/payments/payouts?.' in /mysite.com/test/APIs/PayPal/PayPal-PHP-SDK/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalHttpConnection.php:183 Stack trace: #0 /mysite.com/test/APIs/PayPal/PayPal-PHP-SDK/paypal/rest-api-sdk-php/lib/PayPal/Transport/PayPalRestCall.php(73): PayPal\Core\PayPalHttpConnection->execute('{"sender_batch_...') #1 /mysite.com/test/APIs/PayPal/PayPal-PHP-SDK/paypal/rest-api-sdk-php/lib/PayPal/Common/PayPalResourceModel.php(102): PayPal\Transport\PayPalRestCall->execute(Array, '/v1/payments/pa...', 'POST', '{"sender_batch_...', NULL) #2 /mysite.com/test/APIs/PayPal/PayPal-PHP-SDK/paypal/rest-api-sdk-php/lib/PayPal/Api/Payout.php(122): PayPal\Common\PayPalResourceModel::executeCall('/v1/payments/pa...', 'POST', '{"sender_batch_...', NULL, Object(PayPal\Rest\ApiContext), NULL) #3 /mysite.com/test/APIs/PayPal/PayPal_BatchPayout.php(148): PayPal\Api\Payout->create(NULL, Object(PayPal\Rest\ApiContext)) #4 {main}   What do I miss in the code? It already worked for about 6 times. Now it won't.   ... View more
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros