# Troubleshooting

> The [product endpoint](/api/endpoints/products-find-one) keeps returning a product with
> `status !== "online"`, so state-change calls have nothing to act on.

## Product status is never `online`

- Confirm the product's Gateway is added to the **same lot** as the product (see
  [Device Registration](/get-started/what-you-need)).
- Confirm the Gateway itself is online — check for a
  [`gateway_status`](/realtime/events#gateway_status) event, or its LED state per the
  [Gateway manual](https://parklio.com/assets/support/gateway/Parklio-Gateway-UM.pdf).
- Try operating the product manually from the Parklio Connect App — if it doesn't
  respond there either, this is a hardware/Bluetooth range issue, not an API issue.

## Gateway won't pair

- Gateways only accept pairing for a short window after a short press of the power
  button (LEDs blinking). If the window has passed, press again and retry immediately
  in the Connect App.
- Make sure the gateway has network connectivity (Ethernet link or GSM signal) before
  pairing — a gateway with no uplink can pair locally but won't be able to relay
  commands to/from the API.

## The state-change call returns an error

[`POST /v2/products/{id}/state`](/api/endpoints/products-change-state) checks a few
things before it sends anything to the device. These errors come back straight away:

| Code | HTTP status | What it means | What to do |
| --- | --- | --- | --- |
| `214` | 403 | An earlier operation on this device hasn't finished. | Wait for the earlier operation's `lot_change` or `gateway_error`, then send the next one. Don't retry in a loop. |
| `704` | 403 | No Gateway has seen the device recently, so there's no way to reach it. | Check that a Gateway on the same lot is online and in range of the product (see [above](#product-status-is-never-online)). |
| `30` | 403 | Your subscription doesn't include remote control for this product. | Check the product's API subscription; see [Account Setup](/get-started/what-you-need). |

## A state-change call never resolves

You called [`POST /v2/products/{id}/state`](/api/endpoints/products-change-state), got
back an `event_id`, but never see a matching
[`lot_change`](/realtime/events#lot_change) event on your WebSocket connection.

How delivery works: the API tries the Gateways that recently saw the device **one at a
time, strongest signal first, waiting up to 30 seconds for each**. So a result can take
30 seconds or more per Gateway on the lot. When every Gateway fails, or the device
reports an error, you get a [`gateway_error`](/realtime/events#gateway_error) with your
`event_id`; a `type` of `"Timeout"` means no Gateway answered in time.

- Make sure you're connected to the WebSocket **before** issuing the state-change call,
  using the same account/token; see [Connecting](/realtime/connecting).
- Check for a [`gateway_error`](/realtime/events#gateway_error) event instead. It
  reports the same `event_id` when the operation fails (for example, a barrier jamming
  while closing) rather than succeeding.
- If neither event ever arrives, the Gateway may have lost connectivity mid-operation;
  check gateway status as above.

## Still stuck?

[Contact Support](https://tickets.parklio.com/) with your account ID, the
product/gateway IDs involved, and roughly when the issue occurred.
