# Device

Device

## Get device information

> Fetch device info for current device given in token

```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"}],"security":[{"accessToken":[]},{"deviceToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"deviceToken":{"description":"The devicetoken is only used for to attach devices and tie it to a tenant","scheme":"bearer","type":"http"}},"responses":{"DeviceInfoResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceInfoResponseSchema"}}},"description":"Example response"}},"schemas":{"DeviceInfoResponseSchema":{"description":" Info for a device","title":"DeviceInfoResponseSchema","type":"object","required":["availablePaymentMethods","zeroAmountPaymentMethod","availableReasons","deviceIdentifier","deviceUid","storeInfo","tenantInfo","tillInfo","currencyDenominations","name","settings","printers"],"properties":{"availablePaymentMethods":{"type":"array","items":{"$ref":"#/components/schemas/DevicePaymentMethodResponseSchema"}},"zeroAmountPaymentMethod":{"$ref":"#/components/schemas/DevicePaymentMethodResponseSchema"},"availableReasons":{"$ref":"#/components/schemas/AvailableReasonsSchema"},"deviceIdentifier":{"type":"string"},"deviceUid":{"$ref":"#/components/schemas/UID"},"storeInfo":{"$ref":"#/components/schemas/StoreResponseSchema"},"tenantInfo":{"$ref":"#/components/schemas/TenantResponseSchema"},"tillInfo":{"$ref":"#/components/schemas/TillResponseSchema"},"currencyDenominations":{"type":"array","items":{"$ref":"#/components/schemas/DeviceCurrencyDenominationSchema"}},"name":{"type":"string"},"settings":{"type":"array","items":{"$ref":"#/components/schemas/GeneralParameterResponseSchema"}},"printers":{"type":"array","items":{"$ref":"#/components/schemas/DevicePrinterResponseSchema"}}}},"DevicePaymentMethodResponseSchema":{"title":"DevicePaymentMethodResponseSchema","type":"object","required":["allowRefund","allowSale","allowCashback","allowAmount","name","parameters","paymentCode","storePaymentMethodUid","requirements","settlementCode","visibility","position","description"],"properties":{"allowRefund":{"type":"boolean"},"allowSale":{"type":"boolean"},"allowCashback":{"type":"boolean"},"allowAmount":{"type":"boolean"},"name":{"type":"string"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/AvailablePaymentMethodParametersResponseSchema"}},"paymentCode":{"$ref":"#/components/schemas/PaymentMethodCodeENUM"},"storePaymentMethodUid":{"$ref":"#/components/schemas/UID"},"requirements":{"$ref":"#/components/schemas/PaymentMethodRequirementResponseSchema"},"settlementCode":{"type":"string"},"visibility":{"$ref":"#/components/schemas/PaymentMethodVisibilityENUM"},"position":{"type":"integer"},"description":{"type":"string","description":"from TenantPaymentMethod"}}},"AvailablePaymentMethodParametersResponseSchema":{"title":"AvailablePaymentMethodParametersResponseSchema","description":"AvailablePaymentMethodParametersResponseSchema","type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"required":{"type":"boolean"},"key":{"type":"string"},"keyType":{"$ref":"#/components/schemas/TenantPaymentMethodParameterTypeENUM"},"regex":{"type":"string","description":"regular expression"}},"required":["name","description","required","key","keyType","regex"]},"TenantPaymentMethodParameterTypeENUM":{"title":"TenantPaymentMethodParameterTypeENUM","type":"string","enum":["TEXT","INTEGER","NUMERIC","DATE","MOBILE","MODULUS10","MODULUS11"]},"PaymentMethodCodeENUM":{"enum":["CASH","INVOICE","VIPPS","ADYEN_CARD","PAYEX_CARD","SANTANDER","EXTERNAL","TRANSFER_MONEY","FLOWGIFTCARD","STORE_CREDIT","STRIPE_CARD","TWO_INVOICE","NETS_CARD","VERIFONE_CARD","FOREIGN_CASH","SWISH","DINTERO_PAYMENT_LINK","BRITANNIA","PREPAYMENT"],"title":"PaymentMethodCodeENUM","type":"string"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"PaymentMethodRequirementResponseSchema":{"title":"PaymentMethodRequirementResponseSchema","type":"object","description":"PaymentMethodRequirementResponseSchema","properties":{"requireCustomer":{"type":"boolean"},"requireCustomerMobile":{"type":"boolean"},"requireCustomerEmail":{"type":"boolean"},"requireCustomerContact":{"type":"boolean"},"requireExclusiveUse":{"type":"boolean"}},"required":["requireCustomer","requireCustomerMobile","requireCustomerEmail","requireCustomerContact","requireExclusiveUse"]},"PaymentMethodVisibilityENUM":{"title":"PaymentMethodVisibilityENUM","type":"string","enum":["FEATURED","LISTED","HIDDEN"]},"AvailableReasonsSchema":{"title":"AvailableReasonsSchema","type":"object","properties":{"discount":{"type":"array","items":{"$ref":"#/components/schemas/AvailableReasonResponseSchema"}},"return":{"type":"array","items":{"$ref":"#/components/schemas/AvailableReasonResponseSchema"}}},"required":["discount","return"]},"AvailableReasonResponseSchema":{"title":"AvailableReasonResponseSchema","type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"}},"required":["code","description"]},"StoreResponseSchema":{"title":"StoreResponseSchema","type":"object","required":["address","city","countryCode","createdAt","defaultWarehouseUid","defaultReturnWarehouseUid","defaultDeliveryWarehouseUid","email","externalId","isActive","lastModifiedAt","latitude","longitude","name","postalCode","phone","purchaseNumberSeriesUid","internalPurchaseNumberSeriesUid","rmaOrderNumberSeriesUid","customerLedgerNumberSeriesUid","quicksaleCategoryUid","receiptMessage","emailReceiptMessage","exchangenoteMessage","exchangenoteValidDays","salesPriceUid","settings","storeUid","vatNumber","voucherNumberSeriesUid","serviceNumberSeriesUid","hasWorkShop","organizationUid","availableExtensions","openingHours","bankInfo","websiteUrl"],"properties":{"address":{"type":"string"},"bankAccountNumber":{"type":"string","deprecated":true},"city":{"type":"string"},"countryCode":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"defaultWarehouseUid":{"$ref":"#/components/schemas/OptionalUID"},"defaultReturnWarehouseUid":{"$ref":"#/components/schemas/OptionalUID"},"defaultDeliveryWarehouseUid":{"$ref":"#/components/schemas/OptionalUID"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"isActive":{"type":"boolean"},"lastModifiedAt":{"format":"date-time","type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"name":{"type":"string"},"postalCode":{"type":"string"},"phone":{"type":"string"},"purchaseNumberSeriesUid":{"$ref":"#/components/schemas/UID"},"internalPurchaseNumberSeriesUid":{"$ref":"#/components/schemas/OptionalUID"},"rmaOrderNumberSeriesUid":{"$ref":"#/components/schemas/OptionalUID"},"customerLedgerNumberSeriesUid":{"$ref":"#/components/schemas/OptionalUID"},"quicksaleCategoryUid":{"$ref":"#/components/schemas/OptionalUID"},"receiptMessage":{"type":"string"},"emailReceiptMessage":{"type":"string"},"exchangenoteMessage":{"type":"string"},"exchangenoteValidDays":{"type":"integer","description":"Number of days an exchangenote is valid."},"salesPriceUid":{"$ref":"#/components/schemas/OptionalUID"},"settings":{"type":"array","items":{"$ref":"#/components/schemas/StoreSettingSchema"}},"storeUid":{"$ref":"#/components/schemas/UID"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"voucherNumberSeriesUid":{"$ref":"#/components/schemas/UID"},"serviceNumberSeriesUid":{"$ref":"#/components/schemas/UID"},"hasWorkShop":{"type":"boolean","default":false},"organizationUid":{"$ref":"#/components/schemas/UID"},"availableExtensions":{"type":"array","items":{"$ref":"#/components/schemas/AvailableExtensionSchema"}},"openingHours":{"$ref":"#/components/schemas/OpeningHoursResponseSchema"},"bankInfo":{"$ref":"#/components/schemas/BankInfoResponseSchema"},"websiteUrl":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"EmailTYPE":{"title":"Email","type":"string"},"StoreSettingSchema":{"description":"","properties":{"key":{"$ref":"#/components/schemas/StoreSettingKeyENUM"},"value":{"type":"string"}},"required":["key","value"],"title":"StoreSettingSchema","type":"object"},"StoreSettingKeyENUM":{"description":"","enum":["VIPPS_MSN","ADYEN_API_KEY"],"title":"StoreSettingKey","type":"string"},"VatNumberTYPE":{"description":"VAT identification number for value added tax reporting purposes.","title":"VatNumber","type":"string"},"AvailableExtensionSchema":{"title":"AvailableExtensionSchema","type":"object","required":["extensionCode","name"],"properties":{"extensionCode":{"$ref":"#/components/schemas/ExtensionCodeENUM"},"name":{"type":"string"}}},"ExtensionCodeENUM":{"enum":["FLOWGIFTCARD","ADYEN_POS","PAYEX_POS","VIPPS","EXTERNAL_CUSTOMER_SEARCH","STORE_CREDIT","SMS","STRIPE","NETS","VERIFONE","SERVICE_WORKSHOP","TWO_INVOICE","FOREIGN_CASH","OMNIUM","DILLER","ARTS","CAMPAIGN","B2B","PEOPLE_COUNTER_KUNDETELLING","COMPENSATION","SWISH","DINTERO","KID","EHF","POWER","BRITANNIA"],"title":"ExtensionCodeENUM","type":"string"},"OpeningHoursResponseSchema":{"title":"OpeningHoursResponseSchema","type":"object","properties":{"monday":{"type":"string"},"tuesday":{"type":"string"},"wednesday":{"type":"string"},"thursday":{"type":"string"},"friday":{"type":"string"},"saturday":{"type":"string"},"sunday":{"type":"string"},"note":{"type":"string"}},"required":["monday","tuesday","wednesday","thursday","friday","saturday","sunday","note"]},"BankInfoResponseSchema":{"title":"BankInfoResponseSchema","type":"object","required":["accountNumber","bankName","iban","swift"],"properties":{"accountNumber":{"type":"string"},"bankName":{"type":"string"},"iban":{"type":"string"},"swift":{"type":"string"}}},"TenantResponseSchema":{"title":"TenantResponseSchema","type":"object","required":["countryCode","createdAt","lastModifiedAt","name","pricelistUid","tenantUid","vatNumber","settings","appSettings","extensions","assets","timezone","languageCode","currency"],"properties":{"countryCode":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"name":{"type":"string"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUid":{"$ref":"#/components/schemas/UID"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"availableExtensions":{"type":"array","deprecated":true,"items":{"$ref":"#/components/schemas/AvailableExtensionSchema"}},"settings":{"$ref":"#/components/schemas/TenantSettingsResponseSchema"},"appSettings":{"$ref":"#/components/schemas/TenantAppSettingsResponseSchema"},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/TenantExtensionSchema"}},"assets":{"$ref":"#/components/schemas/TenantAssetSchema"},"timezone":{"$ref":"#/components/schemas/TimezoneTYPE"},"languageCode":{"$ref":"#/components/schemas/LanguageCode"},"currency":{"$ref":"#/components/schemas/TenantCurrencySchema"}}},"TenantSettingsResponseSchema":{"title":"TenantSettings","type":"object","required":["allowExternalCashDrawer","autoLogout","autoPrintReceipt","numericSkuCounter","printCardPaymentDetails","sendInvoicesExternally"],"properties":{"allowExternalCashDrawer":{"type":"boolean","default":false},"autoLogout":{"type":"integer","description":"time in seconds, 0 means not enabled"},"autoPrintReceipt":{"type":"boolean"},"numericSkuCounter":{"type":"integer"},"printCardPaymentDetails":{"type":"boolean","description":"toogle on/off payment terminal details on receipt","default":false},"sendInvoicesExternally":{"type":"boolean"}}},"TenantAppSettingsResponseSchema":{"title":"TenantAppSettingsResponseSchema","type":"object","required":["showOutOfStockWarning"],"properties":{"showOutOfStockWarning":{"type":"boolean"}}},"TenantExtensionSchema":{"title":"TenantExtensionSchema","type":"object","required":["extensionCode","name","active"],"properties":{"extensionCode":{"$ref":"#/components/schemas/ExtensionCodeENUM"},"name":{"type":"string"},"active":{"type":"boolean"}}},"TenantAssetSchema":{"title":"TenantAssetSchema","type":"object","required":["logo","splash"],"properties":{"logo":{"$ref":"#/components/schemas/AssetUrlSchema"},"splash":{"$ref":"#/components/schemas/AssetUrlSchema"}}},"AssetUrlSchema":{"title":"AssetUrlSchema","type":"object","required":["url","assetUid"],"properties":{"url":{"type":"string"},"assetUid":{"$ref":"#/components/schemas/UID"}}},"TimezoneTYPE":{"title":"Timezone","type":"string","description":"The timezone in tz/zoneinfo format. Example: Europe/Oslo"},"LanguageCode":{"title":"LanguageCode","description":"ISO 639-1 code for language","type":"string"},"TenantCurrencySchema":{"title":"TenantCurrencySchema","type":"object","required":["code","name","symbol","symbolPosition","decimalSeparator","thousandSeparator","cashRounding"],"properties":{"code":{"type":"string","description":"ISO 4217"},"name":{"type":"string"},"symbol":{"type":"string","description":"symbol or short name, e.g. `$`, `kr` etc. "},"symbolPosition":{"type":"string","description":"prefix or suffix to the amount"},"decimalSeparator":{"type":"string"},"thousandSeparator":{"type":"string"},"cashRounding":{"type":"integer","description":"the smallest amount accepted as cash"}}},"TillResponseSchema":{"title":"TillResponseSchema","type":"object","required":["barcodePrinter","cashDrawer","createdAt","deviceIdentifier","lastModifiedAt","lastOrderUid","lastOrderNumber","name","paymentTerminal","receiptPrinter","regularPrinter","settings","tillUid","tillNumber","appSettings"],"properties":{"barcodePrinter":{"type":"string"},"cashDrawer":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"deviceIdentifier":{"type":"string","nullable":true},"lastModifiedAt":{"format":"date-time","type":"string"},"lastOrderUid":{"$ref":"#/components/schemas/UID"},"lastOrderNumber":{"type":"string"},"name":{"type":"string"},"paymentTerminal":{"$ref":"#/components/schemas/TillPaymentTerminalENUM"},"receiptPrinter":{"type":"string"},"regularPrinter":{"type":"string"},"settings":{"type":"array","items":{"$ref":"#/components/schemas/TillSettingSchema"}},"tillUid":{"$ref":"#/components/schemas/UID"},"tillNumber":{"type":"integer"},"appSettings":{"$ref":"#/components/schemas/TillAppSettingsSchema"}}},"TillPaymentTerminalENUM":{"enum":["NONE","ADYEN","PAYEX","STRIPE","NETS","VERIFONE"],"title":"TillPaymentTerminalENUM","type":"string"},"TillSettingSchema":{"description":"Till specific settings","properties":{"key":{"$ref":"#/components/schemas/TillSettingKeyENUM"},"value":{"type":"string"}},"required":["key","value"],"title":"TillSettingSchema","type":"object"},"TillSettingKeyENUM":{"enum":["STRIPE_TERMINAL_ID","ADYEN_POS_TERMINAL_ID","PAYEX_TERMINAL_IP","PAYEX_TERMINAL_PORT","PAYEX_COMMAND_QUEUE","NETS_TERMINAL_ID","VERIFONE_TERMINAL_POI_ID"],"title":"TillSettingKeyENUM","type":"string"},"TillAppSettingsSchema":{"title":"TillAppSettingsSchema","type":"object","description":"Application specific settings","required":["saleStopAtDelivery","autoLogout","touchMode"],"properties":{"saleStopAtDelivery":{"type":"boolean","description":"Stop in the delivery field for each product line during sale"},"autoLogout":{"type":"integer","description":"time in seconds, 0 = disabled, -1 = inherited from tenant"},"touchMode":{"$ref":"#/components/schemas/TillTouchModeENUM"}}},"TillTouchModeENUM":{"title":"TillTouchModeENUM","type":"string","enum":["UNAVAILABLE","ALWAYS","OPTIONAL_ON","OPTIONAL_OFF"]},"DeviceCurrencyDenominationSchema":{"title":"DeviceCurrencyDenominationSchema","type":"object","properties":{"currencyCode":{"type":"string"},"denomination":{"type":"integer"},"material":{"$ref":"#/components/schemas/CurrencyDenominationMaterialENUM"}},"required":["currencyCode","denomination","material"]},"CurrencyDenominationMaterialENUM":{"description":"","enum":["COIN","NOTE"],"title":"CurrencyDenominationMaterialENUM","type":"string"},"GeneralParameterResponseSchema":{"title":"GeneralParameterResponseSchema","type":"object","required":["key","value","type","allowedValues","validationRegex","name","required"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"type":{"$ref":"#/components/schemas/GeneralParameterTypeENUM"},"allowedValues":{"type":"array","items":{"type":"string"}},"validationRegex":{"type":"string"},"name":{"type":"string"},"required":{"type":"boolean"}}},"GeneralParameterTypeENUM":{"title":"GeneralSettingTypeENUM","type":"string","enum":["STRING","INTEGER","DECIMAL","BOOL","ENUM"],"description":"| Type | Description |\n|--|--|\n|BOOL | Booleans will be the string `true` or `false` |\n|DECIMAL | Descimal numbers can only have two decimals and is represented as an integer multiplied by 100. Example: 1.2 is will be 120 and 5 will be 500 |\n|ENUM| The enum value should be one of the values listed in `allowedValues` |"},"DevicePrinterResponseSchema":{"title":"DevicePrinterResponseSchema","type":"object","required":["printerUid","name","type"],"properties":{"printerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/PrinterTypeENUM"}}},"PrinterTypeENUM":{"title":"PrinterTypeENUM","type":"string","enum":["LABEL","RECEIPT","GENERAL"]}}},"paths":{"/device":{"get":{"description":"Fetch device info for current device given in token","operationId":"get-device-info","responses":{"200":{"$ref":"#/components/responses/DeviceInfoResponse"}},"summary":"Get device information","tags":["Device"]}}}}
```

