# Customer

Customer

## List customers

> List all customers.\
> \
> Required permission: TENANT.ACCESS

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"}],"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"}},"parameters":{"customerExternalIdQuery":{"description":"External reference to a customer.","in":"query","name":"customerExternalId","required":false,"schema":{"type":"string"}},"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"},"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","ledgerNumber","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehfEnabled","customerGroupUids"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"description":"ISO 3166-1: 2 characters representation of country","type":"string"},"createdAt":{"format":"date-time","type":"string"},"customerUid":{"$ref":"#/components/schemas/UID"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"origin":{"type":"string"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddressResponseSchema"}},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactResponseSchema"}},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerExtensionResponseSchema"}},"consents":{"type":"array","items":{"$ref":"#/components/schemas/CustomerConsentStatusSchema"}},"loyaltyId":{"type":"string"},"displayName":{"type":"string"},"credit":{"$ref":"#/components/schemas/CustomerCreditResponseSchema"},"paymentTerms":{"type":"integer"},"internalNote":{"type":"string"},"accountManager":{"$ref":"#/components/schemas/AccountManagerResponseSchema"},"ehfEnabled":{"type":"boolean"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerTypeENUM":{"enum":["COMPANY","PERSON","B2B"],"title":"CustomerTypeENUM","type":"string"},"EmailTYPE":{"title":"Email","type":"string"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"VatNumberTYPE":{"description":"VAT identification number for value added tax reporting purposes.","title":"VatNumber","type":"string"},"CustomerAddressResponseSchema":{"title":"CustomerAddressResponseSchema","type":"object","required":["address","city","companyName","firstname","lastname","countryCode","email","phone","postalCode","type","customerAddressUid","displayName"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"phone":{"type":"string"},"postalCode":{"type":"string"},"type":{"$ref":"#/components/schemas/CustomerAddressTypeENUM"},"customerAddressUid":{"type":"string"},"displayName":{"type":"string"}}},"CustomerAddressTypeENUM":{"enum":["DELIVERY_ADDRESS","INVOICE_ADDRESS"],"title":"CustomerAddressTypeENUM","type":"string"},"CustomerContactResponseSchema":{"title":"CustomerContactResponseSchema","type":"object","description":"CustomerContactResponseSchema","required":["firstname","lastname","email","mobile","createdAt","lastModifiedAt","customerContactUid","extensions","displayName"],"properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastModifiedAt":{"type":"string","format":"date-time"},"customerContactUid":{"type":"string"},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactExtensionResponseSchema"}},"displayName":{"type":"string"}}},"CustomerContactExtensionResponseSchema":{"description":"CustomerContactExtensionResponseSchema","title":"CustomerContactExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerExtensionCodeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| TWO_INVOICE | The Two Invoice extension.|","enum":["TWO_INVOICE"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerConsentStatusSchema":{"title":"CustomerConsentStatusSchema","type":"object","required":["consentUid","name","status","source","createdAt"],"properties":{"consentUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"status":{"type":"boolean"},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"CustomerCreditResponseSchema":{"title":"CustomerCreditResponseSchema","allOf":[{"$ref":"#/components/schemas/CustomerCreditSchema"},{"required":["limit","balance"],"properties":{"limit":{"type":"integer"},"balance":{"type":"integer"}}}],"type":"object"},"CustomerCreditSchema":{"title":"CustomerCreditSchema","type":"object","properties":{"limit":{"type":"integer","description":"Limit 0 = No limit set for customer"},"balance":{"type":"integer"}}},"AccountManagerResponseSchema":{"title":"AccountManagerResponseSchema","type":"object","required":["tenantUserUid","displayName","userCode"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"userCode":{"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"}},"responses":{"CustomerListResponse":{"content":{"application/json":{"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CustomerResponseSchema"},"type":"array"},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"],"type":"object"}}},"description":"CustomerListResponse"}}},"paths":{"/tenants/{tenantUid}/customers":{"get":{"description":"List all customers.\n\nRequired permission: TENANT.ACCESS","operationId":"get-tenants-customers","parameters":[{"$ref":"#/components/parameters/customerExternalIdQuery"},{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"responses":{"200":{"$ref":"#/components/responses/CustomerListResponse"}},"summary":"List customers","tags":["Customer"]}}}}
```

## Create a new customer

> Required permission: TENANT.ACCESS

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"}],"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":{"CustomerCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreateSchema"}}},"description":"B2B customer can only be created by users having admin acces"}},"schemas":{"CustomerCreateSchema":{"title":"CustomerCreateSchema","allOf":[{"$ref":"#/components/schemas/CustomerUpdateSchema"},{"type":"object","required":["customerType"],"properties":{"customerUid":{"$ref":"#/components/schemas/UID"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"}}}]},"CustomerUpdateSchema":{"title":"CustomerUpdateSchema","type":"object","properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"description":"ISO 3166-1: 2 characters representation of country","type":"string"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"origin":{"type":"string"},"loyaltyId":{"type":"string"},"credit":{"$ref":"#/components/schemas/CustomerCreditSchema"},"paymentTerms":{"type":"integer","description":"Number of days to calculate due date on invoice"},"internalNote":{"type":"string"},"accountManager":{"$ref":"#/components/schemas/AccountManagerRequestSchema"},"ehfEnabled":{"type":"boolean"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}},"CustomerTypeENUM":{"enum":["COMPANY","PERSON","B2B"],"title":"CustomerTypeENUM","type":"string"},"EmailTYPE":{"title":"Email","type":"string"},"VatNumberTYPE":{"description":"VAT identification number for value added tax reporting purposes.","title":"VatNumber","type":"string"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"CustomerCreditSchema":{"title":"CustomerCreditSchema","type":"object","properties":{"limit":{"type":"integer","description":"Limit 0 = No limit set for customer"},"balance":{"type":"integer"}}},"AccountManagerRequestSchema":{"title":"AccountManagerRequestSchema","type":"object","required":["tenantUserUid"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","ledgerNumber","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehfEnabled","customerGroupUids"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"description":"ISO 3166-1: 2 characters representation of country","type":"string"},"createdAt":{"format":"date-time","type":"string"},"customerUid":{"$ref":"#/components/schemas/UID"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"origin":{"type":"string"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddressResponseSchema"}},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactResponseSchema"}},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerExtensionResponseSchema"}},"consents":{"type":"array","items":{"$ref":"#/components/schemas/CustomerConsentStatusSchema"}},"loyaltyId":{"type":"string"},"displayName":{"type":"string"},"credit":{"$ref":"#/components/schemas/CustomerCreditResponseSchema"},"paymentTerms":{"type":"integer"},"internalNote":{"type":"string"},"accountManager":{"$ref":"#/components/schemas/AccountManagerResponseSchema"},"ehfEnabled":{"type":"boolean"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}},"CustomerAddressResponseSchema":{"title":"CustomerAddressResponseSchema","type":"object","required":["address","city","companyName","firstname","lastname","countryCode","email","phone","postalCode","type","customerAddressUid","displayName"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"phone":{"type":"string"},"postalCode":{"type":"string"},"type":{"$ref":"#/components/schemas/CustomerAddressTypeENUM"},"customerAddressUid":{"type":"string"},"displayName":{"type":"string"}}},"CustomerAddressTypeENUM":{"enum":["DELIVERY_ADDRESS","INVOICE_ADDRESS"],"title":"CustomerAddressTypeENUM","type":"string"},"CustomerContactResponseSchema":{"title":"CustomerContactResponseSchema","type":"object","description":"CustomerContactResponseSchema","required":["firstname","lastname","email","mobile","createdAt","lastModifiedAt","customerContactUid","extensions","displayName"],"properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastModifiedAt":{"type":"string","format":"date-time"},"customerContactUid":{"type":"string"},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactExtensionResponseSchema"}},"displayName":{"type":"string"}}},"CustomerContactExtensionResponseSchema":{"description":"CustomerContactExtensionResponseSchema","title":"CustomerContactExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerExtensionCodeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| TWO_INVOICE | The Two Invoice extension.|","enum":["TWO_INVOICE"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerConsentStatusSchema":{"title":"CustomerConsentStatusSchema","type":"object","required":["consentUid","name","status","source","createdAt"],"properties":{"consentUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"status":{"type":"boolean"},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"CustomerCreditResponseSchema":{"title":"CustomerCreditResponseSchema","allOf":[{"$ref":"#/components/schemas/CustomerCreditSchema"},{"required":["limit","balance"],"properties":{"limit":{"type":"integer"},"balance":{"type":"integer"}}}],"type":"object"},"AccountManagerResponseSchema":{"title":"AccountManagerResponseSchema","type":"object","required":["tenantUserUid","displayName","userCode"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"userCode":{"type":"string"}}}},"responses":{"CustomerResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponseSchema"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/customers":{"post":{"description":"Required permission: TENANT.ACCESS","operationId":"post-tenants-customers","requestBody":{"$ref":"#/components/requestBodies/CustomerCreateRequest"},"responses":{"201":{"$ref":"#/components/responses/CustomerResponse"}},"summary":"Create a new customer","tags":["Customer"]}}}}
```

