Quantcast
Channel: Active questions tagged paypal - Stack Overflow
Viewing all articles
Browse latest Browse all 518

PayPal Payouts API - TRANSACTION_REFUSED Error (UNPROCESSABLE_ENTITY) During Order Authorization

$
0
0

I’m integrating PayPal Payouts into our application at Shipturtle, but I’m encountering a TRANSACTION_REFUSED error when trying to authorise an order. The error occurs when I make a POST request to the Payouts API. Below are the details of the issue, including the error response, code snippet, and steps I’ve tried.

Error Response:

{"name": "UNPROCESSABLE_ENTITY","details": [        {"issue": "TRANSACTION_REFUSED","description": "The request was refused"        }    ],"message": "The requested action could not be performed, semantically incorrect, or failed business validation.","debug_id": "348115ed2fa2f","links": [        {"href": "https://developer.paypal.com/api/rest/reference/orders/v2/errors/#TRANSACTION_REFUSED","rel": "information_link","method": "GET"        }    ]}

Code SnippetHere’s a simplified version of my Payouts API request (sensitive details omitted):

const requestBody = {  sender_batch_header: {    sender_batch_id: "batch_" + Math.random().toString(36).substring(9),    email_subject: "You have a payment",    email_message: "You received a payment. Thanks for using our service!"  },  items: [    {      recipient_type: "EMAIL",      amount: {        value: "10.00",        currency: "USD"      },      receiver: "recipient@example.com",      note: "Payment for services",      sender_item_id: "item_" + Math.random().toString(36).substring(9)    }  ]};fetch('https://api.paypal.com/v1/payments/payouts', {  method: 'POST',  headers: {'Content-Type': 'application/json','Authorization': 'Bearer <ACCESS_TOKEN>','PayPal-Request-Id': 'request_'+ Math.random().toString(36).substring(9)  },  body: JSON.stringify(requestBody)}).then(response => response.json()).then(data => console.log(data)).catch(error => console.error('Error:', error));

What I’ve Tried:

  1. Verified Account Status:
    • Confirmed my PayPal account has sufficient funds (more than $10.00 USD to cover the payout and fees).
    • Ensured the recipient’s email is associated with a verified PayPal account in a supported country.
    • Checked that my account is authorized for Payouts (applied and approved by PayPal).
  2. Checked API Request:
    • Validated the request body against PayPal’s Payouts API documentation.
    • Ensured the sender_batch_id and sender_item_id are unique.
    • Used a valid access token with the correct scope.
  3. Reviewed Documentation:
  4. Other Checks:
    • Tried a smaller payout amount ($1.00 USD) to rule out risk flags.
    • Contacted PayPal Merchant Technical Support with the debug ID (348115ed2fa2f), but awaiting a detailed response.

Questions:

  • What could be causing the TRANSACTION_REFUSED error in production?
  • Are there specific account settings or permissions I might be missing for Payouts?
  • Could this be related to risk/compliance checks, and how can I debug those?
  • Any suggestions for additional logging or checks to pinpoint the issue?

Environment

  • API: PayPal Payouts API (v1)
  • PayPal Account: Business, US-based, Payouts enabled

Any insights or solutions would be greatly appreciated! Let me know if you need more details about the request or response.


Viewing all articles
Browse latest Browse all 518

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>