## Register a new device (deprecated)

> Register a new device for authorization.\
> \
> You should already have a clientId supplied by Flow, and you will retreive a deviceIdentifier and deviceToken in the response.

```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":{"post":{"description":"Register a new device for authorization.\n\nYou should already have a clientId supplied by Flow, and you will retreive a deviceIdentifier and deviceToken in the response.","operationId":"post-device-register","responses":{"200":{"$ref":"#/components/responses/DeviceAuthorizationResponse"}},"summary":"Register a new device (deprecated)","tags":["Device"],"requestBody":{"$ref":"#/components/requestBodies/DeviceRegisterRequest"},"deprecated":true}}},"components":{"responses":{"DeviceAuthorizationResponse":{"content":{"application/json":{"schema":{"type":"object","properties":{"deviceCode":{"minLength":1,"type":"string"},"deviceIdentifier":{"minLength":1,"type":"string"},"expires_in":{"type":"integer"},"interval":{"type":"integer"},"verificationUri":{"minLength":1,"type":"string"}},"required":["deviceCode","deviceIdentifier","expires_in","interval","verificationUri"]}}},"description":"Example response"}},"requestBodies":{"DeviceRegisterRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceRegisterRequestSchema"}}}}},"schemas":{"DeviceRegisterRequestSchema":{"title":"DeviceRegisterRequestSchema","type":"object","properties":{"clientId":{"type":"string"},"name":{"type":"string","nullable":true},"systemInformation":{"type":"string","description":"Contains device name, OS, release version of OS, OS build date, like a uname -a response on linux servers","nullable":true}},"required":["clientId"]}}}}
```