## Search customers

> Searches for customers based on criteria set in the request body. Required permission: TENANT.ACCESS

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"}],"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"}},"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"},"CustomerSearchSchema":{"title":"CustomerSearchSchema","type":"object","properties":{"exactMatch":{"type":"boolean"},"query":{"type":"string"},"mobile":{"type":"string"},"email":{"type":"string"},"scope":{"type":"array","items":{"$ref":"#/components/schemas/CustomerSearchScopeENUM"}}}},"CustomerSearchScopeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CUSTOMER | Search for customers|\n| CONTACT | Search for customer contacts|","enum":["CUSTOMER","CONTACT"],"title":"CustomerSearchScope","type":"string"},"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","ledgerNumber","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehfEnabled","customerGroupUids"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"description":"ISO 3166-1: 2 characters representation of country","type":"string"},"createdAt":{"format":"date-time","type":"string"},"customerUid":{"$ref":"#/components/schemas/UID"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"origin":{"type":"string"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddressResponseSchema"}},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactResponseSchema"}},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerExtensionResponseSchema"}},"consents":{"type":"array","items":{"$ref":"#/components/schemas/CustomerConsentStatusSchema"}},"loyaltyId":{"type":"string"},"displayName":{"type":"string"},"credit":{"$ref":"#/components/schemas/CustomerCreditResponseSchema"},"paymentTerms":{"type":"integer"},"internalNote":{"type":"string"},"accountManager":{"$ref":"#/components/schemas/AccountManagerResponseSchema"},"ehfEnabled":{"type":"boolean"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerTypeENUM":{"enum":["COMPANY","PERSON","B2B"],"title":"CustomerTypeENUM","type":"string"},"EmailTYPE":{"title":"Email","type":"string"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"VatNumberTYPE":{"description":"VAT identification number for value added tax reporting purposes.","title":"VatNumber","type":"string"},"CustomerAddressResponseSchema":{"title":"CustomerAddressResponseSchema","type":"object","required":["address","city","companyName","firstname","lastname","countryCode","email","phone","postalCode","type","customerAddressUid","displayName"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"phone":{"type":"string"},"postalCode":{"type":"string"},"type":{"$ref":"#/components/schemas/CustomerAddressTypeENUM"},"customerAddressUid":{"type":"string"},"displayName":{"type":"string"}}},"CustomerAddressTypeENUM":{"enum":["DELIVERY_ADDRESS","INVOICE_ADDRESS"],"title":"CustomerAddressTypeENUM","type":"string"},"CustomerContactResponseSchema":{"title":"CustomerContactResponseSchema","type":"object","description":"CustomerContactResponseSchema","required":["firstname","lastname","email","mobile","createdAt","lastModifiedAt","customerContactUid","extensions","displayName"],"properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastModifiedAt":{"type":"string","format":"date-time"},"customerContactUid":{"type":"string"},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactExtensionResponseSchema"}},"displayName":{"type":"string"}}},"CustomerContactExtensionResponseSchema":{"description":"CustomerContactExtensionResponseSchema","title":"CustomerContactExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerExtensionCodeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| TWO_INVOICE | The Two Invoice extension.|","enum":["TWO_INVOICE"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerConsentStatusSchema":{"title":"CustomerConsentStatusSchema","type":"object","required":["consentUid","name","status","source","createdAt"],"properties":{"consentUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"status":{"type":"boolean"},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"CustomerCreditResponseSchema":{"title":"CustomerCreditResponseSchema","allOf":[{"$ref":"#/components/schemas/CustomerCreditSchema"},{"required":["limit","balance"],"properties":{"limit":{"type":"integer"},"balance":{"type":"integer"}}}],"type":"object"},"CustomerCreditSchema":{"title":"CustomerCreditSchema","type":"object","properties":{"limit":{"type":"integer","description":"Limit 0 = No limit set for customer"},"balance":{"type":"integer"}}},"AccountManagerResponseSchema":{"title":"AccountManagerResponseSchema","type":"object","required":["tenantUserUid","displayName","userCode"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"userCode":{"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"}},"requestBodies":{"CustomerSearchRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerSearchSchema"}}}}},"responses":{"CustomerListResponse":{"content":{"application/json":{"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CustomerResponseSchema"},"type":"array"},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"],"type":"object"}}},"description":"CustomerListResponse"}}},"paths":{"/tenants/{tenantUid}/customers/search":{"post":{"description":"Searches for customers based on criteria set in the request body. Required permission: TENANT.ACCESS","operationId":"post-tenants-customers-search","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"requestBody":{"$ref":"#/components/requestBodies/CustomerSearchRequest"},"responses":{"200":{"$ref":"#/components/responses/CustomerListResponse"}},"summary":"Search customers","tags":["Customer"]}}}}
```

## External search for customers

> Searches for customers externally based on criteria set in the request body. Required permission: TENANT.ACCESS. Must have a valid tenantExtension EXTERNAL\_CUSTOMER\_SEARCH.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"}],"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"}},"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"},"CustomerExternalSearchSchema":{"title":"CustomerExternalSearchSchema","type":"object","properties":{"query":{"type":"string"}}},"CustomerExternalResponseSchema":{"title":"CustomerExternalResponseSchema","type":"object","properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"description":"ISO 3166-1: 2 characters representation of country","type":"string"},"createdAt":{"format":"date-time","type":"string"},"customerUid":{"$ref":"#/components/schemas/UID"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"origin":{"type":"string"}},"required":["address","city","companyName","countryCode","createdAt","customerUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","ledgerNumber","mobile","postalCode","pricelistUid","vatNumber","origin"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerTypeENUM":{"enum":["COMPANY","PERSON","B2B"],"title":"CustomerTypeENUM","type":"string"},"EmailTYPE":{"title":"Email","type":"string"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"VatNumberTYPE":{"description":"VAT identification number for value added tax reporting purposes.","title":"VatNumber","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"}},"requestBodies":{"CustomerExternalSearchRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerExternalSearchSchema"}}}}},"responses":{"CustomerExternalListResponse":{"content":{"application/json":{"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CustomerExternalResponseSchema"},"type":"array"},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"],"type":"object"}}},"description":"CustomerExternalListResponse"}}},"paths":{"/tenants/{tenantUid}/customers/search/external":{"post":{"description":"Searches for customers externally based on criteria set in the request body. Required permission: TENANT.ACCESS. Must have a valid tenantExtension EXTERNAL_CUSTOMER_SEARCH.","operationId":"post-tenants-customers-search-external","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"requestBody":{"$ref":"#/components/requestBodies/CustomerExternalSearchRequest"},"responses":{"200":{"$ref":"#/components/responses/CustomerExternalListResponse"}},"summary":"External search for customers","tags":["Customer"]}}}}
```

