Hello There,
Can someone help me understand why I always get the status of the device as “Available”. I turned off the device to check if the status changes to Unavailable but it’s not changing. I am developing a custom POS. I need to ping the device before I send the Total amount to it.
Here is what I have used:
# Set the request headers
headers = {
'Authorization': f'Bearer {SQUARE_ACCESS_TOKEN}',
'Content-Type': 'application/json',
}
# Set the device status URL
device_status_url = f'https://connect.squareup.com/v2/devices/device%3A{SQUARE_DEVICE_ID}'
# Send a GET request to check the device status
response = requests.get(device_status_url, headers=headers)
print(response.text)
It shows be correct status only after a couple of hours. There ought to be a way to get the device status on a real time basis. Can you suggest me any other way?