## Update systemInformation for a device

> Update system information for a device.<br>

```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"}],"security":[{"deviceToken":[]}],"components":{"securitySchemes":{"deviceToken":{"description":"The devicetoken is only used for to attach devices and tie it to a tenant","scheme":"bearer","type":"http"}},"requestBodies":{"DeviceUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceSystemInformationUpdateRequestSchema"}}}}},"schemas":{"DeviceSystemInformationUpdateRequestSchema":{"title":"DeviceSystemInformationUpdateRequestSchema","type":"object","properties":{"systemInformation":{"type":"string","description":"Contains device name, OS, release version of OS, OS build date, like a uname -a response on linux servers"}},"required":["systemInformation"]}}},"paths":{"/device":{"put":{"summary":"Update systemInformation for a device","operationId":"put-device","responses":{"204":{"description":"No Content"}},"description":"Update system information for a device.\n","requestBody":{"$ref":"#/components/requestBodies/DeviceUpdateRequest"},"tags":["Device"]}}}}
```

## Accept Device (deprecated)

> Device Authorization Flow - Authorize a device and attach it to a specific store

```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"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"GenericErrorResponse":{"content":{"application/json":{"schema":{"properties":{"code":{"type":"string"},"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."}},"requestBodies":{"DeviceAuthorizeRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceAuthorizeRequestSchema"}}}}},"schemas":{"DeviceAuthorizeRequestSchema":{"title":"DeviceAuthorizeRequestSchema","type":"object","properties":{"deviceCode":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"tenantUid":{"$ref":"#/components/schemas/UID"},"tillUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"required":["deviceCode","storeUid","tenantUid"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"}}},"paths":{"/device/authorize":{"post":{"description":"Device Authorization Flow - Authorize a device and attach it to a specific store","operationId":"post-device-authorize","responses":{"200":{"description":"OK"},"400":{"$ref":"#/components/responses/GenericErrorResponse"}},"summary":"Accept Device (deprecated)","tags":["Device"],"requestBody":{"$ref":"#/components/requestBodies/DeviceAuthorizeRequest"},"deprecated":true}}}}
```

