cancel
Showing results for 
Search instead for 
Did you mean: 

Who Me Too'd this topic

Problems with Payouts (422) Unprocessable Entity/INSUFFICIENT FUNDS

robert_exc
Contributor
Contributor

 

 

Using sandbox, .NET SDK.

Im trying to make a payout with the code below. Im getting error "(422) Unprocessable Entity."

with an inner message "INSUFFICIENT FUNDS". I have created a new Sandbox (merchant) account with 

tons on Money, created a new App that uses this account and regenerated new client key/secret for this

new and loaded account. I still get the same error… I can see my unsuccessful calls on my dashboard, but

no further info. Any leads? 

 

 

public void MakePayout()
        {
            // Get a reference to the config
            var config = ConfigManager.Instance.GetProperties();
            // Use OAuthTokenCredential to request an access token from PayPal
            var accessToken = new OAuthTokenCredential(config).GetAccessToken();
            var apiContext = new APIContext(accessToken);
 
            var payout = new Payout
            {
                sender_batch_header = new PayoutSenderBatchHeader
                {
                    sender_batch_id = "1524086406556",// "batch_" + Guid.NewGuid().ToString().Substring(0, 8),
                    email_subject = "This email is related to simulation"
                },
                items = new List<PayoutItem>
            {
                new PayoutItem
                {
                    recipient_type = PayoutRecipientType.EMAIL,
                    amount = new Currency { value="1.5", currency="USD" },
                    receiver = "payouts-simulator-receiver[at-but-the-real-at-sign]paypal.com",
                    note="ERRPYO002",//https://developer.paypal.com/docs/payouts/integrate/test-payouts/#simulation-methods
                    sender_item_id = "15240864065560"
                }
            }
            };
            var created = payout.Create(apiContext, false);           
        }
Login to Me Too
Who Me Too'd this topic