Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
7 Răspunsuri
1318 Vizualizări

Hello,

After upgrade Odoo to V18, and follow this tutoriel for Paypal i got the error "Paypal : Failed to communicate with the API. Detail :" (https://www.odoo.com/documentation/18.0/fr/applications/finance/payment_providers/paypal.html#payment-providers-paypal-configuration-odoo)
Maybe i do something wrong, but i can't see what.

Could you help me please ?

Thank you.

Imagine profil
Abandonează
Cel mai bun răspuns

"GET /shop/payment HTTP/1.0" 200 - 44 0.022 0.088

2025-04-26 02:10:04,041 1 INFO odoo werkzeug: 172.18.0.1 - - [26/Apr/2025 02:10:04] "GET /im_livechat/assets_embed.css HTTP/1.0" 304 - 3 0.002 0.009

2025-04-26 02:10:04,052 1 INFO odoo werkzeug: 172.18.0.1 - - [26/Apr/2025 02:10:04] "POST /im_livechat/init HTTP/1.0" 200 - 17 0.011 0.013

2025-04-26 02:10:25,377 1 INFO odoo odoo.addons.payment_paypal.models.payment_transaction: Sending '/checkout/orders' request for transaction with reference S00045-2:

{'intent': 'CAPTURE',

 'payment_source': {'paypal': {'address': {'address_line_1': '14#2702 '

                                                             'Apartment 2702, '

                                                             'Building 14, '

                                                             'Meide City East, '

                                                             'Xunzi Street',

                                           'admin_area_1': '河北省',

                                           'admin_area_2': 'handan',

                                           'country_code': 'CN',

                                           'postal_code': '056107'},

                               'email_address': 'samxx8@163.com',

                               'experience_context': {'shipping_preference': 'NO_SHIPPING'},

                               'name': {'given_name': '',

                                        'surname': 'sam163'}}},

 'purchase_units': [{'amount': {'currency_code': 'USD', 'value': 1.15},

                     'description': 'Handan Qingque E-commerce Technology Co., '

                                    'Ltd.: S00045-2',

                     'payee': {'display_data': {'brand_name': 'Handan Qingque '

                                                              'E-commerce '

                                                              'Technology Co., '

                                                              'Ltd.',

                                                'business_email': 'green-magpie@outlook.com'},

                               'email_address': 'green-magpie@outlook.com'},

                     'reference_id': 'S00045-2'}]} 

2025-04-26 02:10:26,246 1 INFO odoo werkzeug: 172.18.0.1 - - [26/Apr/2025 02:10:26] "GET /zh_CN/forum/yuan-yi-ji-chu-2?sorting=last_activity_date+desc HTTP/1.0" 200 - 37 0.023 0.087

2025-04-26 02:10:26,562 1 ERROR odoo odoo.addons.payment_paypal.models.payment_provider: Invalid API request at https://api-m.paypal.com/v2/checkout/orders with data:

{'intent': 'CAPTURE',

 'payment_source': {'paypal': {'address': {'address_line_1': '14#2702 '

                                                             'Apartment 2702, '

                                                             'Building 14, '

                                                             'Meide City East, '

                                                             'Xunzi Street',

                                           'admin_area_1': '河北省',

                                           'admin_area_2': 'handan',

                                           'country_code': 'CN',

                                           'postal_code': '056107'},

                               'email_address': 'samxx8@163.com',

                               'experience_context': {'shipping_preference': 'NO_SHIPPING'},

                               'name': {'given_name': '',

                                        'surname': 'sam163'}}},

 'purchase_units': [{'amount': {'currency_code': 'USD', 'value': 1.15},

                     'description': 'Handan Qingque E-commerce Technology Co., '

                                    'Ltd.: S00045-2',

                     'payee': {'display_data': {'brand_name': 'Handan Qingque '

                                                              'E-commerce '

                                                              'Technology Co., '

                                                              'Ltd.',

                                                'business_email': 'green-magpie@outlook.com'},

                               'email_address': 'green-magpie@outlook.com'},

                     'reference_id': 'S00045-2'}]} 

Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/addons/payment_paypal/models/payment_provider.py", line 102, in _paypal_make_request

    response.raise_for_status()

  File "/usr/lib/python3/dist-packages/requests/models.py", line 1021, in raise_for_status

    raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api-m.paypal.com/v2/checkout/orders

2025-04-26 02:10:26,565 1 WARNING odoo odoo.http: PayPal: The communication with the API failed. Details:  

2025-04-26 02:10:26,568 1 INFO odoo werkzeug: 172.18.0.1 - - [26/Apr/2025 02:10:26] "POST /shop/payment/transaction/45 HTTP/1.0" 200 - 33 0.015 1.210

2025-04-26 02:10:39,435 1 INFO odoo werkzeug: 172.18.0.1 - - [26/Apr/2025 02:10:39] "GET /websocket?version=18.0-3 HTTP/1.0" 400 - 2 0.001 0.002

2025-04-26 02:11:04,201 1 INFO odoo werkzeug: 172.18.0.1 - - [26/Apr/2025 02:11:04] "GET /websocket?version=18.0-3 HTTP/1.0" 400 - 2 0.001 0.002





I encountered the same problem? It's unsolvable now...

Imagine profil
Abandonează
Cel mai bun răspuns

I am encountering the same issue and have followed all the provided guidelines, but I continue to receive a “Failed to communicate with the API” error.

Initially, I thought the issue was related to my instance, so I set up a trial instance on Odoo Online but experienced the same error. To rule out sandbox API credential issues, I tested with live credentials but encountered the same result.

As my next step, I plan to launch a new instance running Odoo Community 17 to verify if the issue persists in that version.

I would appreciate any insights or suggestions on resolving this matter. Thank you for your time and support everyone.

Imagine profil
Abandonează
Cel mai bun răspuns

Hi all, 

I have experienced the same issue but managed to resolve it on my end. It appears that the Odoo documentation is unclear. 


Please try these steps to configure correctly. Please note I am using sandbox environment. 

  1. Log into the Paypal developer dashboard, you will have 2 sandbox accounts set up automatically. 
    The Merchant (business) and personal (as a Consumer). 
  2. Create an API app for the merchant paypal email address.
  3. The client ID and secret key will be generated. 
  4. Log into paypal using the merchant account credentials (See Sandbox accounts for credentials).
  5. Navigate to Account settings > Website payments to set up the payment data transfer that will generate the Identity Token which we will use as our Webhook ID.


Getting your Client ID and secret key, and the merchant account credentials for Step 4.


To get your Webhook ID


Hope it helps.


Regards,

Audrey Ng

3D Photomation Pty Ltd

Imagine profil
Abandonează
Cel mai bun răspuns

We're experiencing the same issue after our upgrade.

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

you need to manual setup your PayPal Webhook in Odoo.

You find your Webhook ID here: https://www.paypal.com/businessmanage/preferences/website

Just copy to Odoo and use the PayPal App you used before. Odoo lost the Webhook during migration.


Imagine profil
Abandonează
Cel mai bun răspuns

Hi threre, i am facing the same problem. Customers cannot use paypal to pay my invoices.

I tried to find the problem by myself...

Seems like my Odoo 18.0 instance is not sending anything about the customer to paypal (missing name, address, postal code, city, country). only my business information was shared. Customer is private without Tax-ID, without PEPPOL.

2025-02-07 11:30:38,948 1 ERROR xxxxx odoo.addons.payment_paypal.models.payment_provider: Invalid API request at https://api-m.paypal.com/v2/checkout/orders with data:

{'intent': 'CAPTURE',
'payment_source': {'paypal': {'address': {'address_line_1': '',
                                           'admin_area_1': False,
                                           'admin_area_2': False,
                                           'country_code': False,
                                           'postal_code': False},
                               'email_address': 'xxxxxx@xx.xx',
                               'experience_context': {'shipping_preference': 'NO_SHIPPING'},
                               'name': {'given_name': 'xxxx',
                                        'surname': 'xxxxx'}}},
'purchase_units': [{'amount': {'currency_code': 'EUR', 'value': 1.0},
                     'description': 'xxxxxx: '
                                    'RE_xxxxxxx',
                     'payee': {'display_data': {'brand_name': 'xxxxx '
                                                              'xxxxxx',
                                                'business_email': 'xxxx@xxx.xx'},
                               'email_address': 'xxx@xx.xxx'},
                     'reference_id': 'RE_xxxxxxxx'}]}
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/addons/payment_paypal/models/payment_provider.py", line 102, in _paypal_make_request


Imagine profil
Abandonează
Cel mai bun răspuns

Hi, same problem here for me

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
apr. 25
3
3
mar. 25
2168
12
apr. 25
12700
1
feb. 25
594
2
dec. 24
1322