Devices API: Remote Device Monitoring for the Square Terminal (Beta)

We’re excited to release Remote Device Monitoring for the Square Terminal on the Devices API in beta . Now, you can remotely monitor the status of Square Terminal devices running a Terminal API application in real-time, such as its network connectivity, battery level, and more, for improved operational efficiency.

Check out the documentation and drop any questions down below!

1 Like

Is there anything in particular we have to do to get this to work? I keep getting the message “Could not find device matching device_id: xxxxxxxxxxxxxxxx”. The device does exist, is on and online. Not sure what I’m missing here.

I’m using the Nodejs sdk.

No, this will work out of the box. Is the device_id one that was created with the Devices API? Or was the device created in the Seller Dashboard? :slightly_smiling_face:

Hmm, I’m not sure what you mean. Is the device id not the serial printed on the bottom of the terminal device?

Just to give a bit more info/context. We have an app that uses the terminal api, we can pair terminals to our “POS” stations. Everything work fine. However, for some reason towards the end of the day, <4pm, a lot of the POS start to misbehave; checkouts don’t get created, webhooks don’t get sent, etc. The most likely culprit is that the terminal is stuck/unreachable. So we would like to interrogate the terminal before we try to create a checkout. Pinging the terminal takes too long, so I saw this endpoint and thought we could use it. But it always errors out.

All our terminals were setup through the Devices API.

What’s your application ID and what errors are you getting? :slightly_smiling_face:

App Id: sq0idp-e40Zku_jq6CCmmS4eQx1TA
Error:

  headers: {
    date: 'Tue, 17 Oct 2023 18:06:07 GMT',
    'content-type': 'application/json',
    'content-length': '149',
    connection: 'close',
    'cf-ray': '817a793f9ece62a5-ORD',
    'cf-cache-status': 'DYNAMIC',
    'strict-transport-security': 'max-age=631152000; includeSubDomains; preload',
    'frame-options': 'DENY',
    'square-version': '2023-09-25',
    'squareup--connect--v2--common--versionmetadata-bin': 'CgoyMDIzLTA5LTI1',
    'x-content-type-options': 'nosniff',
    'x-frame-options': 'DENY',
    'x-sq-dc': 'aws',
    'x-sq-region': 'us-east-1',
    'x-xss-protection': '1; mode=block',
    'set-cookie': [
      '__cf_bm=34Yjh3TVlUjVDtH2Te1l0MIhs7D4BvpHtUUF697KHGI-1697565967-0-AV7x+w6vD+/x2j5A9cW2a3nL1dxZK7MBeiu2BBmebWmubwVKUhN8S4G/m
pmgp5o4i4BwM0AuZCZtfy5P8LZ4h4E=; path=/; expires=Tue, 17-Oct-23 18:36:07 GMT; domain=.connect.squareup.com; HttpOnly; Secure; SameSite=None'
    ],
    server: 'cloudflare'
  },
  body: '{"errors": [{"code": "NOT_FOUND","detail": "Could not find device matching device_id: \\"226CS149B1002723\\"\\n","category": "INVALID_REQUEST_ERROR"}]}\n',
  result: [Object: null prototype] { errors: [ [Object: null prototype] ] },
  errors: [
    [Object: null prototype] {
      code: 'NOT_FOUND',
      detail: 'Could not find device matching device_id: "226CS149B1002723"\n',
      category: 'INVALID_REQUEST_ERROR'
    }
  ]
}

Edit: I’m a new user and so am only allowed 3 replies :0. I wanted to at least leave something here for posterity.

Reply:
OMG. Thank you so much. I thought I was going crazy.

Also: Terminal Device Monitoring

Here is a link to the docs. You can see why I was just passing the device_id. It also looks like a UUID, which made me think I had the wrong device_id altogether. None of my ids look like that.

If you pass in device:226CS149B1002723 it should work. It’s a bit confusing but the prefix device: needs to be included. :slightly_smiling_face:

1 Like