## Get customer details

> Get details for a customer.\
> \
> Required permission: TENANT.ACCESS

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"}],"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":{"CustomerResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponseSchema"}}},"description":"Example response"}},"schemas":{"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","ledgerNumber","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehfEnabled","customerGroupUids"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"description":"ISO 3166-1: 2 characters representation of country","type":"string"},"createdAt":{"format":"date-time","type":"string"},"customerUid":{"$ref":"#/components/schemas/UID"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"origin":{"type":"string"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddressResponseSchema"}},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactResponseSchema"}},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerExtensionResponseSchema"}},"consents":{"type":"array","items":{"$ref":"#/components/schemas/CustomerConsentStatusSchema"}},"loyaltyId":{"type":"string"},"displayName":{"type":"string"},"credit":{"$ref":"#/components/schemas/CustomerCreditResponseSchema"},"paymentTerms":{"type":"integer"},"internalNote":{"type":"string"},"accountManager":{"$ref":"#/components/schemas/AccountManagerResponseSchema"},"ehfEnabled":{"type":"boolean"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerTypeENUM":{"enum":["COMPANY","PERSON","B2B"],"title":"CustomerTypeENUM","type":"string"},"EmailTYPE":{"title":"Email","type":"string"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"VatNumberTYPE":{"description":"VAT identification number for value added tax reporting purposes.","title":"VatNumber","type":"string"},"CustomerAddressResponseSchema":{"title":"CustomerAddressResponseSchema","type":"object","required":["address","city","companyName","firstname","lastname","countryCode","email","phone","postalCode","type","customerAddressUid","displayName"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"phone":{"type":"string"},"postalCode":{"type":"string"},"type":{"$ref":"#/components/schemas/CustomerAddressTypeENUM"},"customerAddressUid":{"type":"string"},"displayName":{"type":"string"}}},"CustomerAddressTypeENUM":{"enum":["DELIVERY_ADDRESS","INVOICE_ADDRESS"],"title":"CustomerAddressTypeENUM","type":"string"},"CustomerContactResponseSchema":{"title":"CustomerContactResponseSchema","type":"object","description":"CustomerContactResponseSchema","required":["firstname","lastname","email","mobile","createdAt","lastModifiedAt","customerContactUid","extensions","displayName"],"properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastModifiedAt":{"type":"string","format":"date-time"},"customerContactUid":{"type":"string"},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactExtensionResponseSchema"}},"displayName":{"type":"string"}}},"CustomerContactExtensionResponseSchema":{"description":"CustomerContactExtensionResponseSchema","title":"CustomerContactExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerExtensionCodeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| TWO_INVOICE | The Two Invoice extension.|","enum":["TWO_INVOICE"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerConsentStatusSchema":{"title":"CustomerConsentStatusSchema","type":"object","required":["consentUid","name","status","source","createdAt"],"properties":{"consentUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"status":{"type":"boolean"},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"CustomerCreditResponseSchema":{"title":"CustomerCreditResponseSchema","allOf":[{"$ref":"#/components/schemas/CustomerCreditSchema"},{"required":["limit","balance"],"properties":{"limit":{"type":"integer"},"balance":{"type":"integer"}}}],"type":"object"},"CustomerCreditSchema":{"title":"CustomerCreditSchema","type":"object","properties":{"limit":{"type":"integer","description":"Limit 0 = No limit set for customer"},"balance":{"type":"integer"}}},"AccountManagerResponseSchema":{"title":"AccountManagerResponseSchema","type":"object","required":["tenantUserUid","displayName","userCode"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"userCode":{"type":"string"}}}}},"paths":{"/tenants/{tenantUid}/customers/{customerUid}":{"get":{"description":"Get details for a customer.\n\nRequired permission: TENANT.ACCESS","operationId":"get-tenants-customers-details","responses":{"200":{"$ref":"#/components/responses/CustomerResponse"}},"summary":"Get customer details","tags":["Customer"]}}}}
```

## Update customer details

> Partial updates are allowed.  \
> Required permission: TENANT.ACCESS

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"}],"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":{"CustomerUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdateSchema"}}},"description":"B2B customer can only be updated by users having admin acces"}},"schemas":{"CustomerUpdateSchema":{"title":"CustomerUpdateSchema","type":"object","properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"description":"ISO 3166-1: 2 characters representation of country","type":"string"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"origin":{"type":"string"},"loyaltyId":{"type":"string"},"credit":{"$ref":"#/components/schemas/CustomerCreditSchema"},"paymentTerms":{"type":"integer","description":"Number of days to calculate due date on invoice"},"internalNote":{"type":"string"},"accountManager":{"$ref":"#/components/schemas/AccountManagerRequestSchema"},"ehfEnabled":{"type":"boolean"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}},"CustomerTypeENUM":{"enum":["COMPANY","PERSON","B2B"],"title":"CustomerTypeENUM","type":"string"},"EmailTYPE":{"title":"Email","type":"string"},"VatNumberTYPE":{"description":"VAT identification number for value added tax reporting purposes.","title":"VatNumber","type":"string"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"CustomerCreditSchema":{"title":"CustomerCreditSchema","type":"object","properties":{"limit":{"type":"integer","description":"Limit 0 = No limit set for customer"},"balance":{"type":"integer"}}},"AccountManagerRequestSchema":{"title":"AccountManagerRequestSchema","type":"object","required":["tenantUserUid"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","ledgerNumber","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehfEnabled","customerGroupUids"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"description":"ISO 3166-1: 2 characters representation of country","type":"string"},"createdAt":{"format":"date-time","type":"string"},"customerUid":{"$ref":"#/components/schemas/UID"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"origin":{"type":"string"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddressResponseSchema"}},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactResponseSchema"}},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerExtensionResponseSchema"}},"consents":{"type":"array","items":{"$ref":"#/components/schemas/CustomerConsentStatusSchema"}},"loyaltyId":{"type":"string"},"displayName":{"type":"string"},"credit":{"$ref":"#/components/schemas/CustomerCreditResponseSchema"},"paymentTerms":{"type":"integer"},"internalNote":{"type":"string"},"accountManager":{"$ref":"#/components/schemas/AccountManagerResponseSchema"},"ehfEnabled":{"type":"boolean"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}},"CustomerAddressResponseSchema":{"title":"CustomerAddressResponseSchema","type":"object","required":["address","city","companyName","firstname","lastname","countryCode","email","phone","postalCode","type","customerAddressUid","displayName"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"phone":{"type":"string"},"postalCode":{"type":"string"},"type":{"$ref":"#/components/schemas/CustomerAddressTypeENUM"},"customerAddressUid":{"type":"string"},"displayName":{"type":"string"}}},"CustomerAddressTypeENUM":{"enum":["DELIVERY_ADDRESS","INVOICE_ADDRESS"],"title":"CustomerAddressTypeENUM","type":"string"},"CustomerContactResponseSchema":{"title":"CustomerContactResponseSchema","type":"object","description":"CustomerContactResponseSchema","required":["firstname","lastname","email","mobile","createdAt","lastModifiedAt","customerContactUid","extensions","displayName"],"properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastModifiedAt":{"type":"string","format":"date-time"},"customerContactUid":{"type":"string"},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactExtensionResponseSchema"}},"displayName":{"type":"string"}}},"CustomerContactExtensionResponseSchema":{"description":"CustomerContactExtensionResponseSchema","title":"CustomerContactExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerExtensionCodeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| TWO_INVOICE | The Two Invoice extension.|","enum":["TWO_INVOICE"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerConsentStatusSchema":{"title":"CustomerConsentStatusSchema","type":"object","required":["consentUid","name","status","source","createdAt"],"properties":{"consentUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"status":{"type":"boolean"},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"CustomerCreditResponseSchema":{"title":"CustomerCreditResponseSchema","allOf":[{"$ref":"#/components/schemas/CustomerCreditSchema"},{"required":["limit","balance"],"properties":{"limit":{"type":"integer"},"balance":{"type":"integer"}}}],"type":"object"},"AccountManagerResponseSchema":{"title":"AccountManagerResponseSchema","type":"object","required":["tenantUserUid","displayName","userCode"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"userCode":{"type":"string"}}}},"responses":{"CustomerResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponseSchema"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/customers/{customerUid}":{"put":{"description":"Partial updates are allowed.  \nRequired permission: TENANT.ACCESS","operationId":"put-tenants-customers-details","requestBody":{"$ref":"#/components/requestBodies/CustomerUpdateRequest"},"responses":{"200":{"$ref":"#/components/responses/CustomerResponse"}},"summary":"Update customer details","tags":["Customer"]}}}}
```

