11

I am facing below error while placing an order on Magento 2 store with payment method Cash On Delivery.

POST http://yoursite.com/rest/ae_en/V1/carts/mine/payment-information 400 (Bad Request)

Is there anyone who faced same issue?

7
  • 1
    Try http://yoursite.com/rest/default/V1/carts/mine/payment-information or http://yoursite.com/rest/V1/carts/mine/payment-information
    – Jackson
    Jan 23, 2017 at 9:42
  • 1
    Where should i change this? This is native Magento's cash on delivery method. I tried with Bank Transfer and it didn't worked for that as well. Jan 23, 2017 at 10:11
  • 1
    Using REST Client u can do that chrome://restclient/content/restclient.html
    – Jackson
    Jan 23, 2017 at 10:12
  • 1
    you have to find out, what the error message really says. where it is stored, depends on your deploy mode. A good starting point would be to delete var/report and var/log folders, then reproduce the error and see if anything is added in one of the folders Jan 25, 2017 at 20:23
  • When enabling display_errors = 1 at .user.ini you got to know the error reason.then you can be able tosolve this Apr 26, 2017 at 9:16

4 Answers 4

4

Please check root_dir/var/report/api folder if exist or root_dir/var/exception.log file you will get the reason probably.

1

400 bad request could mean all sort of things. When encountered in the checkout it's usually some required fields that are missing. You should enable developer mode and try to track back the error. Chances are that you will get a 500 server error with an exception that reveals the path.

I've had this error also a couple of times when using the Checkout REST API, and in my case it was a missing phone number from my shipping address. Some checkout modules allow to hide the phone number from checkout and whilst this will pass most validation steps it will throw an exception when trying to save the address. However, this exception might be hard to catch because the API might say something like 'something is wrong' and masking the original exception.

1
  • Thanks for your answer! I was troubleshooting checkout errors and this comment helped me reproduce an intermittent issue I was running into (by removing the telephone number for an existing customer address). May 29, 2020 at 1:20
0

In my case, it is fixed by adding new values in database. You can also try

Goto Magento database and open table sequence_order_1 and set 2 new value to the database like currently if your table shows 10 as last value, so Insert 11, 12 as new values

1
  • 1
    how does this fix the issue? is there a code reference where this will prove to address the issue? Thanks.
    – dchayka
    Nov 15, 2018 at 0:21
0

In my case it was because I was working on a VM without internet connection.

It worked after I enabled the connection.


First I tried to debug it, by opening the URL with the Bad Request 400 in my browser. It was giving me the error:

"The consumer is not authorized to access% resources."

but that error is still showing, after it works again after I am connected, so dont let you mislead by this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.