## Link a physical device

> Link a physical device to a device registered in Flow.

```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.","operationId":"post-device-link","responses":{"200":{"$ref":"#/components/responses/DeviceLinkResponse"},"400":{"$ref":"#/components/responses/GenericErrorResponse"},"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"},"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"}}}}}}}
```

## Request a new device token

> Device Authorization Flow - Request a new token

```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/token":{"post":{"description":"Device Authorization Flow - Request a new token","operationId":"post-device-token","responses":{"200":{"$ref":"#/components/responses/DeviceAuthorizationTokenResponse"},"400":{"$ref":"#/components/responses/DeviceAuthorizationErrorResponse"},"404":{"description":"Not Found"}},"summary":"Request a new device token","tags":["Device"],"requestBody":{"$ref":"#/components/requestBodies/DeviceTokenRequest"}}}},"components":{"responses":{"DeviceAuthorizationTokenResponse":{"content":{"application/json":{"schema":{"description":"","properties":{"expires":{"type":"integer"},"token":{"type":"string"},"token_type":{"type":"string"}},"required":["token","token_type","expires"],"type":"object"}}},"description":"Link successfull."},"DeviceAuthorizationErrorResponse":{"content":{"application/json":{"schema":{"properties":{"error":{"$ref":"#/components/schemas/DeviceAuthorizationStatusENUM"}},"required":["error"],"type":"object"}}},"description":"Example response"}},"schemas":{"DeviceAuthorizationStatusENUM":{"enum":["slow_down","authorization_pending","access_denied","expired_token"],"title":"DeviceAuthorizationStatusENUM","type":"string"},"DeviceTokenRequestSchema":{"title":"DeviceTokenRequestSchema","type":"object","required":["appId","refreshToken"],"properties":{"appId":{"type":"string","description":"This is a predefined app id that Flow will provide"},"refreshToken":{"type":"string","description":"Refresh token that is supplied during client linking"}}},"DeprecatedDeviceTokenRequestSchema":{"title":"DeprecatedDeviceTokenRequestSchema","type":"object","properties":{"clientId":{"type":"string"},"deviceIdentifier":{"type":"string"}},"required":["clientId","deviceIdentifier"]}},"requestBodies":{"DeviceTokenRequest":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/DeviceTokenRequestSchema"},{"$ref":"#/components/schemas/DeprecatedDeviceTokenRequestSchema"}]}}}}}}}
```

## List device users

> List all users that can login to the current device.

```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"}],"security":[{"deviceToken":[]}],"components":{"securitySchemes":{"deviceToken":{"description":"The devicetoken is only used for to attach devices and tie it to a tenant","scheme":"bearer","type":"http"}},"responses":{"DeviceUserListResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","required":["items","paging"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DeviceUserResponseSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}}}}}},"GenericErrorResponse":{"content":{"application/json":{"schema":{"properties":{"code":{"type":"string"},"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":{"DeviceUserResponseSchema":{"title":"DeviceUserResponseSchema","type":"object","required":["accountType","displayName","firstname","lastAccessed","lastname","tenantUserUid","userCode","languageCode"],"properties":{"accountType":{"$ref":"#/components/schemas/TenantAccountTypeENUM"},"displayName":{"type":"string"},"firstname":{"type":"string"},"lastAccessed":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"userCode":{"type":"string"},"languageCode":{"$ref":"#/components/schemas/LanguageCode"}}},"TenantAccountTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| FULL | Access to backoffice and onboarding of new devices|\n| REGULAR | Can only login to already onboarded devices|\n| SUPPORT | Support account|\n| INTEGRATION | Computer integration account|","enum":["FULL","REGULAR","SUPPORT","INTEGRATION"],"title":"TenantAccountTypeENUM","type":"string"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"LanguageCode":{"title":"LanguageCode","description":"ISO 639-1 code for language","type":"string"},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"},"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"}},"parameters":{"TenantAccountTypeQuery":{"description":"Account types to return","schema":{"items":{"$ref":"#/components/schemas/TenantAccountTypeENUM"},"type":"array"},"in":"query","name":"accountType","explode":false},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}}}},"paths":{"/device/users":{"get":{"description":"List all users that can login to the current device.","operationId":"get-device-users","responses":{"200":{"$ref":"#/components/responses/DeviceUserListResponse"},"400":{"$ref":"#/components/responses/GenericErrorResponse"}},"summary":"List device users","tags":["Device"],"parameters":[{"$ref":"#/components/parameters/TenantAccountTypeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/pageNumberQuery"}]}}}}
```

