How to fix "PAYEE_NOT_CONSENTED" error when integrating with REST API?

multi422
New Community Member

I created developer account and some sandbox test accounts.

I create order using client_id and client_secret of REST API app.

Then,  when I create order, I set payee email address, so that customers can pay another account, not API owner account.

            $response = self::$guzzleClient->post(
                    "/v2/checkout/orders",
                    [
                        'headers' => [
                            'Content-Type' => 'application/json',
                            'Accept'     => 'application/json',
                            'Authorization' => "Bearer $accessToken"
                        ],
                        'json' => [
                            'intent' => 'CAPTURE',
                            'purchase_units' => [
                                [
                                    'amount' => [
                                        'value' => floatval(str_replace(',', '.', str_replace('.', '', $invoice->total))),
                                        'currency_code' => 'EUR',
                                    ],
                                    'payee' => [
                                        'email_address' => "..."
                                    ]
                                ]
                            ],
                            'payment_source' => [
                                "paypal" => [
                                  "experience_context" => [
                                    "payment_method_preference" => "IMMEDIATE_PAYMENT_REQUIRED",
                                    "payment_method_selected" => "PAYPAL",
                                    "brand_name" => "Billfox",
                                    "locale" => "de-DE",
                                    "landing_page" => "LOGIN",
                                    "shipping_preference" => "SET_PROVIDED_ADDRESS",
                                    "user_action" => "PAY_NOW",
                                    "return_url" => "https://example.com",
                                    "cancel_url" => "https://example.com"
                                  ]
                                ]
                            ]
                        ]
                    ]
                );

But, when I capture the order, "PAYEE_NOT_CONSENTED" error shows me.
How can I fix it?
Login to Me Too
1 REPLY 1

MTS_Chiranjeevi
Moderator
Moderator

Good day @multi422,

 

Thank you for posting to the PayPal community.

 

https://developer.paypal.com/api/rest/reference/orders/v2/errors/#patch-order 

 

NOT_AUTHORIZEDAuthorization failed due to insufficient permissions.
  • PAYEE_NOT_CONSENTED: Payee does not have appropriate consent to allow the API caller to process this type of transaction on their behalf. Your current setup requires the payee to provide a consent before this transaction can be processed successfully.

 

Please use the same sandbox REST API credentials (Client ID and Secret, which you have used while performing the Create Order API call) in the Capture API call. 

 

If your trying to Capture funds on behalf of other sandbox account, please make sure to on-board that sandbox particular seller/merchant account and

the seller can then grant you API permission to process payments on their behalf.

 

https://developer.paypal.com/docs/multiparty/ 

 

https://developer.paypal.com/docs/multiparty/seller-onboarding/ 

 

If your still facing the issue, please create a MTS ticket via - https://www.paypal-support.com/s/?language=en_US with detailed error information. 

 

Sincerely,

Chiranjeevi

PayPal/Braintree MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.