question

rmgas avatar image
rmgas asked rmgas commented

Device IDs coming in scrambled across the API

The JSON I get back from the API is giving me jibberish for the DeviceID and it's causing my JSON parser to crap out when trying to parse. An example of this is as follows:

"device": { "href": "", "id": "|\u0013Ê\u001D(\tED¶†EtT¿ªw", "name": null, "model": null, "merchant": null, "orderPrefix": null, "terminalId": null, "terminalPrefix": null,...

I'm uncertain if it's the contents of this that is causing the problem or there is something that is causing the device ID to give me jibberish is also causing it to serve me malformed JSON.

Anyone else running into this? Did the API change recently? Started noticing this about a week ago and was writing it off as just some bad data entered somewhere.
API Token
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.

rmgas avatar image rmgas commented ·
Correction: I'm using
  • /v3/merchants/{mId}/orders/{orderId}/payments
endpoint and I am specifically getting a malformed JSON exception. I am using Java and the GSON libraries. Despite you telling me there is no issue with that endpoint, the following is raw data from your API showing the device ID... Please re-evaluate.

"id": "|\u0013Ê\u001D(\tED¶†EtT¿ªw",
0 Likes 0 ·
John Jenner avatar image John Jenner rmgas commented ·
@Chanel, this post got highjacked with a similar issue. RMGAS corrected his earlier details stating his issue is with
  • /v3/merchants/{mId}/orders/{orderId}/payments
Are you saying we need to now create a new post to get some help with this? Are the details provided in @rmgas post above enough?
0 Likes 0 ·
racheladmin avatar image
racheladmin Deactivated answered rmgas commented
Thank you for reporting this issue. Can you confirm that this is confined to
  • GET /v3/merchants/{mId}/refunds
  • GET /v3/merchants/{mId}/refunds/{refundId}
As a workaround, you can access correctly formatted order and payment DeviceIds from the following endpoints:
  • /v3/merchants/{mId}/orders/{orderId}
  • /v3/merchants/{mId}/payments/{paymentId}
For more details, see: https://mailchi.mp/clover/clover-api-service-inter...
4 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.

rmgas avatar image rmgas commented ·
I'm actually using
  • /v3/merchants/{mId}/payments/{paymentId}
to get the information.
0 Likes 0 ·
chanel avatar image chanel rmgas commented ·

That endpoint is not experiencing this issue at all. If you are still seeing this error, please create a new question with additional details, including step by step reproduction, environment details, etc. Please see our guide on How to Ask Good Questions.

0 Likes 0 ·
John Jenner avatar image John Jenner commented ·
So the suggested workaround has the same issue? @racheladmin how do we escalate this issue? our clients have been without reporting for a week now.
0 Likes 0 ·
chanel avatar image chanel John Jenner commented ·

The workarounds are not experiencing this issue at all. If you are still seeing this error, please create a new question with additional details, including step by step reproduction, environment details, etc. Please see our guide on How to Ask Good Questions.

0 Likes 0 ·
chanel avatar image
chanel Deactivated answered John Jenner commented
@rmgas @John Jenner Sorry about that but there seems to be some confusion about where this specific issue is located and how the workarounds are meant to be used.

The device id returns a garbled string when the information is nested in the refund object, regardless of how it is accessed. IE, refund.orderRef.device returns what you've stated here. However, that same information can be gotten simply by using the other endpoints (described below). Unfortunately, this means you'll need to make additional calls get get the correct data.

Unfortunately, Clover app and App Market app approvals are currently under a code freeze from Friday, November 16, 2018 to Wednesday, January 2, 2019 and will not be releasing non-critical bug fixes until afterwards.

While we do intend to fix this, you can apply a temporary fix on your side by grabbing the device ID from a different field. You can determine where the secondary location of the device ID using the information I've provided below.

  • refund.device should have no issues
  • refund.orderRef.device == order.device
  • refund.payment.device == payment.device
  • payments.refunds.orderRef.device == order.device
  • order.payment.refunds.orderRef.device == order.device
Please let me know if you still need additional information or details.
3 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.

rmgas avatar image rmgas commented ·

Is this work around a temporary fix while your devs work on the issue or is this a perminent emplacement?

0 Likes 0 ·
chanel avatar image chanel rmgas commented ·

Yes, this is a workaround to use while our developers determine the cause and fix the issue.

0 Likes 0 ·
John Jenner avatar image John Jenner commented ·

i.e. this code was working fine for months then suddenly broke. Also the same code is currently working with other merchant accounts. It's only broke for one of our clients.

0 Likes 0 ·
rmgas avatar image
rmgas answered
@Channel, this bug only seems to be affecting one of our three merchants. I’m assuming that it was upgraded but the others weren’t. If this is the case, is it possible to revert to a previous version? I’m just asking for the moment but my co worker on this ticket will need to make that call if it is indeed an option.
10 |2000

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