## List registered devices

> Get list of registered devices.\
> \
> Required permission: TENANT.ADMIN

```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"}],"security":[{"authToken":[]},{"integrationToken":[]},{"accessToken":[]}],"components":{"securitySchemes":{"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"},"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"}},"parameters":{"deviceStoreUidQuery":{"description":"Reference to a store uid","in":"query","name":"deviceStoreUid","required":false,"schema":{"$ref":"#/components/schemas/UID"}},"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}},"schemas":{"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"},"DeviceResponseSchema":{"title":"DeviceResponseSchema","type":"object","required":["createdAt","createdBy","deviceUid","identifier","lastModifiedAt","lastActivityAt","lastTenantUserUid","name","systemInformation","status","store","deviceLinkCode","lastOrderUid","till","appCode","settings","printers"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deviceUid":{"$ref":"#/components/schemas/UID"},"identifier":{"type":"string","description":"A unique client identifier. This will be set when the client is linked."},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"lastActivityAt":{"type":"string","description":"The timestamp indicating the most recent date and time when the device registered any activity. ","format":"date-time","nullable":true},"lastTenantUserUid":{"type":"string","description":"The tenantUserUid who interacted with this device most recently"},"name":{"type":"string"},"systemInformation":{"type":"string","description":"Contains device name, OS, release version of OS, OS build date, like a uname -a response on linux servers"},"status":{"$ref":"#/components/schemas/DeviceStatusENUM"},"store":{"$ref":"#/components/schemas/DeviceStoreResponseSchema"},"deviceLinkCode":{"type":"string","description":"The code that should be used to link the device to an app"},"lastOrderUid":{"$ref":"#/components/schemas/OptionalUID"},"till":{"$ref":"#/components/schemas/DeviceTillResponseSchema"},"appCode":{"$ref":"#/components/schemas/DeviceAppCodeENUM"},"settings":{"type":"array","items":{"$ref":"#/components/schemas/GeneralParameterResponseSchema"}},"printers":{"type":"array","items":{"$ref":"#/components/schemas/DevicePrinterResponseSchema"}}}},"DeviceStatusENUM":{"enum":["ACTIVE","BLOCKED","READY_TO_LINK"],"title":"DeviceAuthorizationStatusENUM","type":"string","description":"| Enum | Description|\n|-----|-----|\n|READY_TO_LINK | The device is ready to a physical device through the link endpoint |\n|ACTIVE| The device is linked and active |\n|BLOCKED| The device is linked, but blocked for usage |"},"DeviceStoreResponseSchema":{"title":"DeviceStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid","organizationUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"organizationUid":{"$ref":"#/components/schemas/UID"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"DeviceTillResponseSchema":{"title":"DeviceTillResponseSchema","type":"object","nullable":true,"required":["tillUid","name","tillNumber"],"properties":{"tillUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"tillNumber":{"type":"integer"}}},"DeviceAppCodeENUM":{"title":"DeviceAppCodeENUM","type":"string","enum":["CLIENT","ASSISTANT","UNKNOWN"],"description":"| Enum | Description |\n|---|----|\n| CLIENT | Flow Retail Client |\n| ASSISTANT | Flow Retail Assistant |\n| UNKNOWN | No specific app |"},"GeneralParameterResponseSchema":{"title":"GeneralParameterResponseSchema","type":"object","required":["key","value","type","allowedValues","validationRegex","name","required"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"type":{"$ref":"#/components/schemas/GeneralParameterTypeENUM"},"allowedValues":{"type":"array","items":{"type":"string"}},"validationRegex":{"type":"string"},"name":{"type":"string"},"required":{"type":"boolean"}}},"GeneralParameterTypeENUM":{"title":"GeneralSettingTypeENUM","type":"string","enum":["STRING","INTEGER","DECIMAL","BOOL","ENUM"],"description":"| Type | Description |\n|--|--|\n|BOOL | Booleans will be the string `true` or `false` |\n|DECIMAL | Descimal numbers can only have two decimals and is represented as an integer multiplied by 100. Example: 1.2 is will be 120 and 5 will be 500 |\n|ENUM| The enum value should be one of the values listed in `allowedValues` |"},"DevicePrinterResponseSchema":{"title":"DevicePrinterResponseSchema","type":"object","required":["printerUid","name","type"],"properties":{"printerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/PrinterTypeENUM"}}},"PrinterTypeENUM":{"title":"PrinterTypeENUM","type":"string","enum":["LABEL","RECEIPT","GENERAL"]},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"}},"responses":{"DeviceListResponse":{"content":{"application/json":{"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DeviceResponseSchema"},"type":"array"},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"],"type":"object"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/devices":{"get":{"description":"Get list of registered devices.\n\nRequired permission: TENANT.ADMIN","operationId":"get-tenants-devices","parameters":[{"$ref":"#/components/parameters/deviceStoreUidQuery"},{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"responses":{"200":{"$ref":"#/components/responses/DeviceListResponse"}},"summary":"List registered devices","tags":["Device"]}}}}
```

## Create a new device

> Create a new device for a tenant