## Delete a customer

> Deletes a customer.\
> \
> Required permission: TENANT.BACKOFFICE

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"}],"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"}}},"paths":{"/tenants/{tenantUid}/customers/{customerUid}":{"delete":{"description":"Deletes a customer.\n\nRequired permission: TENANT.BACKOFFICE","operationId":"delete-tenants-customers-details","responses":{"204":{"description":"No Content"}},"summary":"Delete a customer","tags":["Customer"]}}}}
```

## Add an extension to a customer

> Add an extension to a customer

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"}],"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":{"CustomerResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponseSchema"}}},"description":"Example response"}},"schemas":{"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","ledgerNumber","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehfEnabled","customerGroupUids"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"description":"ISO 3166-1: 2 characters representation of country","type":"string"},"createdAt":{"format":"date-time","type":"string"},"customerUid":{"$ref":"#/components/schemas/UID"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"origin":{"type":"string"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddressResponseSchema"}},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactResponseSchema"}},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerExtensionResponseSchema"}},"consents":{"type":"array","items":{"$ref":"#/components/schemas/CustomerConsentStatusSchema"}},"loyaltyId":{"type":"string"},"displayName":{"type":"string"},"credit":{"$ref":"#/components/schemas/CustomerCreditResponseSchema"},"paymentTerms":{"type":"integer"},"internalNote":{"type":"string"},"accountManager":{"$ref":"#/components/schemas/AccountManagerResponseSchema"},"ehfEnabled":{"type":"boolean"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerTypeENUM":{"enum":["COMPANY","PERSON","B2B"],"title":"CustomerTypeENUM","type":"string"},"EmailTYPE":{"title":"Email","type":"string"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"VatNumberTYPE":{"description":"VAT identification number for value added tax reporting purposes.","title":"VatNumber","type":"string"},"CustomerAddressResponseSchema":{"title":"CustomerAddressResponseSchema","type":"object","required":["address","city","companyName","firstname","lastname","countryCode","email","phone","postalCode","type","customerAddressUid","displayName"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"phone":{"type":"string"},"postalCode":{"type":"string"},"type":{"$ref":"#/components/schemas/CustomerAddressTypeENUM"},"customerAddressUid":{"type":"string"},"displayName":{"type":"string"}}},"CustomerAddressTypeENUM":{"enum":["DELIVERY_ADDRESS","INVOICE_ADDRESS"],"title":"CustomerAddressTypeENUM","type":"string"},"CustomerContactResponseSchema":{"title":"CustomerContactResponseSchema","type":"object","description":"CustomerContactResponseSchema","required":["firstname","lastname","email","mobile","createdAt","lastModifiedAt","customerContactUid","extensions","displayName"],"properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastModifiedAt":{"type":"string","format":"date-time"},"customerContactUid":{"type":"string"},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactExtensionResponseSchema"}},"displayName":{"type":"string"}}},"CustomerContactExtensionResponseSchema":{"description":"CustomerContactExtensionResponseSchema","title":"CustomerContactExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerExtensionCodeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| TWO_INVOICE | The Two Invoice extension.|","enum":["TWO_INVOICE"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerConsentStatusSchema":{"title":"CustomerConsentStatusSchema","type":"object","required":["consentUid","name","status","source","createdAt"],"properties":{"consentUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"status":{"type":"boolean"},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"CustomerCreditResponseSchema":{"title":"CustomerCreditResponseSchema","allOf":[{"$ref":"#/components/schemas/CustomerCreditSchema"},{"required":["limit","balance"],"properties":{"limit":{"type":"integer"},"balance":{"type":"integer"}}}],"type":"object"},"CustomerCreditSchema":{"title":"CustomerCreditSchema","type":"object","properties":{"limit":{"type":"integer","description":"Limit 0 = No limit set for customer"},"balance":{"type":"integer"}}},"AccountManagerResponseSchema":{"title":"AccountManagerResponseSchema","type":"object","required":["tenantUserUid","displayName","userCode"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"userCode":{"type":"string"}}},"CustomerExtensionRequestSchema":{"title":"CustomerExtensionRequestSchema","type":"object","properties":{"storeUid":{"$ref":"#/components/schemas/UID"}},"required":["storeUid"]}},"requestBodies":{"CustomerExtensionRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerExtensionRequestSchema"}}},"description":"CustomerExtensionRequest"}}},"paths":{"/tenants/{tenantUid}/customers/{customerUid}/extensions/{customerExtensionCode}":{"post":{"summary":"Add an extension to a customer","operationId":"post-tenant-customer-extensions","responses":{"200":{"$ref":"#/components/responses/CustomerResponse"}},"description":"Add an extension to a customer","requestBody":{"$ref":"#/components/requestBodies/CustomerExtensionRequest"},"tags":["Customer"]}}}}
```

