9

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?

  • 1
    Try http://yoursite.com/rest/default/V1/carts/mine/payment-information or http://yoursite.com/rest/V1/carts/mine/payment-information – Ankit Shah Jan 23 '17 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. – Ravi Bhalodia Jan 23 '17 at 10:11
  • 1
    Using REST Client u can do that chrome://restclient/content/restclient.html – Ankit Shah Jan 23 '17 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 – David Verholen Jan 25 '17 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 – Visakh B Sujathan Apr 26 '17 at 9:16
2

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

0

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.

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
    how does this fix the issue? is there a code reference where this will prove to address the issue? Thanks. – dchayka Nov 15 '18 at 0:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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