```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"}],"security":[{"accessToken":[]},{"integrationToken":[]},{"authToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"}},"responses":{"DeviceResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceResponseSchema"}}},"description":"Example response"}},"schemas":{"DeviceResponseSchema":{"title":"DeviceResponseSchema","type":"object","required":["createdAt","createdBy","deviceUid","identifier","lastModifiedAt","lastActivityAt","lastTenantUserUid","name","systemInformation","status","store","deviceLinkCode","lastOrderUid","till","appCode","settings","printers"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deviceUid":{"$ref":"#/components/schemas/UID"},"identifier":{"type":"string","description":"A unique client identifier. This will be set when the client is linked."},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"lastActivityAt":{"type":"string","description":"The timestamp indicating the most recent date and time when the device registered any activity. ","format":"date-time","nullable":true},"lastTenantUserUid":{"type":"string","description":"The tenantUserUid who interacted with this device most recently"},"name":{"type":"string"},"systemInformation":{"type":"string","description":"Contains device name, OS, release version of OS, OS build date, like a uname -a response on linux servers"},"status":{"$ref":"#/components/schemas/DeviceStatusENUM"},"store":{"$ref":"#/components/schemas/DeviceStoreResponseSchema"},"deviceLinkCode":{"type":"string","description":"The code that should be used to link the device to an app"},"lastOrderUid":{"$ref":"#/components/schemas/OptionalUID"},"till":{"$ref":"#/components/schemas/DeviceTillResponseSchema"},"appCode":{"$ref":"#/components/schemas/DeviceAppCodeENUM"},"settings":{"type":"array","items":{"$ref":"#/components/schemas/GeneralParameterResponseSchema"}},"printers":{"type":"array","items":{"$ref":"#/components/schemas/DevicePrinterResponseSchema"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"DeviceStatusENUM":{"enum":["ACTIVE","BLOCKED","READY_TO_LINK"],"title":"DeviceAuthorizationStatusENUM","type":"string","description":"| Enum | Description|\n|-----|-----|\n|READY_TO_LINK | The device is ready to a physical device through the link endpoint |\n|ACTIVE| The device is linked and active |\n|BLOCKED| The device is linked, but blocked for usage |"},"DeviceStoreResponseSchema":{"title":"DeviceStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid","organizationUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"organizationUid":{"$ref":"#/components/schemas/UID"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"DeviceTillResponseSchema":{"title":"DeviceTillResponseSchema","type":"object","nullable":true,"required":["tillUid","name","tillNumber"],"properties":{"tillUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"tillNumber":{"type":"integer"}}},"DeviceAppCodeENUM":{"title":"DeviceAppCodeENUM","type":"string","enum":["CLIENT","ASSISTANT","UNKNOWN"],"description":"| Enum | Description |\n|---|----|\n| CLIENT | Flow Retail Client |\n| ASSISTANT | Flow Retail Assistant |\n| UNKNOWN | No specific app |"},"GeneralParameterResponseSchema":{"title":"GeneralParameterResponseSchema","type":"object","required":["key","value","type","allowedValues","validationRegex","name","required"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"type":{"$ref":"#/components/schemas/GeneralParameterTypeENUM"},"allowedValues":{"type":"array","items":{"type":"string"}},"validationRegex":{"type":"string"},"name":{"type":"string"},"required":{"type":"boolean"}}},"GeneralParameterTypeENUM":{"title":"GeneralSettingTypeENUM","type":"string","enum":["STRING","INTEGER","DECIMAL","BOOL","ENUM"],"description":"| Type | Description |\n|--|--|\n|BOOL | Booleans will be the string `true` or `false` |\n|DECIMAL | Descimal numbers can only have two decimals and is represented as an integer multiplied by 100. Example: 1.2 is will be 120 and 5 will be 500 |\n|ENUM| The enum value should be one of the values listed in `allowedValues` |"},"DevicePrinterResponseSchema":{"title":"DevicePrinterResponseSchema","type":"object","required":["printerUid","name","type"],"properties":{"printerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/PrinterTypeENUM"}}},"PrinterTypeENUM":{"title":"PrinterTypeENUM","type":"string","enum":["LABEL","RECEIPT","GENERAL"]},"DeviceCreateRequestSchema":{"title":"DeviceCreateRequestSchema","type":"object","required":["name","appCode"],"properties":{"deviceUid":{"$ref":"#/components/schemas/OptionalUID"},"name":{"type":"string"},"appCode":{"$ref":"#/components/schemas/DeviceAppCodeENUM"},"storeUid":{"$ref":"#/components/schemas/OptionalUID"},"tillUid":{"$ref":"#/components/schemas/OptionalUID"},"settings":{"type":"array","items":{"$ref":"#/components/schemas/GeneralParameterRequestSchema"}},"printerUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}},"GeneralParameterRequestSchema":{"description":"GeneralParameterRequestSchema","title":"GeneralParameterRequestSchema","type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"]}},"requestBodies":{"DeviceCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCreateRequestSchema"}}}}}},"paths":{"/tenants/{tenantUid}/devices":{"post":{"summary":"Create a new device","tags":["Device"],"responses":{"201":{"$ref":"#/components/responses/DeviceResponse"},"400":{"description":"Bad Request"}},"operationId":"post-tenants-devices","description":"Create a new device for a tenant","requestBody":{"$ref":"#/components/requestBodies/DeviceCreateRequest"}}}}}
```

## Search registered devices

> Search Registered devices\
> \
> Required permission: TENANT.ADMIN

```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"}],"security":[{"authToken":[]},{"integrationToken":[]},{"accessToken":[]}],"components":{"securitySchemes":{"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"},"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}},"schemas":{"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"},"DeviceResponseSchema":{"title":"DeviceResponseSchema","type":"object","required":["createdAt","createdBy","deviceUid","identifier","lastModifiedAt","lastActivityAt","lastTenantUserUid","name","systemInformation","status","store","deviceLinkCode","lastOrderUid","till","appCode","settings","printers"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deviceUid":{"$ref":"#/components/schemas/UID"},"identifier":{"type":"string","description":"A unique client identifier. This will be set when the client is linked."},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"lastActivityAt":{"type":"string","description":"The timestamp indicating the most recent date and time when the device registered any activity. ","format":"date-time","nullable":true},"lastTenantUserUid":{"type":"string","description":"The tenantUserUid who interacted with this device most recently"},"name":{"type":"string"},"systemInformation":{"type":"string","description":"Contains device name, OS, release version of OS, OS build date, like a uname -a response on linux servers"},"status":{"$ref":"#/components/schemas/DeviceStatusENUM"},"store":{"$ref":"#/components/schemas/DeviceStoreResponseSchema"},"deviceLinkCode":{"type":"string","description":"The code that should be used to link the device to an app"},"lastOrderUid":{"$ref":"#/components/schemas/OptionalUID"},"till":{"$ref":"#/components/schemas/DeviceTillResponseSchema"},"appCode":{"$ref":"#/components/schemas/DeviceAppCodeENUM"},"settings":{"type":"array","items":{"$ref":"#/components/schemas/GeneralParameterResponseSchema"}},"printers":{"type":"array","items":{"$ref":"#/components/schemas/DevicePrinterResponseSchema"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"DeviceStatusENUM":{"enum":["ACTIVE","BLOCKED","READY_TO_LINK"],"title":"DeviceAuthorizationStatusENUM","type":"string","description":"| Enum | Description|\n|-----|-----|\n|READY_TO_LINK | The device is ready to a physical device through the link endpoint |\n|ACTIVE| The device is linked and active |\n|BLOCKED| The device is linked, but blocked for usage |"},"DeviceStoreResponseSchema":{"title":"DeviceStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid","organizationUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"organizationUid":{"$ref":"#/components/schemas/UID"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"DeviceTillResponseSchema":{"title":"DeviceTillResponseSchema","type":"object","nullable":true,"required":["tillUid","name","tillNumber"],"properties":{"tillUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"tillNumber":{"type":"integer"}}},"DeviceAppCodeENUM":{"title":"DeviceAppCodeENUM","type":"string","enum":["CLIENT","ASSISTANT","UNKNOWN"],"description":"| Enum | Description |\n|---|----|\n| CLIENT | Flow Retail Client |\n| ASSISTANT | Flow Retail Assistant |\n| UNKNOWN | No specific app |"},"GeneralParameterResponseSchema":{"title":"GeneralParameterResponseSchema","type":"object","required":["key","value","type","allowedValues","validationRegex","name","required"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"type":{"$ref":"#/components/schemas/GeneralParameterTypeENUM"},"allowedValues":{"type":"array","items":{"type":"string"}},"validationRegex":{"type":"string"},"name":{"type":"string"},"required":{"type":"boolean"}}},"GeneralParameterTypeENUM":{"title":"GeneralSettingTypeENUM","type":"string","enum":["STRING","INTEGER","DECIMAL","BOOL","ENUM"],"description":"| Type | Description |\n|--|--|\n|BOOL | Booleans will be the string `true` or `false` |\n|DECIMAL | Descimal numbers can only have two decimals and is represented as an integer multiplied by 100. Example: 1.2 is will be 120 and 5 will be 500 |\n|ENUM| The enum value should be one of the values listed in `allowedValues` |"},"DevicePrinterResponseSchema":{"title":"DevicePrinterResponseSchema","type":"object","required":["printerUid","name","type"],"properties":{"printerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/PrinterTypeENUM"}}},"PrinterTypeENUM":{"title":"PrinterTypeENUM","type":"string","enum":["LABEL","RECEIPT","GENERAL"]},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"},"DeviceSearchRequestSchema":{"title":"DeviceSearchRequestSchema","type":"object","properties":{"name":{"type":"string"},"deviceIdentifier":{"$ref":"#/components/schemas/OptionalUID"},"query":{"type":"string"},"appCode":{"$ref":"#/components/schemas/DeviceAppCodeENUM"},"statuses":{"type":"array","items":{"$ref":"#/components/schemas/DeviceStatusENUM"}}}}},"responses":{"DeviceListResponse":{"content":{"application/json":{"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DeviceResponseSchema"},"type":"array"},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"],"type":"object"}}},"description":"Example response"}},"requestBodies":{"DeviceSearchRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceSearchRequestSchema"}}}}}},"paths":{"/tenants/{tenantUid}/devices/search":{"post":{"description":"Search Registered devices\n\nRequired permission: TENANT.ADMIN","operationId":"post-search-tenants-devices","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"responses":{"200":{"$ref":"#/components/responses/DeviceListResponse"}},"summary":"Search registered devices","tags":["Device"],"requestBody":{"$ref":"#/components/requestBodies/DeviceSearchRequest"}}}}}
```

