/v2/checkout/orders returned status: 422

KesWalker1
Contributor
Contributor

I am receiving the error code: 422 when clicking the paypal button or debit card option. It has been working fine when using sandbox client ID and secret. But now I have tried to use the Live credentials, it's throwing this error?  What can I do to solve this?

Login to Me Too
10 REPLIES 10

curt_b
Contributor
Contributor

I was getting this error because the total value of the order i was creating was not equal to the sum of the items and shipping cost on the order. So check for any discrepancies like that. 

 

 

Login to Me Too

zolbayarq
New Community Member

Really? 

 

I wonder why couldn't they just tell something like "Order amount mismatch..." in the response. 

Login to Me Too

KBe_
Contributor
Contributor

This error can be triggered when you have a "total" value with 3 decimal digits too. For example: USD 325.326. PayPal will only allow you to send numbers with 2 decimal digits, so you have to fix the number to 325.33.

Login to Me Too

realtebo
Contributor
Contributor

I faced exactly this issue.

 

I was sending 13.29999 and Paypal complained.

 

Side note

I hate the fact that this happened only in production. 

Our automated test caused ONLY payments with 2 decimals... statistically absurd, but true.

We added a test to force a number to be rounded.

 

Login to Me Too

bmchavez
New Community Member

very helpful, thanks!

Login to Me Too

Salma_0
New Community Member

I'm facing the same issue, could find a solution?

Login to Me Too

dke01
Contributor
Contributor

To view the exact error 

  1. Open your web brewers inspector / debug window (press F12)
  2. View the 'network' tab
  3. Reproduce the error - by clicking the checkout / paynow paypal button
  4. View the network traffic and click on the row that returns the HTTP 422 error
  5. View the Response 
    1. pay attention to the fields: 
      1. issue
      2. description

Untitled.png

Login to Me Too

Jayesh1409
Contributor
Contributor

I'm facing the same issue, could find a solution?

 

Uncaught Error: /v2/checkout/orders returned status 422 (Corr ID: f82369735659b).

Error: /v2/checkout/orders returned status 422 (Corr ID: f82369735659b).

{"name":"UNPROCESSABLE_ENTITY","details":[{"field":"/purchase_units/@reference_id=='default'/payee","location":"body","issue":"PAYEE_ACCOUNT_RESTRICTED","description":"The merchant account is restricted."}],"message":"The requested action could not be performed, semantically incorrect, or failed business validation.","debug_id":"f82369735659b","links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-PAYEE_ACCOUNT_RESTRICTED","rel":"information_link","method":"GET"}]}
at https://www.paypal.com/smart/buttons?style.layout=vertical&style.color=gold&style.shape=rect&style.t...
at n.dispatch (https://www.paypal.com/smart/buttons?style.layout=vertical&style.color=gold&style.shape=rect&style.t...

Login to Me Too

suheal007
Member
Member

same foe me 

  1. {name: "UNPROCESSABLE_ENTITY",…}
    1. debug_id: "f365048b934ab"
    2. details: [{field: "/purchase_units/@reference_id=='default'/payee", location: "body",…}]
    3. links: [{href: "https://developer.paypal.com/docs/api/orders/v2/#error-PAYEE_ACCOUNT_RESTRICTED",…}]
    4. message: "The requested action could not be performed, semantically incorrect, or failed business validation."
    5. name: "UNPROCESSABLE_ENTITY"
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.