## Delete an extension to a customer

> Delete an extension to a customer

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"}],"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":{"CustomerExtensionRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerExtensionRequestSchema"}}},"description":"CustomerExtensionRequest"}},"schemas":{"CustomerExtensionRequestSchema":{"title":"CustomerExtensionRequestSchema","type":"object","properties":{"storeUid":{"$ref":"#/components/schemas/UID"}},"required":["storeUid"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"}}},"paths":{"/tenants/{tenantUid}/customers/{customerUid}/extensions/{customerExtensionCode}":{"delete":{"summary":"Delete an extension to a customer","operationId":"delete-tenant-customer-extensions","responses":{"204":{"description":"No Content"}},"description":"Delete an extension to a customer","tags":["Customer"],"requestBody":{"$ref":"#/components/requestBodies/CustomerExtensionRequest"}}}}}
```

## Get customer details for a store

> Return a complete customer with store specific details.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"}],"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":{"StoreCustomerDetailsResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreCustomerDetailsResponseSchema"}}}}},"schemas":{"StoreCustomerDetailsResponseSchema":{"title":"StoreCustomerDetailsResponseSchema","type":"object","description":"StoreCustomerDetailsResponseSchema","required":["customer","credit"],"properties":{"customer":{"$ref":"#/components/schemas/CustomerResponseSchema"},"credit":{"$ref":"#/components/schemas/CustomerCreditLimitSchema"}}},"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","ledgerNumber","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehfEnabled","customerGroupUids"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"description":"ISO 3166-1: 2 characters representation of country","type":"string"},"createdAt":{"format":"date-time","type":"string"},"customerUid":{"$ref":"#/components/schemas/UID"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"externalId":{"type":"string"},"firstname":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastname":{"type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"origin":{"type":"string"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddressResponseSchema"}},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactResponseSchema"}},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerExtensionResponseSchema"}},"consents":{"type":"array","items":{"$ref":"#/components/schemas/CustomerConsentStatusSchema"}},"loyaltyId":{"type":"string"},"displayName":{"type":"string"},"credit":{"$ref":"#/components/schemas/CustomerCreditResponseSchema"},"paymentTerms":{"type":"integer"},"internalNote":{"type":"string"},"accountManager":{"$ref":"#/components/schemas/AccountManagerResponseSchema"},"ehfEnabled":{"type":"boolean"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerTypeENUM":{"enum":["COMPANY","PERSON","B2B"],"title":"CustomerTypeENUM","type":"string"},"EmailTYPE":{"title":"Email","type":"string"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"VatNumberTYPE":{"description":"VAT identification number for value added tax reporting purposes.","title":"VatNumber","type":"string"},"CustomerAddressResponseSchema":{"title":"CustomerAddressResponseSchema","type":"object","required":["address","city","companyName","firstname","lastname","countryCode","email","phone","postalCode","type","customerAddressUid","displayName"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"phone":{"type":"string"},"postalCode":{"type":"string"},"type":{"$ref":"#/components/schemas/CustomerAddressTypeENUM"},"customerAddressUid":{"type":"string"},"displayName":{"type":"string"}}},"CustomerAddressTypeENUM":{"enum":["DELIVERY_ADDRESS","INVOICE_ADDRESS"],"title":"CustomerAddressTypeENUM","type":"string"},"CustomerContactResponseSchema":{"title":"CustomerContactResponseSchema","type":"object","description":"CustomerContactResponseSchema","required":["firstname","lastname","email","mobile","createdAt","lastModifiedAt","customerContactUid","extensions","displayName"],"properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastModifiedAt":{"type":"string","format":"date-time"},"customerContactUid":{"type":"string"},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/CustomerContactExtensionResponseSchema"}},"displayName":{"type":"string"}}},"CustomerContactExtensionResponseSchema":{"description":"CustomerContactExtensionResponseSchema","title":"CustomerContactExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerExtensionCodeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| TWO_INVOICE | The Two Invoice extension.|","enum":["TWO_INVOICE"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/UID"}},"required":["extensionCode","organizationUid"]},"CustomerConsentStatusSchema":{"title":"CustomerConsentStatusSchema","type":"object","required":["consentUid","name","status","source","createdAt"],"properties":{"consentUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"status":{"type":"boolean"},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"CustomerCreditResponseSchema":{"title":"CustomerCreditResponseSchema","allOf":[{"$ref":"#/components/schemas/CustomerCreditSchema"},{"required":["limit","balance"],"properties":{"limit":{"type":"integer"},"balance":{"type":"integer"}}}],"type":"object"},"CustomerCreditSchema":{"title":"CustomerCreditSchema","type":"object","properties":{"limit":{"type":"integer","description":"Limit 0 = No limit set for customer"},"balance":{"type":"integer"}}},"AccountManagerResponseSchema":{"title":"AccountManagerResponseSchema","type":"object","required":["tenantUserUid","displayName","userCode"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"displayName":{"type":"string"},"userCode":{"type":"string"}}},"CustomerCreditLimitSchema":{"title":"CustomerCreditLimitSchema","type":"object","required":["approved","limit","balance","remaining","maxSingleOrderValue","declineReason"],"properties":{"approved":{"type":"boolean","description":"true if credit for customer is granted"},"limit":{"type":"integer","description":"Granted credit limit"},"balance":{"type":"integer","description":"Credit balance. Current total amount of unpaid invoices"},"remaining":{"type":"integer","description":"Remaining amount of granted credit"},"maxSingleOrderValue":{"type":"integer","description":"Maximum amount for a single order"},"declineReason":{"type":"string","description":"Reason why credit is declined"}}}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/customers/{customerUid}":{"get":{"summary":"Get customer details for a store","tags":["Customer"],"responses":{"200":{"$ref":"#/components/responses/StoreCustomerDetailsResponse"}},"operationId":"get-store-customer-details","description":"Return a complete customer with store specific details."}}}}
```


---

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