## Get device details

> Get details for a device.\
> \
> Required permission: TENANT.ADMIN

```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"}],"security":[{"authToken":[]},{"integrationToken":[]},{"accessToken":[]}],"components":{"securitySchemes":{"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"},"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"}},"responses":{"DeviceResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceResponseSchema"}}},"description":"Example response"}},"schemas":{"DeviceResponseSchema":{"title":"DeviceResponseSchema","type":"object","required":["createdAt","createdBy","deviceUid","identifier","lastModifiedAt","lastActivityAt","lastTenantUserUid","name","systemInformation","status","store","deviceLinkCode","lastOrderUid","till","appCode","settings","printers"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deviceUid":{"$ref":"#/components/schemas/UID"},"identifier":{"type":"string","description":"A unique client identifier. This will be set when the client is linked."},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"lastActivityAt":{"type":"string","description":"The timestamp indicating the most recent date and time when the device registered any activity. ","format":"date-time","nullable":true},"lastTenantUserUid":{"type":"string","description":"The tenantUserUid who interacted with this device most recently"},"name":{"type":"string"},"systemInformation":{"type":"string","description":"Contains device name, OS, release version of OS, OS build date, like a uname -a response on linux servers"},"status":{"$ref":"#/components/schemas/DeviceStatusENUM"},"store":{"$ref":"#/components/schemas/DeviceStoreResponseSchema"},"deviceLinkCode":{"type":"string","description":"The code that should be used to link the device to an app"},"lastOrderUid":{"$ref":"#/components/schemas/OptionalUID"},"till":{"$ref":"#/components/schemas/DeviceTillResponseSchema"},"appCode":{"$ref":"#/components/schemas/DeviceAppCodeENUM"},"settings":{"type":"array","items":{"$ref":"#/components/schemas/GeneralParameterResponseSchema"}},"printers":{"type":"array","items":{"$ref":"#/components/schemas/DevicePrinterResponseSchema"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"DeviceStatusENUM":{"enum":["ACTIVE","BLOCKED","READY_TO_LINK"],"title":"DeviceAuthorizationStatusENUM","type":"string","description":"| Enum | Description|\n|-----|-----|\n|READY_TO_LINK | The device is ready to a physical device through the link endpoint |\n|ACTIVE| The device is linked and active |\n|BLOCKED| The device is linked, but blocked for usage |"},"DeviceStoreResponseSchema":{"title":"DeviceStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid","organizationUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"organizationUid":{"$ref":"#/components/schemas/UID"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"DeviceTillResponseSchema":{"title":"DeviceTillResponseSchema","type":"object","nullable":true,"required":["tillUid","name","tillNumber"],"properties":{"tillUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"tillNumber":{"type":"integer"}}},"DeviceAppCodeENUM":{"title":"DeviceAppCodeENUM","type":"string","enum":["CLIENT","ASSISTANT","UNKNOWN"],"description":"| Enum | Description |\n|---|----|\n| CLIENT | Flow Retail Client |\n| ASSISTANT | Flow Retail Assistant |\n| UNKNOWN | No specific app |"},"GeneralParameterResponseSchema":{"title":"GeneralParameterResponseSchema","type":"object","required":["key","value","type","allowedValues","validationRegex","name","required"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"type":{"$ref":"#/components/schemas/GeneralParameterTypeENUM"},"allowedValues":{"type":"array","items":{"type":"string"}},"validationRegex":{"type":"string"},"name":{"type":"string"},"required":{"type":"boolean"}}},"GeneralParameterTypeENUM":{"title":"GeneralSettingTypeENUM","type":"string","enum":["STRING","INTEGER","DECIMAL","BOOL","ENUM"],"description":"| Type | Description |\n|--|--|\n|BOOL | Booleans will be the string `true` or `false` |\n|DECIMAL | Descimal numbers can only have two decimals and is represented as an integer multiplied by 100. Example: 1.2 is will be 120 and 5 will be 500 |\n|ENUM| The enum value should be one of the values listed in `allowedValues` |"},"DevicePrinterResponseSchema":{"title":"DevicePrinterResponseSchema","type":"object","required":["printerUid","name","type"],"properties":{"printerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/PrinterTypeENUM"}}},"PrinterTypeENUM":{"title":"PrinterTypeENUM","type":"string","enum":["LABEL","RECEIPT","GENERAL"]}}},"paths":{"/tenants/{tenantUid}/devices/{deviceUid}":{"get":{"description":"Get details for a device.\n\nRequired permission: TENANT.ADMIN","operationId":"get-tenants-devices-details","responses":{"200":{"$ref":"#/components/responses/DeviceResponse"}},"summary":"Get device details","tags":["Device"]}}}}
```

