question

venkat chathalavada avatar image
venkat chathalavada asked venkat chathalavada commented

Orders created via rest api shown in web dashboard but not on the terminal

Team,

I'm able to create order using rest api v3 (state is Open) and i can see the order in the webdashboard, but they are not showing up on the terminal. Also when i delete an order form web dashboard the item is still visible on terminal and unable to delete the item. Look's like the terminal is not syncing properly. How can i fix that. I tried restarting the terminal multiple still not working. The terminal is connected to sandbox.

Please see below Order json that is not showing up in the web dashboard but not in terminal

{

{
"href":"https://sandbox.dev.clover.com/v3/merchants/MSS456JKH6SZ1/orders/X4GD30TQJR002"
"id":"X4GD30TQJR002"
"currency":"USD"

"employee":{
"id":"20RXCQJ34XKDY"
}
"taxRemoved":false
"isVat":false
"state":"open"
"manualTransaction":false
"groupLineItems":true
"testMode":false
"createdTime":1579672851000
"clientCreatedTime":1579672851000
"modifiedTime":1579672850000
}



Thank you

Venkat

REST APISandbox
3 comments
10 |2000 characters needed characters left characters exceeded

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

I am also experiencing this issue.


I can create the order via the rest api and see it in the web dashboard, and when I open the Orders app on my emulator (Station 2018) and click the order it displays the error "The current order has been deleted".


I created the order with testMode false, and the emulator is not in test mode.


When I create an order via the emulator I can open those orders no problem in the app, only ones that are created via the api have the issue.


I have tried creating the order and line items following precisely the instructions here as well https://medium.com/clover-platform-blog/four-minute-guide-to-get-up-running-with-the-clover-rest-api-9df412038748 and these exhibit the exact same issue (cant view details of this order in the app).


I have done a diff of the orders in the rest api responses between one that works and one that doesn't, and the only difference is that the ones created via the emulator have a device field set.


I have tried rebuilding the emulator but that hasn't helped either.


If it helps I can provide my sandbox account ids and order numbers.

0 Likes 0 ·

Some more details:


I have checked the device logs and when I click sync in the orders app, I can see the following error (I have blanked out my ids):




2020-01-31 14:20:10.326 2258-5205/com.clover.engine I/CloverOkHttpClient: execute(CloverOkHttpClient.java:259): Completed method: GET, to URL: https://apisandbox.dev.clover.com/v3/merchants/XXXXX/orders/YYYYY/?autoExpand=true&limit=50, response: 500 (Internal Server Error), elapsed time: 174ms

2020-01-31 14:20:10.326 2258-5205/com.clover.engine I/OrdersProvider: onPerformSync(SyncProvider.java:354): IO exception syncing authority: com.clover.orders, exception: java.io.IOException: com.clover.common.http.JsonHttpClientException: {"message":"500 Internal Server Error"}


The order id in this message is the exact one which was created via the rest api, and is causing an HTTP 500 on your server.


0 Likes 0 ·

This has something to do with Sandbox environment. The same exact code works fine in prod.

0 Likes 0 ·
David Marginian avatar image
David Marginian answered venkat chathalavada commented

Are you saying the order is not visible in the Orders app on the device or are you expecting to see it somewhere else on the device?

7 comments
10 |2000 characters needed characters left characters exceeded

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

Yes order is not visible in Orders App on the terminal connected to my sandbox account

0 Likes 0 ·

https://docs.clover.com/clover-platform/docs/working-with-orders

Can you try making a call to update the state? I see that you have it set to open in the original creation post but I am not sure it works that way.


To change the order state, send a POST request to /v3/merchants/{mId}/orders/{orderId} with the following payload:

Order endpoint payload with open state

{
  "state": "open"
}


0 Likes 0 ·

tried that, see below same issue

0 Likes 0 ·
clover-issue.png (307.4 KiB)
Show more comments

Hope this helps


This my web dashboard has 4 open orders.


This is from orders app shows only 2 open orders


0 Likes 0 ·
venkat chathalavada avatar image
venkat chathalavada answered venkat chathalavada commented

Hello all,


This problem is solved, If you have this issue on dev kit, please do a factory reset on the device and reconnected it to the sandbox, the orders starts flowing back. However when i try to open the order in the order app, it says current order is deleted. I saw some messages on this topic none of them had a resolution.

Hope to see some answer on this :)


Thank you

Venkat

10 comments
10 |2000 characters needed characters left characters exceeded

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

Are you certain the order was not created in testMode? I see that per your original question you had testMode set to false, but I am not certain that all of the orders were created the same way.

0 Likes 0 ·

yes all orders are created with test mode set false. I tried switching the register app in the terminal to test mode and still getting the same error message.

0 Likes 0 ·

Can you dump the device logs and attach in a pastebib?

0 Likes 0 ·
Show more comments

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