# User

User

## Get full account info

> Get full account information for a logged-in user. This will return information for all tenants the user has access to.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"User","description":"User"}],"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":{"AccountResponse":{"content":{"application/json":{"schema":{"type":"object","properties":{"globalRoles":{"type":"array","items":{"type":"string"}},"defaultTenantUid":{"$ref":"#/components/schemas/UID"},"tenants":{"type":"array","items":{"$ref":"#/components/schemas/TenantUserResponseSchema"}}},"required":["globalRoles","defaultTenantUid","tenants"]}}},"description":"User account response"}},"schemas":{"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"TenantUserResponseSchema":{"title":"TenantUserResponseSchema","type":"object","properties":{"accountType":{"$ref":"#/components/schemas/TenantAccountTypeENUM"},"createdAt":{"format":"date-time","type":"string"},"defaultStoreUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastAccessed":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"status":{"enum":["PENDING_INVITE","ACTIVE","INACTIVE"],"type":"string"},"storeAccess":{"type":"array","items":{"$ref":"#/components/schemas/UserStoreAccessResponseSchema"}},"tenantUid":{"$ref":"#/components/schemas/UID"},"tenantRole":{"$ref":"#/components/schemas/TenantRoleENUM"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"userCode":{"type":"string"},"languageCode":{"$ref":"#/components/schemas/LanguageCode"}},"required":["accountType","createdAt","displayName","email","externalId","firstname","lastAccessed","lastModifiedAt","lastname","mobile","status","storeAccess","tenantUid","tenantRole","tenantUserUid","userCode","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"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"EmailTYPE":{"title":"Email","type":"string"},"UserStoreAccessResponseSchema":{"title":"UserStoreAccessResponseSchema","type":"object","properties":{"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"storeAccessUid":{"$ref":"#/components/schemas/UID"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeRole":{"$ref":"#/components/schemas/StoreRoleENUM"}},"required":["createdAt","lastModifiedAt","storeAccessUid","storeUid","storeRole"]},"StoreRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ADMIN | Store admin.|\n| BACKOFFICE | Access to all backoffice functionality (price changes, purhcase order, etc)|\n| REGULAR | Access to app funtionality (product lookup, create sales, delivery)|","enum":["ADMIN","BACKOFFICE","REGULAR"],"title":"StoreRoleENUM","type":"string"},"TenantRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| BLOCKED | Blocked from this tenant|\n| ACCESS | Only access to the tenant.|\n| ADMIN | Tenant admin, allow full access to tenant and can add users and new stores.|\n| BACKOFFICE | Access to product, pricelists, etc.|","enum":["ACCESS","ADMIN","BACKOFFICE","BLOCKED"],"title":"TenantRoleENUM","type":"string"},"LanguageCode":{"title":"LanguageCode","description":"ISO 639-1 code for language","type":"string"}}},"paths":{"/account":{"get":{"description":"Get full account information for a logged-in user. This will return information for all tenants the user has access to.","operationId":"get-account","responses":{"200":{"$ref":"#/components/responses/AccountResponse"}},"summary":"Get full account info","tags":["User"]}}}}
```

## Login user

> Login as a tenant user\
> \
> Requires a valid deviceToken

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"User","description":"User"}],"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":{"AccountLoginResponse":{"content":{"application/json":{"schema":{"properties":{"accessToken":{"type":"string"},"tenantUser":{"$ref":"#/components/schemas/TenantUserResponseSchema"}},"required":["accessToken","tenantUser"],"type":"object"}}},"description":"Example response"}},"schemas":{"TenantUserResponseSchema":{"title":"TenantUserResponseSchema","type":"object","properties":{"accountType":{"$ref":"#/components/schemas/TenantAccountTypeENUM"},"createdAt":{"format":"date-time","type":"string"},"defaultStoreUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastAccessed":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"status":{"enum":["PENDING_INVITE","ACTIVE","INACTIVE"],"type":"string"},"storeAccess":{"type":"array","items":{"$ref":"#/components/schemas/UserStoreAccessResponseSchema"}},"tenantUid":{"$ref":"#/components/schemas/UID"},"tenantRole":{"$ref":"#/components/schemas/TenantRoleENUM"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"userCode":{"type":"string"},"languageCode":{"$ref":"#/components/schemas/LanguageCode"}},"required":["accountType","createdAt","displayName","email","externalId","firstname","lastAccessed","lastModifiedAt","lastname","mobile","status","storeAccess","tenantUid","tenantRole","tenantUserUid","userCode","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"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"EmailTYPE":{"title":"Email","type":"string"},"UserStoreAccessResponseSchema":{"title":"UserStoreAccessResponseSchema","type":"object","properties":{"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"storeAccessUid":{"$ref":"#/components/schemas/UID"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeRole":{"$ref":"#/components/schemas/StoreRoleENUM"}},"required":["createdAt","lastModifiedAt","storeAccessUid","storeUid","storeRole"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"StoreRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ADMIN | Store admin.|\n| BACKOFFICE | Access to all backoffice functionality (price changes, purhcase order, etc)|\n| REGULAR | Access to app funtionality (product lookup, create sales, delivery)|","enum":["ADMIN","BACKOFFICE","REGULAR"],"title":"StoreRoleENUM","type":"string"},"TenantRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| BLOCKED | Blocked from this tenant|\n| ACCESS | Only access to the tenant.|\n| ADMIN | Tenant admin, allow full access to tenant and can add users and new stores.|\n| BACKOFFICE | Access to product, pricelists, etc.|","enum":["ACCESS","ADMIN","BACKOFFICE","BLOCKED"],"title":"TenantRoleENUM","type":"string"},"LanguageCode":{"title":"LanguageCode","description":"ISO 639-1 code for language","type":"string"},"AccountLoginRequestSchema":{"title":"AccountLoginRequestSchema","type":"object","properties":{"password":{"type":"string"},"userCode":{"type":"string"}},"required":["userCode","password"]}},"requestBodies":{"AccountLoginRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountLoginRequestSchema"}}}}}},"paths":{"/account":{"post":{"summary":"Login user","operationId":"post-account","responses":{"200":{"$ref":"#/components/responses/AccountLoginResponse"}},"description":"Login as a tenant user\n\nRequires a valid deviceToken","requestBody":{"$ref":"#/components/requestBodies/AccountLoginRequest"},"tags":["User"]}}}}
```

## Update global account information

> Update global information about logged in user

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"User","description":"User"}],"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"}},"requestBodies":{"AccountUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUpdateSchema"}}}}},"schemas":{"AccountUpdateSchema":{"title":"AccountUpdateSchema","type":"object","properties":{"defaultTenantUid":{"$ref":"#/components/schemas/UID"}},"required":["defaultTenantUid"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"TenantUserResponseSchema":{"title":"TenantUserResponseSchema","type":"object","properties":{"accountType":{"$ref":"#/components/schemas/TenantAccountTypeENUM"},"createdAt":{"format":"date-time","type":"string"},"defaultStoreUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastAccessed":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"status":{"enum":["PENDING_INVITE","ACTIVE","INACTIVE"],"type":"string"},"storeAccess":{"type":"array","items":{"$ref":"#/components/schemas/UserStoreAccessResponseSchema"}},"tenantUid":{"$ref":"#/components/schemas/UID"},"tenantRole":{"$ref":"#/components/schemas/TenantRoleENUM"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"userCode":{"type":"string"},"languageCode":{"$ref":"#/components/schemas/LanguageCode"}},"required":["accountType","createdAt","displayName","email","externalId","firstname","lastAccessed","lastModifiedAt","lastname","mobile","status","storeAccess","tenantUid","tenantRole","tenantUserUid","userCode","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"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"EmailTYPE":{"title":"Email","type":"string"},"UserStoreAccessResponseSchema":{"title":"UserStoreAccessResponseSchema","type":"object","properties":{"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"storeAccessUid":{"$ref":"#/components/schemas/UID"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeRole":{"$ref":"#/components/schemas/StoreRoleENUM"}},"required":["createdAt","lastModifiedAt","storeAccessUid","storeUid","storeRole"]},"StoreRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ADMIN | Store admin.|\n| BACKOFFICE | Access to all backoffice functionality (price changes, purhcase order, etc)|\n| REGULAR | Access to app funtionality (product lookup, create sales, delivery)|","enum":["ADMIN","BACKOFFICE","REGULAR"],"title":"StoreRoleENUM","type":"string"},"TenantRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| BLOCKED | Blocked from this tenant|\n| ACCESS | Only access to the tenant.|\n| ADMIN | Tenant admin, allow full access to tenant and can add users and new stores.|\n| BACKOFFICE | Access to product, pricelists, etc.|","enum":["ACCESS","ADMIN","BACKOFFICE","BLOCKED"],"title":"TenantRoleENUM","type":"string"},"LanguageCode":{"title":"LanguageCode","description":"ISO 639-1 code for language","type":"string"}},"responses":{"AccountResponse":{"content":{"application/json":{"schema":{"type":"object","properties":{"globalRoles":{"type":"array","items":{"type":"string"}},"defaultTenantUid":{"$ref":"#/components/schemas/UID"},"tenants":{"type":"array","items":{"$ref":"#/components/schemas/TenantUserResponseSchema"}}},"required":["globalRoles","defaultTenantUid","tenants"]}}},"description":"User account response"}}},"paths":{"/account":{"put":{"description":"Update global information about logged in user","operationId":"put-account","requestBody":{"$ref":"#/components/requestBodies/AccountUpdateRequest"},"responses":{"200":{"$ref":"#/components/responses/AccountResponse"}},"summary":"Update global account information","tags":["User"]}}}}
```

## Get account info for a specific tenant

> Get tenant information about logged-in user

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"User","description":"User"}],"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":{"TenantUserResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUserResponseSchema"}}},"description":"Tenant user respose"}},"schemas":{"TenantUserResponseSchema":{"title":"TenantUserResponseSchema","type":"object","properties":{"accountType":{"$ref":"#/components/schemas/TenantAccountTypeENUM"},"createdAt":{"format":"date-time","type":"string"},"defaultStoreUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastAccessed":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"status":{"enum":["PENDING_INVITE","ACTIVE","INACTIVE"],"type":"string"},"storeAccess":{"type":"array","items":{"$ref":"#/components/schemas/UserStoreAccessResponseSchema"}},"tenantUid":{"$ref":"#/components/schemas/UID"},"tenantRole":{"$ref":"#/components/schemas/TenantRoleENUM"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"userCode":{"type":"string"},"languageCode":{"$ref":"#/components/schemas/LanguageCode"}},"required":["accountType","createdAt","displayName","email","externalId","firstname","lastAccessed","lastModifiedAt","lastname","mobile","status","storeAccess","tenantUid","tenantRole","tenantUserUid","userCode","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"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"EmailTYPE":{"title":"Email","type":"string"},"UserStoreAccessResponseSchema":{"title":"UserStoreAccessResponseSchema","type":"object","properties":{"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"storeAccessUid":{"$ref":"#/components/schemas/UID"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeRole":{"$ref":"#/components/schemas/StoreRoleENUM"}},"required":["createdAt","lastModifiedAt","storeAccessUid","storeUid","storeRole"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"StoreRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ADMIN | Store admin.|\n| BACKOFFICE | Access to all backoffice functionality (price changes, purhcase order, etc)|\n| REGULAR | Access to app funtionality (product lookup, create sales, delivery)|","enum":["ADMIN","BACKOFFICE","REGULAR"],"title":"StoreRoleENUM","type":"string"},"TenantRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| BLOCKED | Blocked from this tenant|\n| ACCESS | Only access to the tenant.|\n| ADMIN | Tenant admin, allow full access to tenant and can add users and new stores.|\n| BACKOFFICE | Access to product, pricelists, etc.|","enum":["ACCESS","ADMIN","BACKOFFICE","BLOCKED"],"title":"TenantRoleENUM","type":"string"},"LanguageCode":{"title":"LanguageCode","description":"ISO 639-1 code for language","type":"string"}}},"paths":{"/tenants/{tenantUid}/account":{"get":{"description":"Get tenant information about logged-in user","operationId":"get-tenants-account","responses":{"200":{"$ref":"#/components/responses/TenantUserResponse"}},"summary":"Get account info for a specific tenant","tags":["User"]}}}}
```

## Generate accessToken from authToken

> Generate access token from auth token

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"User","description":"User"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"authToken":[]}],"components":{"securitySchemes":{"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"}},"responses":{"TenantUserResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUserResponseSchema"}}},"description":"Tenant user respose"}},"schemas":{"TenantUserResponseSchema":{"title":"TenantUserResponseSchema","type":"object","properties":{"accountType":{"$ref":"#/components/schemas/TenantAccountTypeENUM"},"createdAt":{"format":"date-time","type":"string"},"defaultStoreUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastAccessed":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"status":{"enum":["PENDING_INVITE","ACTIVE","INACTIVE"],"type":"string"},"storeAccess":{"type":"array","items":{"$ref":"#/components/schemas/UserStoreAccessResponseSchema"}},"tenantUid":{"$ref":"#/components/schemas/UID"},"tenantRole":{"$ref":"#/components/schemas/TenantRoleENUM"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"userCode":{"type":"string"},"languageCode":{"$ref":"#/components/schemas/LanguageCode"}},"required":["accountType","createdAt","displayName","email","externalId","firstname","lastAccessed","lastModifiedAt","lastname","mobile","status","storeAccess","tenantUid","tenantRole","tenantUserUid","userCode","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"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"EmailTYPE":{"title":"Email","type":"string"},"UserStoreAccessResponseSchema":{"title":"UserStoreAccessResponseSchema","type":"object","properties":{"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"storeAccessUid":{"$ref":"#/components/schemas/UID"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeRole":{"$ref":"#/components/schemas/StoreRoleENUM"}},"required":["createdAt","lastModifiedAt","storeAccessUid","storeUid","storeRole"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"StoreRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ADMIN | Store admin.|\n| BACKOFFICE | Access to all backoffice functionality (price changes, purhcase order, etc)|\n| REGULAR | Access to app funtionality (product lookup, create sales, delivery)|","enum":["ADMIN","BACKOFFICE","REGULAR"],"title":"StoreRoleENUM","type":"string"},"TenantRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| BLOCKED | Blocked from this tenant|\n| ACCESS | Only access to the tenant.|\n| ADMIN | Tenant admin, allow full access to tenant and can add users and new stores.|\n| BACKOFFICE | Access to product, pricelists, etc.|","enum":["ACCESS","ADMIN","BACKOFFICE","BLOCKED"],"title":"TenantRoleENUM","type":"string"},"LanguageCode":{"title":"LanguageCode","description":"ISO 639-1 code for language","type":"string"}}},"paths":{"/tenants/{tenantUid}/account":{"post":{"summary":"Generate accessToken from authToken","operationId":"post-tenants-account","responses":{"200":{"$ref":"#/components/responses/TenantUserResponse"}},"description":"Generate access token from auth token","tags":["User"]}}}}
```

## Update account info

> Update information about logged in user

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"User","description":"User"}],"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"}},"requestBodies":{"TenantAccountUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantAccountUpdateSchema"}}}}},"schemas":{"TenantAccountUpdateSchema":{"description":"Update the tenant account","title":"TenantAccountUpdateSchema","type":"object","properties":{"defaultStoreUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"firstname":{"type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"password":{"type":"string"},"languageCode":{"$ref":"#/components/schemas/LanguageCode"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"EmailTYPE":{"title":"Email","type":"string"},"LanguageCode":{"title":"LanguageCode","description":"ISO 639-1 code for language","type":"string"},"TenantUserResponseSchema":{"title":"TenantUserResponseSchema","type":"object","properties":{"accountType":{"$ref":"#/components/schemas/TenantAccountTypeENUM"},"createdAt":{"format":"date-time","type":"string"},"defaultStoreUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastAccessed":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"status":{"enum":["PENDING_INVITE","ACTIVE","INACTIVE"],"type":"string"},"storeAccess":{"type":"array","items":{"$ref":"#/components/schemas/UserStoreAccessResponseSchema"}},"tenantUid":{"$ref":"#/components/schemas/UID"},"tenantRole":{"$ref":"#/components/schemas/TenantRoleENUM"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"userCode":{"type":"string"},"languageCode":{"$ref":"#/components/schemas/LanguageCode"}},"required":["accountType","createdAt","displayName","email","externalId","firstname","lastAccessed","lastModifiedAt","lastname","mobile","status","storeAccess","tenantUid","tenantRole","tenantUserUid","userCode","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"},"UserStoreAccessResponseSchema":{"title":"UserStoreAccessResponseSchema","type":"object","properties":{"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"storeAccessUid":{"$ref":"#/components/schemas/UID"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeRole":{"$ref":"#/components/schemas/StoreRoleENUM"}},"required":["createdAt","lastModifiedAt","storeAccessUid","storeUid","storeRole"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"StoreRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ADMIN | Store admin.|\n| BACKOFFICE | Access to all backoffice functionality (price changes, purhcase order, etc)|\n| REGULAR | Access to app funtionality (product lookup, create sales, delivery)|","enum":["ADMIN","BACKOFFICE","REGULAR"],"title":"StoreRoleENUM","type":"string"},"TenantRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| BLOCKED | Blocked from this tenant|\n| ACCESS | Only access to the tenant.|\n| ADMIN | Tenant admin, allow full access to tenant and can add users and new stores.|\n| BACKOFFICE | Access to product, pricelists, etc.|","enum":["ACCESS","ADMIN","BACKOFFICE","BLOCKED"],"title":"TenantRoleENUM","type":"string"}},"responses":{"TenantUserResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUserResponseSchema"}}},"description":"Tenant user respose"}}},"paths":{"/tenants/{tenantUid}/account":{"put":{"description":"Update information about logged in user","operationId":"put-tenants-account","requestBody":{"$ref":"#/components/requestBodies/TenantAccountUpdateRequest"},"responses":{"200":{"$ref":"#/components/responses/TenantUserResponse"}},"summary":"Update account info","tags":["User"]}}}}
```

## Get tenant invitation information

> Get information about invitation to a tenant

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"User","description":"User"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[],"paths":{"/account/invite":{"get":{"description":"Get information about invitation to a tenant","operationId":"get-account-invite","parameters":[{"description":"invite token","in":"header","name":"x-invite-token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/TenantInviteInformationResponse"}},"summary":"Get tenant invitation information","tags":["User"]}}},"components":{"responses":{"TenantInviteInformationResponse":{"content":{"application/json":{"schema":{"properties":{"tenant":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"},"user":{"properties":{"displayName":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"firstname":{"type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"status":{"type":"string"}},"required":["email","mobile","firstname","lastname","displayName","status"],"type":"object"}},"required":["tenant","user"],"type":"object"}}},"description":"Example response"}},"schemas":{"EmailTYPE":{"title":"Email","type":"string"}}}}
```

## Accept tenant invitation

> Accept invitation to a tenant

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"User","description":"User"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"authToken":[]}],"components":{"securitySchemes":{"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"}},"requestBodies":{"TenantAccountAcceptInviteRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantAccountAcceptInviteSchema"}}}}},"schemas":{"TenantAccountAcceptInviteSchema":{"description":"Accept an invitation","title":"TenantAccountAcceptInviteSchema","type":"object","properties":{"inviteToken":{"type":"string"}},"required":["inviteToken"]},"TenantUserResponseSchema":{"title":"TenantUserResponseSchema","type":"object","properties":{"accountType":{"$ref":"#/components/schemas/TenantAccountTypeENUM"},"createdAt":{"format":"date-time","type":"string"},"defaultStoreUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastAccessed":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"status":{"enum":["PENDING_INVITE","ACTIVE","INACTIVE"],"type":"string"},"storeAccess":{"type":"array","items":{"$ref":"#/components/schemas/UserStoreAccessResponseSchema"}},"tenantUid":{"$ref":"#/components/schemas/UID"},"tenantRole":{"$ref":"#/components/schemas/TenantRoleENUM"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"userCode":{"type":"string"},"languageCode":{"$ref":"#/components/schemas/LanguageCode"}},"required":["accountType","createdAt","displayName","email","externalId","firstname","lastAccessed","lastModifiedAt","lastname","mobile","status","storeAccess","tenantUid","tenantRole","tenantUserUid","userCode","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"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"EmailTYPE":{"title":"Email","type":"string"},"UserStoreAccessResponseSchema":{"title":"UserStoreAccessResponseSchema","type":"object","properties":{"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"storeAccessUid":{"$ref":"#/components/schemas/UID"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeRole":{"$ref":"#/components/schemas/StoreRoleENUM"}},"required":["createdAt","lastModifiedAt","storeAccessUid","storeUid","storeRole"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"StoreRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ADMIN | Store admin.|\n| BACKOFFICE | Access to all backoffice functionality (price changes, purhcase order, etc)|\n| REGULAR | Access to app funtionality (product lookup, create sales, delivery)|","enum":["ADMIN","BACKOFFICE","REGULAR"],"title":"StoreRoleENUM","type":"string"},"TenantRoleENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| BLOCKED | Blocked from this tenant|\n| ACCESS | Only access to the tenant.|\n| ADMIN | Tenant admin, allow full access to tenant and can add users and new stores.|\n| BACKOFFICE | Access to product, pricelists, etc.|","enum":["ACCESS","ADMIN","BACKOFFICE","BLOCKED"],"title":"TenantRoleENUM","type":"string"},"LanguageCode":{"title":"LanguageCode","description":"ISO 639-1 code for language","type":"string"}},"responses":{"TenantUserResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUserResponseSchema"}}},"description":"Tenant user respose"}}},"paths":{"/account/invite":{"put":{"description":"Accept invitation to a tenant","operationId":"put-account-invite","requestBody":{"$ref":"#/components/requestBodies/TenantAccountAcceptInviteRequest"},"responses":{"200":{"$ref":"#/components/responses/TenantUserResponse"}},"summary":"Accept tenant invitation","tags":["User"]}}}}
```


---

# 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/user.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.