## Update device details

> Update details for a device. Partial updates are allowed.\
> \
> Required permission: TENANT.ADMIN\
> \
> Setting the status to "READY\_TO\_LINK" will unlink it for the current device and create a new deviceLinkCode and a new identifier

```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"}],"security":[{"authToken":[]},{"integrationToken":[]},{"accessToken":[]}],"components":{"securitySchemes":{"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"},"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"}},"requestBodies":{"TenantDeviceUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceUpdateRequestSchema"}}}}},"schemas":{"DeviceUpdateRequestSchema":{"title":"DeviceUpdateRequestSchema","type":"object","properties":{"name":{"type":"string"},"appCode":{"$ref":"#/components/schemas/DeviceAppCodeENUM"},"storeUid":{"$ref":"#/components/schemas/OptionalUID"},"status":{"$ref":"#/components/schemas/DeviceStatusENUM"},"tillUid":{"$ref":"#/components/schemas/OptionalUID"},"settings":{"type":"array","items":{"$ref":"#/components/schemas/GeneralParameterRequestSchema"}},"printerUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}},"DeviceAppCodeENUM":{"title":"DeviceAppCodeENUM","type":"string","enum":["CLIENT","ASSISTANT","UNKNOWN"],"description":"| Enum | Description |\n|---|----|\n| CLIENT | Flow Retail Client |\n| ASSISTANT | Flow Retail Assistant |\n| UNKNOWN | No specific app |"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"DeviceStatusENUM":{"enum":["ACTIVE","BLOCKED","READY_TO_LINK"],"title":"DeviceAuthorizationStatusENUM","type":"string","description":"| Enum | Description|\n|-----|-----|\n|READY_TO_LINK | The device is ready to a physical device through the link endpoint |\n|ACTIVE| The device is linked and active |\n|BLOCKED| The device is linked, but blocked for usage |"},"GeneralParameterRequestSchema":{"description":"GeneralParameterRequestSchema","title":"GeneralParameterRequestSchema","type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"DeviceResponseSchema":{"title":"DeviceResponseSchema","type":"object","required":["createdAt","createdBy","deviceUid","identifier","lastModifiedAt","lastActivityAt","lastTenantUserUid","name","systemInformation","status","store","deviceLinkCode","lastOrderUid","till","appCode","settings","printers"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deviceUid":{"$ref":"#/components/schemas/UID"},"identifier":{"type":"string","description":"A unique client identifier. This will be set when the client is linked."},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"lastActivityAt":{"type":"string","description":"The timestamp indicating the most recent date and time when the device registered any activity. ","format":"date-time","nullable":true},"lastTenantUserUid":{"type":"string","description":"The tenantUserUid who interacted with this device most recently"},"name":{"type":"string"},"systemInformation":{"type":"string","description":"Contains device name, OS, release version of OS, OS build date, like a uname -a response on linux servers"},"status":{"$ref":"#/components/schemas/DeviceStatusENUM"},"store":{"$ref":"#/components/schemas/DeviceStoreResponseSchema"},"deviceLinkCode":{"type":"string","description":"The code that should be used to link the device to an app"},"lastOrderUid":{"$ref":"#/components/schemas/OptionalUID"},"till":{"$ref":"#/components/schemas/DeviceTillResponseSchema"},"appCode":{"$ref":"#/components/schemas/DeviceAppCodeENUM"},"settings":{"type":"array","items":{"$ref":"#/components/schemas/GeneralParameterResponseSchema"}},"printers":{"type":"array","items":{"$ref":"#/components/schemas/DevicePrinterResponseSchema"}}}},"DeviceStoreResponseSchema":{"title":"DeviceStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid","organizationUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"organizationUid":{"$ref":"#/components/schemas/UID"}}},"DeviceTillResponseSchema":{"title":"DeviceTillResponseSchema","type":"object","nullable":true,"required":["tillUid","name","tillNumber"],"properties":{"tillUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"tillNumber":{"type":"integer"}}},"GeneralParameterResponseSchema":{"title":"GeneralParameterResponseSchema","type":"object","required":["key","value","type","allowedValues","validationRegex","name","required"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"type":{"$ref":"#/components/schemas/GeneralParameterTypeENUM"},"allowedValues":{"type":"array","items":{"type":"string"}},"validationRegex":{"type":"string"},"name":{"type":"string"},"required":{"type":"boolean"}}},"GeneralParameterTypeENUM":{"title":"GeneralSettingTypeENUM","type":"string","enum":["STRING","INTEGER","DECIMAL","BOOL","ENUM"],"description":"| Type | Description |\n|--|--|\n|BOOL | Booleans will be the string `true` or `false` |\n|DECIMAL | Descimal numbers can only have two decimals and is represented as an integer multiplied by 100. Example: 1.2 is will be 120 and 5 will be 500 |\n|ENUM| The enum value should be one of the values listed in `allowedValues` |"},"DevicePrinterResponseSchema":{"title":"DevicePrinterResponseSchema","type":"object","required":["printerUid","name","type"],"properties":{"printerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/PrinterTypeENUM"}}},"PrinterTypeENUM":{"title":"PrinterTypeENUM","type":"string","enum":["LABEL","RECEIPT","GENERAL"]}},"responses":{"DeviceResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceResponseSchema"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/devices/{deviceUid}":{"put":{"description":"Update details for a device. Partial updates are allowed.\n\nRequired permission: TENANT.ADMIN\n\nSetting the status to \"READY_TO_LINK\" will unlink it for the current device and create a new deviceLinkCode and a new identifier","operationId":"put-tenants-device-details","requestBody":{"$ref":"#/components/requestBodies/TenantDeviceUpdateRequest"},"responses":{"200":{"$ref":"#/components/responses/DeviceResponse"}},"summary":"Update device details","tags":["Device"]}}}}
```

## Delete a device

> Deletes a device.\
> \
> Required permission: TENANT.ADMIN

```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"}],"security":[{"authToken":[]},{"integrationToken":[]},{"accessToken":[]}],"components":{"securitySchemes":{"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"},"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"}}},"paths":{"/tenants/{tenantUid}/devices/{deviceUid}":{"delete":{"description":"Deletes a device.\n\nRequired permission: TENANT.ADMIN","operationId":"delete-tenants-device","responses":{"204":{"description":"No Content"}},"summary":"Delete a device","tags":["Device"]}}}}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/device.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
