question

Alan avatar image
Alan asked lilly Deactivated commented

API Created Orders and Employee IDs - Functionality has changed

Our API created orders are suddenly not appearing in the orders app when created without an employee id. I raised the bug about the strange employee assigning process back in April https://community.clover.com/questions/2550/viewin... and @Lilly confirmed that it was working as designed.
Now suddenly (since the 12hr sandbox outage yesterday) the orders aren't appearing in the order app unless I assign an employee ID to the order.
If this is a recent intended change:
  1. Please consider the lack of visibility app devs currently have with silent API changes and system status.
  2. Please describe how API created orders should work in regards to assigning employee ids.
Orders
10 |2000

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

chanel avatar image
chanel Deactivated answered lilly Deactivated commented
Hey there, @Alan. If you're not seeing the orders in the app, it may be because the `state` of the order is `null`. When the state is null (or defaults to null) the order will not show up in the app. You would have to set the state to "open" when you create the order so that you can continue to interact with it and have it show up in the app.

Can you confirm what you're setting the order state to?
2 comments
10 |2000

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

Alan avatar image Alan commented ·

I am setting the order state as "locked".

I can confirm:

  1. API Created orders (without employee ID) appeared for my admin user up until yesterday (see my conversation from April with @Lilly who confirmed the process)
  2. Since yesterday, the same orders created via the API now won't appear for the same admin user, unless I add the employee ID
  3. I've confirmed/isolated it as an employee id issue by:
    1. Creating an API order as I have been doing since April
    2. Verifying my admin user (or any other user) is unable to see the order in their order app (and yes, I've tried syncing the orders and restarting the clover)
    3. POSTing only the following to the order: {"employee": {"id": "3AF70EJHYC3S4"}}
    4. Verifying that the employee with that ID can now see the order
0 Likes 0 ·
lilly avatar image lilly Alan commented ·

Hey @Alan - Can you provide an example body of your request?

I've tried creating orders with only {"state":"locked"} and it's been showing up on my devices. Sometimes I need to press "sync" to sync up the Orders app but otherwise they're following the same rules as when we last spoke (employee doesn't show, but is assigned after I view the order on my device).

Can you also confirm if you're using an OAuth generated token or a merchant generated token (from the Setup app)?

1 Like 1 ·
Alan avatar image
Alan answered lilly Deactivated commented
Hi @Lilly,
I've tested the following with an OAuth token and a merchant generated token, both on sandbox:
1.
POST a new simple order to sandbox.dev.clover.com/v3/merchants/A3QRX.../orders/
{"state":"locked"}
2. Open the orders app and check for the new order:
  1. with an admin employee
  2. sync (tried multiple times)
  3. wait for syncing to complete
  4. Ensure all the filters are set to view all orders
3. Unable to see the order for that employee, and have tried other employees and 'Quick access' employee and see nothing.
4. Update the order with an employee id:
POST to sandbox.dev.clover.com/v3/merchants/A3QRX.../orders/orderId
{"employee": {"id": "3AF70EJHYC3S4"}}
5. Notice now the order is visible on whatever employee id I used after a usual sync on the orders app

I've just tested those simple scenarios on sandbox today, but I've been doing more complicated api ordering since April with line items/payments and order total updates, which also only appear after updating with an employee id, which should also prove it's not something to do with my order state, or requiring updating the order total before it's visible.

Thanks for investigating @Lilly & @Chanel, let me know if I can help debug.
6 comments
10 |2000

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

Alan avatar image Alan commented ·

I can see the order on my web dashboard without having to post an employee ID: https://sandbox.dev.clover.com/orders/m/A3QRXA52GFZX6/orders/RK98F92T7H44T?groupLineItems=true

Also possibly related: when I click 'Edit Employee' on that order, it brings me to this page with an undefined error https://sandbox.dev.clover.com/employees/m/A3QRXA52GFZX6/employees/undefined

0 Likes 0 ·
lilly avatar image lilly commented ·

Hi @Alan,

We've done some investigation and it looks like we've able to reproduce what you're seeing in Sandbox when using a merchant-generated access token, so we'll file a bug for that. This should not impact production as merchant-generated tokens should not be used in prod.

We were not able to reproduce using an OAuth token - the OAuth token we found automatically assigns the employee as the manager.

Can you confirm you're seeing this behavior with OAuth generated tokens as well?

0 Likes 0 ·
Alan avatar image Alan lilly commented ·

Thanks @Lilly I'm generating my authTokens via our android app on a physical sandbox clover mini:

com.clover.sdk.util.CloverAccount.getAccount(context);
AND then
com.clover.sdk.util.CloverAuth.authenticate(context, account)

I'm not sure how the employee ids work in that case. Our token for that sandbox app hasn't changed in months, and I've been using the same employee for months too. I'm happy to share the token over email if that would help debug?

0 Likes 0 ·
lilly avatar image lilly Alan commented ·

Thanks @Alan we were able to reproduce using the SDK-generated token as well, so we'll file a ticket to get those looked at and fixed. Thank you for bringing this to our attention!

1 Like 1 ·
Show more comments

Welcome to the
Clover Developer Community