cancel
Showing results for 
Search instead for 
Did you mean: 

/v2/checkout/orders returned status: 422

Options
KesWalker1
Contributor
Posted on

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?

8 REPLIES 8

/v2/checkout/orders returned status: 422

Options
curt_b
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. 

 

 

/v2/checkout/orders returned status: 422

Options
zolbayarq
New Community Member

Really? 

 

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

/v2/checkout/orders returned status: 422

Options
KBe_
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.

/v2/checkout/orders returned status: 422

Options
realtebo
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.

 

/v2/checkout/orders returned status: 422

Options
bmchavez
New Community Member

very helpful, thanks!

/v2/checkout/orders returned status: 422

Options
Salma_0
New Community Member

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

/v2/checkout/orders returned status: 422

Options
dke01
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

/v2/checkout/orders returned status: 422

Options
Jayesh1409
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...

Haven't Found your Answer?

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