question

lti avatar image
lti asked bryanvargas commented

Bad Request 400

Hello,

I am sending a Post request to the URL below along with the Json body but for some reason I am getting a 400 bad request error. Please see below. Is anyone else getting this error message? Thanks!


URL: https://sandbox.dev.clover.com/invoicingcheckoutservice/v1/checkouts

----------------------------------------------------------------------------

request.AddJsonBody("{\"customer\":{\"address\":{\"address1\":\"test\",\"state\":\"IL\",\"city\":\"Test\",\"country\":\"US\",\"zip\":\"55555\"},\"firstName\":\"test\",\"lastName\":\"test\",\"email\":\"test.test@gmail.edu\",\"phoneNumber\":\"333333333\",\"id\":\"1234\"},\"shoppingCart\":{\"lineItems\":[{\"note\":\"Seminar\",\"price\":100,\"name\":\"Ticket\",\"unitQty\":1}]}}");

----------------------------------------------------------------------------

{"status":{"reason":"Bad Request","code":400},"message":"JSON parse error: Cannot construct instance of `com.clover.invoicingcheckoutservice.checkout.dto.CreateCheckoutRequest` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('{\r\n \"customer\": {\r\n \"FirstName\": \"test\",\r\n \"LastName\": \"test\",\r\n \"Email\": \"test.test@gmail.edu\",\r\n \"PhoneNumber\": \"333333333\",\r\n \"address\": {\r\n \"Address1\": \"tet\",\r\n \"City\": \"test\",\r\n \"State\": \"IL\",\r\n \"Country\": null,\r\n \"Zip\": \"55555\"\r\n }\r\n },\r\n \"shoppingCart\": {\r\n \"lineItems\": [\r\n {\r\n \"Note\": \"Symposium\",\r\n \"Price\": \"1.5\",\r\n \"Name\": \"test\",\r\n \"unitQty\": \"1\"\r\n }\r\n ]\r\n }\r\n}'); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.clover.invoicingcheckoutservice.checkout.dto.CreateCheckoutRequest`

REST API
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

bryanvargas avatar image bryanvargas ♦♦ commented ·
Check your payload again and make sure you don't have an extra/missing character
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community