> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/docs/developers/api-documentation/device/link-a-physical-device.md).

# Link a physical device

Link a physical device to a device registered in Flow. A wrong password — the user's PIN — counts on the same ladder as the tenant user verify-pin operation describes, and a correct one resets it; a user whose PIN has a wait running or is locked is refused exactly as a wrong password, without being counted.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Device","description":"Device"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"paths":{"/device/{deviceCode}/link":{"post":{"description":"Link a physical device to a device registered in Flow.\nA wrong password — the user's PIN — counts on the same ladder as the tenant user verify-pin operation describes, and a correct one resets it; a user whose PIN has a wait running or is locked is refused exactly as a wrong password, without being counted.","operationId":"post-device-link","responses":{"200":{"$ref":"#/components/responses/DeviceLinkResponse"},"400":{"$ref":"#/components/responses/GenericErrorResponse"},"401":{"description":"The password was refused: a wrong password, a user who cannot log in, a running wait on the user's PIN and a lock all answer this, alike."},"404":{"description":"Not found"}},"summary":"Link a physical device","tags":["Device"],"requestBody":{"$ref":"#/components/requestBodies/DeviceLinkRequest"}}}},"components":{"responses":{"DeviceLinkResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLinkResponseSchema"}}}},"GenericErrorResponse":{"content":{"application/json":{"schema":{"properties":{"code":{"type":"string","description":"Error code. The codes a POS app acts on are listed in DeviceErrorCodeENUM."},"message":{"type":"string","description":"Error message in the locale you specify in the Accept-Language header or specified on the user"},"logId":{"type":"string","description":"Log identification. Can be used when reporting errors to Flow Solutions"}},"type":"object"}}},"description":"Linking failed. Ther error message will have information about what failed."}},"schemas":{"DeviceLinkResponseSchema":{"title":"DeviceLinkResponseSchema","type":"object","required":["expires","token","refreshToken"],"properties":{"expires":{"type":"integer","description":"The expiry time represented as a unix timestamp."},"token":{"type":"string","description":"A JWT device token"},"refreshToken":{"type":"string","description":"Refresh token to be used to renew the token"}}},"DeviceLinkRequestSchema":{"title":"DeviceLinkRequestSchema","type":"object","required":["appId","userCode","password"],"properties":{"appId":{"type":"string","description":"This is a predefined app id that Flow will provide"},"userCode":{"type":"string","description":"A user code from the tenant"},"password":{"type":"string","description":"The password for the user"},"systemInformation":{"type":"string","description":"Contains device name, OS, release version of OS, OS build date, like a uname -a response on linux servers"}}}},"requestBodies":{"DeviceLinkRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLinkRequestSchema"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/device/link-a-physical-device.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
