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

# Customer

Customer

## List customers

> List all customers.

```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":"Access token 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","customerParentUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehf","customerGroupUids","defaultStore","relevance"],"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"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"},"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":{"type":"string","deprecated":true,"description":"Deprecated. Use ledgerNumber in accountingConfigs instead"},"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","description":"Deprecated: Use ehf -> enabled instead"},"ehf":{"$ref":"#/components/schemas/CustomerEhfResponseSchema"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"defaultStore":{"$ref":"#/components/schemas/CustomerStoreResponseSchema"},"relevance":{"type":"number"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"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"},"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","role"],"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"},"role":{"$ref":"#/components/schemas/CustomerContactRoleENUM"}}},"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.|\n| KLAVIYO_PROFILE_ID | Klaviyo profile ID |","enum":["TWO_INVOICE","KLAVIYO_PROFILE_ID"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerContactRoleENUM":{"title":"CustomerContactRoleENUM","type":"string","enum":["ADMIN","PURCHASER","ACCOUNTING","NONE"]},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","required":["extensionCode","organizationUid"],"properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/OptionalUID"}}},"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","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"}}},"CustomerEhfResponseSchema":{"title":"CustomerEhfResponseSchema","type":"object","required":["enabled","address"],"properties":{"enabled":{"type":"boolean","description":"EHF is enabled for this customer"},"address":{"type":"string","description":"EHF address"}}},"CustomerStoreResponseSchema":{"title":"CustomerStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"}}},"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.","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

> Create a new 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":"Access token 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"}}}}},"schemas":{"CustomerCreateSchema":{"title":"CustomerCreateSchema","allOf":[{"$ref":"#/components/schemas/CustomerUpdateSchema"},{"type":"object","required":["customerType"],"properties":{"customerUid":{"$ref":"#/components/schemas/UID"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"consents":{"type":"array","items":{"$ref":"#/components/schemas/CustomerCreateConsentSchema"}}}}]},"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","deprecated":true,"description":"This field is deprecated. Use ehf -> enabled instead"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"ehf":{"$ref":"#/components/schemas/CustomerEhfSchema"},"defaultStoreUid":{"$ref":"#/components/schemas/UID"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"}}},"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"}}},"AccountManagerRequestSchema":{"title":"AccountManagerRequestSchema","type":"object","required":["tenantUserUid"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerEhfSchema":{"title":"CustomerEhfSchema","type":"object","properties":{"enabled":{"type":"boolean","description":"Enable EHF for this customer"},"address":{"type":"string","description":"The EHF address"}}},"CustomerCreateConsentSchema":{"title":"CustomerCreateConsentSchema","allOf":[{"$ref":"#/components/schemas/CustomerConsentChangeSchema"},{"type":"object","required":["consentUid"],"properties":{"consentUid":{"$ref":"#/components/schemas/UID"}}}]},"CustomerConsentChangeSchema":{"title":"CustomerConsentChangeSchema","type":"object","required":["source","status"],"properties":{"source":{"type":"string"},"status":{"type":"boolean","description":"Is the consent active or withdrawn"}}},"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerParentUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehf","customerGroupUids","defaultStore","relevance"],"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"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"},"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":{"type":"string","deprecated":true,"description":"Deprecated. Use ledgerNumber in accountingConfigs instead"},"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","description":"Deprecated: Use ehf -> enabled instead"},"ehf":{"$ref":"#/components/schemas/CustomerEhfResponseSchema"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"defaultStore":{"$ref":"#/components/schemas/CustomerStoreResponseSchema"},"relevance":{"type":"number"}}},"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","role"],"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"},"role":{"$ref":"#/components/schemas/CustomerContactRoleENUM"}}},"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.|\n| KLAVIYO_PROFILE_ID | Klaviyo profile ID |","enum":["TWO_INVOICE","KLAVIYO_PROFILE_ID"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerContactRoleENUM":{"title":"CustomerContactRoleENUM","type":"string","enum":["ADMIN","PURCHASER","ACCOUNTING","NONE"]},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","required":["extensionCode","organizationUid"],"properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/OptionalUID"}}},"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","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"}}},"CustomerEhfResponseSchema":{"title":"CustomerEhfResponseSchema","type":"object","required":["enabled","address"],"properties":{"enabled":{"type":"boolean","description":"EHF is enabled for this customer"},"address":{"type":"string","description":"EHF address"}}},"CustomerStoreResponseSchema":{"title":"CustomerStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"}}}},"responses":{"CustomerResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponseSchema"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/customers":{"post":{"description":"Create a new customer","operationId":"post-tenants-customers","requestBody":{"$ref":"#/components/requestBodies/CustomerCreateRequest"},"responses":{"201":{"$ref":"#/components/responses/CustomerResponse"}},"summary":"Create a new customer","tags":["Customer"]}}}}
```

## Search customers

> The \`query\` field searches on: firstName, lastName, city, postalCode, companyName, mobile, email and vatNumber.  \
> If \`scope\` is not set, customer scope is used. \
> When mobile, email or vatNumber is specified, the according field is not searched by the query field value.

```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":"Access token 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"}},"customerTypes":{"type":"array","items":{"$ref":"#/components/schemas/CustomerTypeENUM"}},"vatNumber":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"customerParentUid":{"$ref":"#/components/schemas/UID"},"createdAt":{"format":"date-time","type":"string"}}},"CustomerSearchScopeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CUSTOMER | Search for customers|\n| CONTACT | Search for customer contacts|","enum":["CUSTOMER","CONTACT"],"title":"CustomerSearchScope","type":"string"},"CustomerTypeENUM":{"enum":["COMPANY","PERSON","B2B"],"title":"CustomerTypeENUM","type":"string"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerParentUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehf","customerGroupUids","defaultStore","relevance"],"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"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"},"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":{"type":"string","deprecated":true,"description":"Deprecated. Use ledgerNumber in accountingConfigs instead"},"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","description":"Deprecated: Use ehf -> enabled instead"},"ehf":{"$ref":"#/components/schemas/CustomerEhfResponseSchema"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"defaultStore":{"$ref":"#/components/schemas/CustomerStoreResponseSchema"},"relevance":{"type":"number"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"EmailTYPE":{"title":"Email","type":"string"},"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","role"],"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"},"role":{"$ref":"#/components/schemas/CustomerContactRoleENUM"}}},"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.|\n| KLAVIYO_PROFILE_ID | Klaviyo profile ID |","enum":["TWO_INVOICE","KLAVIYO_PROFILE_ID"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerContactRoleENUM":{"title":"CustomerContactRoleENUM","type":"string","enum":["ADMIN","PURCHASER","ACCOUNTING","NONE"]},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","required":["extensionCode","organizationUid"],"properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/OptionalUID"}}},"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","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"}}},"CustomerEhfResponseSchema":{"title":"CustomerEhfResponseSchema","type":"object","required":["enabled","address"],"properties":{"enabled":{"type":"boolean","description":"EHF is enabled for this customer"},"address":{"type":"string","description":"EHF address"}}},"CustomerStoreResponseSchema":{"title":"CustomerStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"}}},"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":"The `query` field searches on: firstName, lastName, city, postalCode, companyName, mobile, email and vatNumber.  \nIf `scope` is not set, customer scope is used. \nWhen mobile, email or vatNumber is specified, the according field is not searched by the query field value.","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

> External search for customers

```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":"Access token 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":"External search for customers","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"]}}}}
```

## Export customer data in structured form. JSON is the only available format now

> Intended for GDPR Compliance  \\\
> Export customer data in structured form.  \\\
> JSON is the only available format now \\

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Customer","description":"Customer"},{"name":"GDPR","description":"GDPR"}],"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":"Access token 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":{"CustomerExportResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerExportResponseSchema"}},"application/xml":{"schema":{"type":"object","properties":{}}}},"description":"Example response"}},"schemas":{"CustomerExportResponseSchema":{"title":"CustomerExportResponseSchema","type":"object","description":"Customer information with associated orders and services","required":["customer","orders","services"],"properties":{"customer":{"$ref":"#/components/schemas/CustomerResponseSchema"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/OrderResponseSchema"}},"services":{"type":"array","items":{"$ref":"#/components/schemas/ServiceOrderResponseSchema"}}}},"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerParentUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehf","customerGroupUids","defaultStore","relevance"],"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"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"},"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":{"type":"string","deprecated":true,"description":"Deprecated. Use ledgerNumber in accountingConfigs instead"},"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","description":"Deprecated: Use ehf -> enabled instead"},"ehf":{"$ref":"#/components/schemas/CustomerEhfResponseSchema"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"defaultStore":{"$ref":"#/components/schemas/CustomerStoreResponseSchema"},"relevance":{"type":"number"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"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"},"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","role"],"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"},"role":{"$ref":"#/components/schemas/CustomerContactRoleENUM"}}},"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.|\n| KLAVIYO_PROFILE_ID | Klaviyo profile ID |","enum":["TWO_INVOICE","KLAVIYO_PROFILE_ID"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerContactRoleENUM":{"title":"CustomerContactRoleENUM","type":"string","enum":["ADMIN","PURCHASER","ACCOUNTING","NONE"]},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","required":["extensionCode","organizationUid"],"properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/OptionalUID"}}},"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","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"}}},"CustomerEhfResponseSchema":{"title":"CustomerEhfResponseSchema","type":"object","required":["enabled","address"],"properties":{"enabled":{"type":"boolean","description":"EHF is enabled for this customer"},"address":{"type":"string","description":"EHF address"}}},"CustomerStoreResponseSchema":{"title":"CustomerStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"}}},"OrderResponseSchema":{"description":"Use invoiceAddress only if an order has a different invoice  than orderAddress.","title":"OrderResponseSchema","type":"object","required":["createdAt","customerAddress","customerUid","customerContact","deliveryState","externalOrderNumber","externalVoucherNumber","invoiceAddress","items","lastModifiedAt","note","internalNote","orderUid","orderNumber","orderDate","orderState","orderTotals","orderhandlingState","orderhandlings","settleState","settlementTotals","settlements","storeUid","storeName","systemOrigin","tenantUserDisplayName","tenantUserUid","tillUid","type","vatFree","vatPrint","voucherNumber","deliveryDate","discounts","compensationReasonUid","lastModifiedBy","allowedActions"],"properties":{"createdAt":{"format":"date-time","type":"string"},"customerAddress":{"$ref":"#/components/schemas/OrderAddressResponseSchema"},"customerUid":{"$ref":"#/components/schemas/OptionalUID"},"customerContact":{"$ref":"#/components/schemas/OrderCustomerContactResponseSchema"},"deliveryState":{"$ref":"#/components/schemas/OrderDeliveryStateENUM"},"externalOrderNumber":{"type":"string"},"externalVoucherNumber":{"type":"string"},"invoiceAddress":{"$ref":"#/components/schemas/InvoiceAddressResponseSchema"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemResponseSchema"}},"lastModifiedAt":{"format":"date-time","type":"string"},"note":{"description":"Note visible on the receipt.","type":"string"},"internalNote":{"type":"string","description":"Internal note, not visible on the receipt."},"orderUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"orderDate":{"type":"string","format":"date-time","description":"This field has value if type == `ORDER`","nullable":true},"orderState":{"$ref":"#/components/schemas/OrderOrderStateENUM"},"orderTotals":{"$ref":"#/components/schemas/OrderTotalsResponseSchema"},"orderhandlingState":{"$ref":"#/components/schemas/HandlingStateENUM"},"orderhandlings":{"type":"array","items":{"$ref":"#/components/schemas/OrderHandlingResponseSchema"}},"settleState":{"$ref":"#/components/schemas/OrderSettleStateENUM"},"settledAt":{"description":"When the settleState is set COMPLETE.","format":"date-time","type":"string","nullable":true},"settlementTotals":{"$ref":"#/components/schemas/OrderSettlementTotalsSchema"},"settlements":{"type":"array","items":{"$ref":"#/components/schemas/SettlementResponseSchema"}},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"systemOrigin":{"type":"string"},"tenantUserDisplayName":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"tillUid":{"$ref":"#/components/schemas/OptionalUID"},"type":{"$ref":"#/components/schemas/OrderTypeENUM"},"validUntil":{"format":"date-time","type":"string","nullable":true},"vatFree":{"type":"boolean"},"vatPrint":{"$ref":"#/components/schemas/VatPrintENUM"},"voucherNumber":{"description":"A reference to a fully settled order.","type":"string"},"deliveryDate":{"type":"string","format":"date"},"discounts":{"type":"array","items":{"$ref":"#/components/schemas/OrderDiscountResponseSchema"}},"compensationReasonUid":{"$ref":"#/components/schemas/OptionalUID"},"lastModifiedBy":{"type":"string"},"allowedActions":{"type":"array","items":{"$ref":"#/components/schemas/AllowedOrderActionENUM"}}}},"OrderAddressResponseSchema":{"title":"OrderAddressResponseSchema","type":"object","required":["address","city","companyName","countryCode","email","firstname","lastname","mobile","postalCode","displayName"],"properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"firstname":{"type":"string"},"lastname":{"type":"string"},"mobile":{"type":"string"},"postalCode":{"type":"string"},"vatNumber":{"$ref":"#/components/schemas/VatNumberTYPE"},"displayName":{"type":"string"}},"description":""},"OrderCustomerContactResponseSchema":{"type":"object","title":"OrderCustomerContactResponseSchema","required":["customerContactUid","firstname","lastname","email","mobile","displayName"],"properties":{"customerContactUid":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"displayName":{"type":"string"}}},"OrderDeliveryStateENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NOT_STARTED | Delivery not started|\n| IN_PROGRESS | Delivery is in progress. Some order lines are still reserved|\n| COMPLETE | Delivery is complete. All order lines are delivered|","enum":["NOT_STARTED","IN_PROGRESS","COMPLETE"],"title":"OrderDeliveryStateENUM","type":"string"},"InvoiceAddressResponseSchema":{"title":"InvoiceAddressResponseSchema","allOf":[{"$ref":"#/components/schemas/BaseAddressSchema"},{"required":["displayName","customerAddressUid","address","city","companyName","countryCode","email","mobile","firstname","lastname","postalCode"],"properties":{"displayName":{"type":"string"},"customerAddressUid":{"$ref":"#/components/schemas/OptionalUID"}}}],"type":"object"},"BaseAddressSchema":{"title":"BaseAddressSchema","type":"object","properties":{"address":{"type":"string"},"city":{"type":"string"},"companyName":{"type":"string"},"countryCode":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"postalCode":{"type":"string"}}},"OrderItemResponseSchema":{"title":"OrderItemResponseSchema","type":"object","required":["actions","allowedActions","createdAt","discountReasonCode","externalId","itemCost","itemDiscountAmount","itemDiscountPercentage","itemGrossProfitAmount","itemGrossProfitPercentage","itemPrice","itemVatAmount","lastModifiedAt","ledgerNumber","name","note","orderItemUid","originalItemPrice","productUid","productType","properties","quantityCredited","quantityDelivered","quantityOrdered","quantityReserved","returnReasonCode","serialnumber","sku","sortOrder","tenantUserDisplayName","tenantUserUid","totalCost","totalDiscountAmount","totalGrossProfitAmount","totalPrice","totalVatAmount","vatCodeUid","warehouseUid","warehouseName","internalInfo","productProperties","coverImage","deliveryUid","compensationReasonCode","orderReceiptUid","allowDelivery","allowDeliveryFromDate","reservationType","reservationDetails","gtins"],"properties":{"actions":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemActionResponseSchema"}},"allowedActions":{"description":"Indicate what fields are allowed to change or what action is allowed on an orderline","type":"array","items":{"$ref":"#/components/schemas/AllowedActionENUM"}},"createdAt":{"format":"date-time","type":"string"},"discountReasonCode":{"type":"string"},"externalId":{"type":"string"},"itemCost":{"description":"Item cost for a single product.","type":"integer"},"itemDiscountAmount":{"description":"Discount amount for a single product.","type":"integer"},"itemDiscountPercentage":{"type":"integer"},"itemGrossProfitAmount":{"description":"Profit amount for a single product.","type":"integer"},"itemGrossProfitPercentage":{"description":"Profit for a single product in percentage.","type":"integer"},"itemPrice":{"type":"integer"},"itemVatAmount":{"description":"Vat amount for a single product.","type":"integer"},"lastModifiedAt":{"format":"date-time","type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"name":{"type":"string"},"note":{"type":"string"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderLinks":{"description":"List of references on the order product item.\nTypically a list of credit operations.","type":"array","items":{"$ref":"#/components/schemas/OrderLinkTypeSchema"}},"originalItemPrice":{"type":"integer"},"productUid":{"$ref":"#/components/schemas/UID"},"productType":{"$ref":"#/components/schemas/ProductTypeENUM"},"properties":{"type":"array","items":{"$ref":"#/components/schemas/OrderProductLinePropertyResponseSchema"}},"quantityCredited":{"type":"integer"},"quantityDelivered":{"type":"integer"},"quantityOrdered":{"type":"integer"},"quantityReserved":{"type":"integer"},"returnReasonCode":{"type":"string"},"serialnumber":{"type":"string"},"sku":{"type":"string"},"sortOrder":{"type":"integer"},"tenantUserDisplayName":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"totalCost":{"description":"Total cost for all products on this OrderItem.","type":"integer"},"totalDiscountAmount":{"description":"Discount amount for all products on this OrderItem.","type":"integer"},"totalGrossProfitAmount":{"description":"Profit amount for all products on this OrderItem.","type":"integer"},"totalPrice":{"description":"Total price for all products on this OrderItem.","type":"integer"},"totalVatAmount":{"description":"Vat amount for all products on this OrderItem.","type":"integer"},"vatCodeUid":{"$ref":"#/components/schemas/UID"},"warehouseUid":{"$ref":"#/components/schemas/OptionalUID"},"warehouseName":{"type":"string"},"internalInfo":{"type":"string"},"productProperties":{"type":"array","items":{"$ref":"#/components/schemas/ProductPropertyResponseSchema"}},"coverImage":{"$ref":"#/components/schemas/CoverImageSchema"},"deliveryUid":{"$ref":"#/components/schemas/OptionalUID"},"compensationReasonCode":{"type":"string"},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"},"allowDelivery":{"$ref":"#/components/schemas/AllowDeliveryENUM"},"allowDeliveryFromDate":{"type":"string","format":"date-time","description":"When allowDelivery is `NOT_BEFORE_DATE` this field will contain the time for when the product is allowed to be delivered from.","nullable":true},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"},"reservationDetails":{"$ref":"#/components/schemas/SalesReservationDetailsSchema"},"gtins":{"type":"array","items":{"$ref":"#/components/schemas/ProductGtinSchema"}}}},"OrderItemActionResponseSchema":{"properties":{"comment":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"handlingActionUid":{"$ref":"#/components/schemas/UID"},"handlingActionName":{"type":"string"},"handlingDescription":{"type":"string"},"handlingUid":{"$ref":"#/components/schemas/UID"},"handlingName":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"orderHandlingActionUid":{"$ref":"#/components/schemas/UID"}},"required":["orderHandlingActionUid","handlingUid","handlingName","handlingActionUid","handlingActionName","comment","handlingDescription","createdAt","createdBy","lastModifiedAt","lastModifiedBy"],"title":"OrderItemActionResponseSchema","type":"object"},"AllowedActionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| QUANTITY_SOLD | Can change quantity on order item|\n| PRICE_SALE | Can change price on order item|\n| DISCOUNT | Can set discount on order item|\n| SERIALNUMBER | Can set serial number on order item|\n| SERIALNUMBER_REQUIRED | MUST set serial number on order item|\n| CREDIT | Order item can be credited|\n| ADDON | Product on order item has addons|\n| CUSTOMER_REQUIRED | Order item requires customer on settlement|\n| CUSTOMER_MOBILE_REQUIRED | Order item requires customer mobile number on settlement|\n| CUSTOMER_EMAIL_REQUIRED  - Order item requires customer email on settlement|\n| DELIVERY_POSTAL_ADDRESS_REQUIRED | Order item requires delivery address on settlement|\n| INSURANCE | Order item can be insured|\n| DELETE | Order item can be deleted|   \n| DELIVER | Order item can be delivered|\n| PURCHASE | Order item can be marked as purchase from supplier |\n| COST_PRICE | Set cost price on the orderItem |\n| PRODUCT_NAME | Set name of the product on the orderItem |\n| PAYABLE | order item is payable |\n| NEGATIVE_PRICE| Can have negative price |","enum":["QUANTITY_SOLD","PRICE_SALE","DISCOUNT","SERIALNUMBER","SERIALNUMBER_REQUIRED","CREDIT","ADDON","CUSTOMER_REQUIRED","INSURANCE","CUSTOMER_MOBILE_REQUIRED","CUSTOMER_EMAIL_REQUIRED","DELIVERY_POSTAL_ADDRESS_REQUIRED","DELETE","DELIVER","PURCHASE","COST_PRICE","PRODUCT_NAME","PAYABLE","NEGATIVE_PRICE"],"title":"AllowedActionENUM","type":"string"},"OrderLinkTypeSchema":{"description":"Order reference for an order product item","properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"description":"Order number for the order","type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/OrderLinkTypeResponseENUM"}},"required":["storeUid","orderUid","orderNumber","orderItemUid","type"],"title":"OrderLinkTypeSchema","type":"object"},"OrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| CREDIT | Reference is a credit link|\n| INSURANCE | Reference to orderline with product to insure|\n| INSURED | Reference to orderline with insurance |\n| COMPENSATION | Reference to orderline with product to compensate|\n| COMPENSATED | Reference to orderline with compensation |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n| SERVICE | Reference to orderline that is a service product |\n| HAS_SERVICE | Reference to orderline that points to a service product |\n| FREIGHT_SERVICE | Reference to orderline that is a freight service product |\n| HAS_FREIGHT_SERVICE | Reference to orderline that points to a freight service product |\n| AUTO_ADD | Reference to orderline that has been automatically added |\n","enum":["CREDIT","INSURANCE","INSURED","COMPENSATION","COMPENSATED","PACKAGE","PACKAGE_COMPONENT","SERVICE","HAS_SERVICE","FREIGHT_SERVICE","HAS_FREIGHT_SERVICE","AUTO_ADD"],"title":"OrderLinkTypeResponseENUM","type":"string"},"ProductTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| STOCK | Price*quantity|\n| NO_STOCK | No quantity|\n| CONFIGURABLE | Master configurable product|\n| FLOWGIFTCARD | Flow Giftcard product|\n| PAYEX_GIFTCARD | Payex Giftcard product|\n| NON_PHYSICAL | Non physical product|\n| PACKAGE_FIXED | Packaged product with fixed content|\n| PACKAGE_DYNAMIC | Packaged product with dynamic content|","enum":["STOCK","NO_STOCK","CONFIGURABLE","FLOWGIFTCARD","PAYEX_GIFTCARD","NON_PHYSICAL","PACKAGE_FIXED","PACKAGE_DYNAMIC"],"minLength":1,"title":"ProductTypeENUM","type":"string"},"OrderProductLinePropertyResponseSchema":{"allOf":[{"properties":{"uid":{"$ref":"#/components/schemas/UID"}},"required":["uid"],"type":"object"},{"$ref":"#/components/schemas/OrderProductLinePropertySchema"}],"title":"OrderProductLinePropertyResponseSchema"},"OrderProductLinePropertySchema":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"title":"OrderProductLinePropertySchema","type":"object"},"ProductPropertyResponseSchema":{"title":"ProductPropertyResponseSchema","type":"object","required":["productPropertyUid","propertyName","propertyOptionName","propertyType","propertyUid","propertyOptionUid","required"],"properties":{"productPropertyUid":{"$ref":"#/components/schemas/UID"},"propertyName":{"type":"string"},"propertyOptionName":{"type":"string"},"propertyType":{"$ref":"#/components/schemas/PropertyTypeENUM"},"propertyText":{"type":"string","description":"Only in use with TEXT properties."},"propertyUid":{"$ref":"#/components/schemas/UID"},"propertyOptionUid":{"$ref":"#/components/schemas/UID"},"required":{"type":"boolean"}}},"PropertyTypeENUM":{"description":"Describes the type of property a product can have.\n\n|ENUM      | Description |\n| ---------------- | ------------ |\n| TEXT | A single text line such as an URL to a product manual or a reminder to the cashier/salesperson.|\n| SINGLESELECT | A list of values where a product can only have one at any given time.|\n| MULTISELECT | A list of values where a product can have none or several at any given time.|","enum":["TEXT","SINGLESELECT","MULTISELECT"],"title":"PropertyTypeENUM","type":"string"},"CoverImageSchema":{"title":"CoverImageSchema","type":"object","properties":{"productMediaUid":{"$ref":"#/components/schemas/UID"},"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"}},"required":["productMediaUid","mainUrl","thumbnailUrl"]},"AllowDeliveryENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| YES | Allow the product to be delivered|\n| NO | Do not allow the product to be delivered|\n| NOT_BEFORE_DATE | Do not allow the product to be delivered before a specified date|","enum":["YES","NO","NOT_BEFORE_DATE"],"title":"AllowDeliveryENUM","type":"string"},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"SalesReservationDetailsSchema":{"title":"SalesReservationDetailsSchema","type":"object","properties":{"warehouse":{"$ref":"#/components/schemas/SalesReservationWarehouseSchema"},"purchaseOrder":{"$ref":"#/components/schemas/SalesReservationPurchaseOrderSchema"},"receivement":{"$ref":"#/components/schemas/SalesReservationReceivementSchema"}}},"SalesReservationWarehouseSchema":{"title":"SalesReservationWarehouseSchema","type":"object","nullable":true,"required":["warehouseName"],"properties":{"warehouseName":{"type":"string"}}},"SalesReservationPurchaseOrderSchema":{"title":"SalesReservationPurchaseOrderSchema","type":"object","nullable":true,"required":["purchaseOrderUid","purchaseOrderItemUid","purchaseOrderNumber","quantityOrdered"],"properties":{"purchaseOrderUid":{"$ref":"#/components/schemas/UID"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"expectedDeliveryDate":{"type":"string","format":"date-time"},"purchaseOrderNumber":{"type":"string"},"quantityOrdered":{"type":"integer","description":"The quantity ordered on this purchase order line."},"externalId":{"type":"string"}}},"SalesReservationReceivementSchema":{"title":"SalesReservationReceivementSchema","type":"object","required":["receivementUid","receivementItemUid","expectedArrival","quantity","supplierOrderReference","receivedAt"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"expectedArrival":{"type":"string","format":"date-time"},"expectedDispatch":{"type":"string","format":"date-time"},"quantity":{"type":"integer"},"supplierOrderReference":{"type":"string"},"receivedAt":{"type":"string","format":"date-time","nullable":true}}},"ProductGtinSchema":{"properties":{"gtin":{"type":"string"},"primary":{"type":"boolean"},"type":{"type":"string"}},"title":"ProductGtinSchema","type":"object"},"OrderOrderStateENUM":{"description":"|ENUM | Description |\n| --- | --- |\n| OPEN | Order is open and beeing edited by someone|\n| PARKED | Order is parked|\n| CANCELED | Order is canceled/deleted|\n| COMPLETE | Order is complete|\n| CONFIRMED | Order is confirmed|\n","enum":["OPEN","PARKED","CANCELED","COMPLETE","CONFIRMED"],"title":"OrderOrderStateENUM","type":"string"},"OrderTotalsResponseSchema":{"description":"","properties":{"costTotal":{"type":"integer"},"grandTotal":{"type":"integer"},"grossProfitAmount":{"description":"Sum of all totalGrossProfitAmount on each product item.","type":"integer"},"grossProfitPercentage":{"description":"","type":"integer"},"specifiedVat":{"items":{"$ref":"#/components/schemas/OrderTotalsVatSpecificationSchema"},"type":"array"},"subtotal":{"type":"integer"},"totalDiscount":{"type":"integer"},"totalVat":{"type":"integer"}},"required":["subtotal","totalDiscount","specifiedVat","totalVat","grandTotal","grossProfitAmount","grossProfitPercentage","costTotal"],"title":"OrderTotals","type":"object"},"OrderTotalsVatSpecificationSchema":{"description":"","properties":{"vatAmount":{"description":"Total amount with this vatRate.","type":"integer"},"vatDescription":{"description":"Description of vat rate.","type":"string"},"vatRate":{"description":"VatRate in percentage.","type":"integer"}},"required":["vatRate","vatAmount","vatDescription"],"title":"OrderTotalsVatSpecificationSchema","type":"object"},"HandlingStateENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NOT_STARTED | Handling has not been started. |\n| IN_PROGRESS | Handling is in progress. |\n| ON_HOLD | Handling is paused (on hold). |\n| COMPLETE | Handling is complete. |","enum":["NOT_STARTED","IN_PROGRESS","ON_HOLD","COMPLETE"],"title":"HandlingStateENUM","type":"string"},"OrderHandlingResponseSchema":{"properties":{"active":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"description":{"type":"string"},"handlingUid":{"$ref":"#/components/schemas/UID"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"name":{"maxLength":20,"type":"string"},"orderHandlingUid":{"$ref":"#/components/schemas/UID"},"state":{"$ref":"#/components/schemas/HandlingStateENUM"}},"required":["orderHandlingUid","handlingUid","active","description","name","state","createdAt","createdBy","lastModifiedAt","lastModifiedBy"],"title":"OrderHandlingResponseSchema","type":"object"},"OrderSettleStateENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NOT_STARTED | Settlement not started|\n| IN_PROGRESS | Settlement is in progress and the order cannot be changed|\n| COMPLETE | Settlement is complete|","enum":["NOT_STARTED","IN_PROGRESS","COMPLETE"],"title":"OrderSettleStateENUM","type":"string"},"OrderSettlementTotalsSchema":{"title":"OrderSettlementTotalsSchema","type":"object","required":["change","remaining","remainingRounded","totals","remainingPrePayment","remainingAuthorizedAmount"],"properties":{"change":{"description":"Total change amount returned to customer.","type":"integer"},"remaining":{"type":"integer","description":"Remaining amount to be paid "},"remainingRounded":{"description":"Rounded value of remaining amount. For use with CASH","type":"integer"},"totals":{"type":"integer","description":"Sum of all approved settlements"},"remainingPrePayment":{"type":"integer"},"remainingAuthorizedAmount":{"type":"integer","description":"Authorized amount available for capture."}}},"SettlementResponseSchema":{"title":"SettlementResponseSchema","type":"object","required":["amount","createdAt","displayMessages","externalId","externalPaymentReference","idMethod","lastModifiedAt","parameters","settlementCode","settlementUid","settlementName","state","status","storeSettlementIssuer","tenantUserDisplayName","tenantUserUid","storePaymentMethodUid","currency","additionalDetails","creditCount","creditAmount","paymentCount","paymentAmount","storeUid","storeName","orderReceiptUid","transactions","receiptText"],"properties":{"amount":{"type":"integer"},"createdAt":{"format":"date-time","type":"string"},"displayMessages":{"type":"array","items":{"$ref":"#/components/schemas/SettlementDisplayMessageSchema"}},"externalId":{"type":"string"},"externalPaymentReference":{"type":"string","description":"The external payment reference for this settlement.\nFor invoices, this could contain the KID"},"idMethod":{"$ref":"#/components/schemas/SettlementIdMethodENUM"},"lastModifiedAt":{"format":"date-time","type":"string"},"ledgerNumber":{"description":"Ledger number must be a valid number with possible leading zeros","type":"string"},"ledgerType":{"$ref":"#/components/schemas/LedgerTypeENUM"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/SettlementParameterResponseSchema"}},"settledAt":{"format":"date-time","type":"string"},"settlementCode":{"type":"string"},"settlementUid":{"$ref":"#/components/schemas/UID"},"settlementName":{"type":"string"},"state":{"$ref":"#/components/schemas/SettlementStateENUM"},"status":{"$ref":"#/components/schemas/SettlementStatusENUM"},"storeSettlementIssuer":{"$ref":"#/components/schemas/storeSettlementIssuerSchema"},"tenantUserDisplayName":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"storePaymentMethodUid":{"$ref":"#/components/schemas/UID"},"currency":{"$ref":"#/components/schemas/SettlementCurrencySchema"},"additionalDetails":{"type":"array","items":{"$ref":"#/components/schemas/SettlementAdditionalDetailsSchema"}},"creditCount":{"type":"integer","description":"Number of credits on this settlement. Only applicable for invoice"},"creditAmount":{"type":"integer","description":"The total amount credited. Only applicable for invoice"},"paymentCount":{"type":"integer","description":"Number of payments on this settlement. Only applicable for invoice"},"paymentAmount":{"type":"integer","description":"The total amount of payments. Only applicable for invoice"},"tillUid":{"$ref":"#/components/schemas/OptionalUID"},"tillName":{"type":"string","description":"Display name of the till where the payment was registered."},"tillNumber":{"type":"integer","description":"Till register number where the payment was registered."},"storeUid":{"$ref":"#/components/schemas/OptionalUID"},"storeName":{"type":"string","description":"Display name of the store where the payment was registered."},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"},"authorizedAmount":{"type":"integer","description":"The total authorized amount on this settlement, calculated from authorize transactions."},"capturedAmount":{"type":"integer","description":"The total captured amount on this settlement, calculated from capture transactions."},"refundedAmount":{"type":"integer","description":"The total refunded amount on this settlement, calculated from refund transactions."},"receiptText":{"type":"string","maxLength":500,"description":"Text printed on the receipt for this payment method when configured on the tenant payment method. Empty when not set, when suppressed for this settlement type (e.g. store credit, gift cards), or when cleared."},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/SettlementTransactionSchema"}}}},"SettlementDisplayMessageSchema":{"description":"Settlement display messages","properties":{"key":{"type":"string"},"message":{"type":"string"},"timestamp":{"format":"date-time","type":"string"}},"required":["key","message","timestamp"],"title":"SettlementDisplayMessageSchema","type":"object"},"SettlementIdMethodENUM":{"enum":["NO_CVM_RULE_PERFORMED","SIGNATURE","PIN_ONLINE","PIN_OFFLINE","PIN_ONLINE_AND_SIGNATURE","PIN_OFFLINE_AND_SIGNATURE","NO_CVM","FAILED","ON_DEVICE","REFUND"],"title":"SettlementIdMethodENUM","type":"string"},"LedgerTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n|LEDGER | Ledger |\n|GENERAL_LEDGER | General ledger |\n|CUSTOMER_LEDGER | Customer ledger |","enum":["LEDGER","GENERAL_LEDGER","CUSTOMER_LEDGER"],"title":"LedgerTypeENUM","type":"string"},"SettlementParameterResponseSchema":{"description":"settlement parameters response","title":"SettlementParameterResponseSchema","type":"object","required":["key","value","name","type"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/TenantPaymentMethodParameterTypeENUM"}}},"TenantPaymentMethodParameterTypeENUM":{"title":"TenantPaymentMethodParameterTypeENUM","type":"string","enum":["TEXT","INTEGER","NUMERIC","DATE","MOBILE","MODULUS10","MODULUS11"]},"SettlementStateENUM":{"enum":["NOT_STARTED","IN_PROGRESS","COMPLETE","TERMINATED"],"title":"SettlementCodeENUM","type":"string"},"SettlementStatusENUM":{"enum":["NEW","PROCESSING","AUTHORIZED","CAPTURED","REFUNDED","PARTIALLY_REFUNDED","PENDING_REFUND","FAILED","CANCELLED_BY_MERCHANT","CANCELLED_BY_USER","CANCELLED_FORCE","DELETED","DENIED","REJECTED"],"title":"SettlementCodeENUM","type":"string"},"storeSettlementIssuerSchema":{"title":"storeSettlementIssuerSchema","type":"object","description":"Settlement issuer information","required":["storeSettlementIssuerUid","name","code"],"properties":{"storeSettlementIssuerUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string","description":"The name of the settlement issuer"},"code":{"type":"string","description":"The code of the settlement issuer"}}},"SettlementCurrencySchema":{"title":"SettlementCurrencySchema","type":"object","required":["amount","code","exchangeRate"],"properties":{"amount":{"type":"integer"},"code":{"type":"string"},"exchangeRate":{"type":"integer"}}},"SettlementAdditionalDetailsSchema":{"title":"SettlementAdditionalDetailsSchema","type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}},"SettlementTransactionSchema":{"title":"SettlementTransactionSchema","type":"object","required":["transactionType","transactionAmount","orderReceiptUid"],"properties":{"transactionType":{"type":"string"},"pspTransactionId":{"type":"string"},"transactionAmount":{"type":"integer"},"orderReceiptUid":{"$ref":"#/components/schemas/OptionalUID"}}},"OrderTypeENUM":{"enum":["OFFER","ORDER","PAYMENT"],"title":"OrderTypeENUM","type":"string"},"VatPrintENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n|SUM| Print as a part of orderlines.|\n|SEPARATE| Print as a separate field.|\n","enum":["SUM","SEPARATE"],"title":"vatPrintENUM","type":"string"},"OrderDiscountResponseSchema":{"title":"OrderDiscountResponseSchema","type":"object","required":["orderDiscountUid","discountCode","type","amount","name","origin","validTo","maxUsage","productSkus","orderItemUids","externalTransactionId","scope","discountReasonCode","discountReference","createdAt","createdBy","lastModifiedAt","lastModifiedBy","campaignUid"],"properties":{"orderDiscountUid":{"$ref":"#/components/schemas/UID"},"discountCode":{"type":"string"},"type":{"$ref":"#/components/schemas/DiscountTypeENUM"},"amount":{"type":"integer"},"name":{"type":"string"},"origin":{"$ref":"#/components/schemas/DiscountOriginENUM"},"validTo":{"type":"string","format":"date-time"},"maxUsage":{"type":"integer"},"productSkus":{"type":"array","items":{"type":"string"}},"orderItemUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"externalTransactionId":{"type":"string"},"scope":{"$ref":"#/components/schemas/DiscountScopeENUM"},"discountReasonCode":{"type":"string"},"discountReference":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"},"campaignUid":{"$ref":"#/components/schemas/OptionalUID"}}},"DiscountTypeENUM":{"title":"DiscountTypeENUM","type":"string","enum":["PERCENTAGE","AMOUNT"]},"DiscountOriginENUM":{"title":"DiscountOriginENUM","type":"string","enum":["LOYALTY","MANUAL","PRICEREDUCTION","CAMPAIGN"]},"DiscountScopeENUM":{"title":"DiscountScopeENUM","type":"string","enum":["WHOLE_ORDER","SPECIFIC_LINE","PRODUCT_LIST","SPECIFIC_LINE_LIST"]},"AllowedOrderActionENUM":{"enum":["DELETE","OFFER","LOYALTY_POINTS"],"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| DELETE | Order can be deleted|\n| OFFER | Order can be changed to an offer|\n| LOYALTY_POINTS | Order has loyalty points|"},"ServiceOrderResponseSchema":{"title":"ServiceOrderResponseSchema","type":"object","required":["serviceOrderUid","tenantUid","storeUid","orderProductLineUid","orderUid","customerUid","createdFromStoreUid","assignedUserUid","assignedUserDisplayName","serviceTypeUid","serviceTypeName","serviceStatusUid","serviceStatusName","serviceState","title","serviceNumber","externalServiceNumber","description","locationLabel","priority","requiresPriceEstimate","estimatedPrice","maxPrice","readyAtEstimate","readyAtNeeded","publicPageHash","warranty","createdAt","createdBy","lastModifiedAt","lastModifiedBy","totals","items","assets","rmaOrderItemUid","rmaOrderUid"],"properties":{"serviceOrderUid":{"$ref":"#/components/schemas/UID"},"tenantUid":{"$ref":"#/components/schemas/UID"},"storeUid":{"$ref":"#/components/schemas/UID"},"orderProductLineUid":{"$ref":"#/components/schemas/OptionalUID"},"orderUid":{"$ref":"#/components/schemas/OptionalUID"},"customerUid":{"$ref":"#/components/schemas/OptionalUID"},"createdFromStoreUid":{"$ref":"#/components/schemas/UID"},"assignedUserUid":{"$ref":"#/components/schemas/OptionalUID"},"assignedUserDisplayName":{"type":"string"},"serviceTypeUid":{"$ref":"#/components/schemas/UID"},"serviceTypeName":{"type":"string"},"serviceStatusUid":{"$ref":"#/components/schemas/UID"},"serviceStatusName":{"type":"string"},"serviceState":{"$ref":"#/components/schemas/ServiceStateENUM"},"title":{"type":"string"},"serviceNumber":{"type":"string"},"externalServiceNumber":{"type":"string"},"description":{"type":"string"},"locationLabel":{"type":"string"},"priority":{"$ref":"#/components/schemas/PriorityENUM"},"requiresPriceEstimate":{"type":"boolean"},"estimatedPrice":{"type":"integer"},"maxPrice":{"type":"integer"},"readyAtEstimate":{"type":"string","format":"date-time"},"readyAtNeeded":{"type":"string","format":"date-time"},"publicPageHash":{"type":"string"},"warranty":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"},"totals":{"$ref":"#/components/schemas/ServiceOrderTotalsSchema"},"items":{"type":"array","items":{"$ref":"#/components/schemas/ServiceOrderItemResponseSchema"}},"assets":{"type":"array","items":{"$ref":"#/components/schemas/ServiceOrderAssetResponse"}},"rmaOrderItemUid":{"$ref":"#/components/schemas/OptionalUID"},"rmaOrderUid":{"$ref":"#/components/schemas/OptionalUID"}}},"ServiceStateENUM":{"title":"ServiceStateENUM","type":"string","enum":["NOT_STARTED","IN_PROGRESS","COMPLETE"]},"PriorityENUM":{"title":"PriorityENUM","type":"string","enum":["HIGHEST","HIGH","LOW","NONE"],"default":"NONE"},"ServiceOrderTotalsSchema":{"title":"ServiceOrderTotalsSchema","type":"object","required":["grandTotal","partsTotal","workTotal"],"properties":{"grandTotal":{"type":"integer"},"partsTotal":{"type":"integer"},"workTotal":{"type":"integer"}}},"ServiceOrderItemResponseSchema":{"title":"ServiceOrderItemResponseSchema","type":"object","required":["serviceOrderItemUid","serviceOrderUid","warehouseUid","tenantUserUid","productUid","salesOrderUid","quantity","name","sku","price","costPrice","originalPrice","totalPrice","totalCostPrice","serialNumber","note","tenantUserDisplayName","createdAt","createdBy","lastModifiedAt","lastModifiedBy"],"properties":{"serviceOrderItemUid":{"$ref":"#/components/schemas/UID"},"serviceOrderUid":{"$ref":"#/components/schemas/UID"},"warehouseUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUserUid":{"$ref":"#/components/schemas/UID"},"productUid":{"$ref":"#/components/schemas/UID"},"salesOrderUid":{"$ref":"#/components/schemas/OptionalUID"},"quantity":{"type":"integer"},"name":{"type":"string"},"sku":{"type":"string"},"price":{"type":"integer"},"costPrice":{"type":"integer"},"originalPrice":{"type":"integer"},"totalPrice":{"type":"integer"},"totalCostPrice":{"type":"integer"},"serialNumber":{"type":"string"},"note":{"type":"string"},"tenantUserDisplayName":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"}}},"ServiceOrderAssetResponse":{"title":"ServiceOrderAssetResponse","type":"object","required":["assetUid","name","description","isPublic","publicUrl","mimeType"],"properties":{"assetUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"description":{"type":"string"},"isPublic":{"type":"boolean","description":"For private assets use download endpoint to get signed access."},"publicUrl":{"type":"string"},"mimeType":{"type":"string"}}}}},"paths":{"/tenants/{tenantUid}/customers/{customerUid}/export":{"get":{"description":"Intended for GDPR Compliance  \\\nExport customer data in structured form.  \\\nJSON is the only available format now \\","operationId":"tenant-customer-data-export","responses":{"200":{"$ref":"#/components/responses/CustomerExportResponse"}},"summary":"Export customer data in structured form. JSON is the only available format now","tags":["Customer","GDPR"]}}}}
```

## Print customer membership card

> Print a label or a receipt with a barcode that can be used to scan for easy customer registration

```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":"Access token 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":{"CustomerPrintRequest":{"content":{"application/json":{"schema":{"type":"object","properties":{"printerUid":{"$ref":"#/components/schemas/UID"}}}}},"description":"PrinterUid is optional. If no printerUid is defined, Flow Retail will try to find a suitable printer to print on"}},"schemas":{"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"}}},"paths":{"/tenants/{tenantUid}/customers/{customerUid}/print":{"post":{"summary":"Print customer membership card","tags":["Customer"],"responses":{"204":{"description":"No Content"}},"operationId":"post-tenants-customers-print","description":"Print a label or a receipt with a barcode that can be used to scan for easy customer registration","requestBody":{"$ref":"#/components/requestBodies/CustomerPrintRequest"}}}}}
```

## Get customer details

> Get details for 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":"Access token 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","customerParentUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehf","customerGroupUids","defaultStore","relevance"],"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"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"},"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":{"type":"string","deprecated":true,"description":"Deprecated. Use ledgerNumber in accountingConfigs instead"},"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","description":"Deprecated: Use ehf -> enabled instead"},"ehf":{"$ref":"#/components/schemas/CustomerEhfResponseSchema"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"defaultStore":{"$ref":"#/components/schemas/CustomerStoreResponseSchema"},"relevance":{"type":"number"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"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"},"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","role"],"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"},"role":{"$ref":"#/components/schemas/CustomerContactRoleENUM"}}},"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.|\n| KLAVIYO_PROFILE_ID | Klaviyo profile ID |","enum":["TWO_INVOICE","KLAVIYO_PROFILE_ID"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerContactRoleENUM":{"title":"CustomerContactRoleENUM","type":"string","enum":["ADMIN","PURCHASER","ACCOUNTING","NONE"]},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","required":["extensionCode","organizationUid"],"properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/OptionalUID"}}},"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","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"}}},"CustomerEhfResponseSchema":{"title":"CustomerEhfResponseSchema","type":"object","required":["enabled","address"],"properties":{"enabled":{"type":"boolean","description":"EHF is enabled for this customer"},"address":{"type":"string","description":"EHF address"}}},"CustomerStoreResponseSchema":{"title":"CustomerStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"}}}}},"paths":{"/tenants/{tenantUid}/customers/{customerUid}":{"get":{"description":"Get details for a customer.","operationId":"get-tenants-customers-details","responses":{"200":{"$ref":"#/components/responses/CustomerResponse"}},"summary":"Get customer details","tags":["Customer"]}}}}
```

## Update customer details

> Partial updates are allowed. &#x20;

```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":"Access token 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","deprecated":true,"description":"This field is deprecated. Use ehf -> enabled instead"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"ehf":{"$ref":"#/components/schemas/CustomerEhfSchema"},"defaultStoreUid":{"$ref":"#/components/schemas/UID"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"}}},"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"}}},"AccountManagerRequestSchema":{"title":"AccountManagerRequestSchema","type":"object","required":["tenantUserUid"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerEhfSchema":{"title":"CustomerEhfSchema","type":"object","properties":{"enabled":{"type":"boolean","description":"Enable EHF for this customer"},"address":{"type":"string","description":"The EHF address"}}},"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerParentUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehf","customerGroupUids","defaultStore","relevance"],"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"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"},"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":{"type":"string","deprecated":true,"description":"Deprecated. Use ledgerNumber in accountingConfigs instead"},"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","description":"Deprecated: Use ehf -> enabled instead"},"ehf":{"$ref":"#/components/schemas/CustomerEhfResponseSchema"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"defaultStore":{"$ref":"#/components/schemas/CustomerStoreResponseSchema"},"relevance":{"type":"number"}}},"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","role"],"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"},"role":{"$ref":"#/components/schemas/CustomerContactRoleENUM"}}},"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.|\n| KLAVIYO_PROFILE_ID | Klaviyo profile ID |","enum":["TWO_INVOICE","KLAVIYO_PROFILE_ID"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerContactRoleENUM":{"title":"CustomerContactRoleENUM","type":"string","enum":["ADMIN","PURCHASER","ACCOUNTING","NONE"]},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","required":["extensionCode","organizationUid"],"properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/OptionalUID"}}},"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","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"}}},"CustomerEhfResponseSchema":{"title":"CustomerEhfResponseSchema","type":"object","required":["enabled","address"],"properties":{"enabled":{"type":"boolean","description":"EHF is enabled for this customer"},"address":{"type":"string","description":"EHF address"}}},"CustomerStoreResponseSchema":{"title":"CustomerStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"}}}},"responses":{"CustomerResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponseSchema"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/customers/{customerUid}":{"put":{"description":"Partial updates are allowed.  ","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 permissions: 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":"Access token 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 permissions: CUSTOMER","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\
> \
> Required permissions: 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":"Access token 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","customerParentUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehf","customerGroupUids","defaultStore","relevance"],"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"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"},"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":{"type":"string","deprecated":true,"description":"Deprecated. Use ledgerNumber in accountingConfigs instead"},"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","description":"Deprecated: Use ehf -> enabled instead"},"ehf":{"$ref":"#/components/schemas/CustomerEhfResponseSchema"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"defaultStore":{"$ref":"#/components/schemas/CustomerStoreResponseSchema"},"relevance":{"type":"number"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"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"},"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","role"],"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"},"role":{"$ref":"#/components/schemas/CustomerContactRoleENUM"}}},"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.|\n| KLAVIYO_PROFILE_ID | Klaviyo profile ID |","enum":["TWO_INVOICE","KLAVIYO_PROFILE_ID"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerContactRoleENUM":{"title":"CustomerContactRoleENUM","type":"string","enum":["ADMIN","PURCHASER","ACCOUNTING","NONE"]},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","required":["extensionCode","organizationUid"],"properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/OptionalUID"}}},"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","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"}}},"CustomerEhfResponseSchema":{"title":"CustomerEhfResponseSchema","type":"object","required":["enabled","address"],"properties":{"enabled":{"type":"boolean","description":"EHF is enabled for this customer"},"address":{"type":"string","description":"EHF address"}}},"CustomerStoreResponseSchema":{"title":"CustomerStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"}}},"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":{"description":"Add an extension to a customer\n\nRequired permissions: CUSTOMER","operationId":"post-tenant-customer-extensions","summary":"Add an extension to a customer","responses":{"200":{"$ref":"#/components/responses/CustomerResponse"}},"requestBody":{"$ref":"#/components/requestBodies/CustomerExtensionRequest"},"tags":["Customer"]}}}}
```

## Delete an extension to a customer

> Delete an extension to a customer\
> \
> Required permissions: 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":"Access token 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","description":"Delete an extension to a customer\n\nRequired permissions: CUSTOMER","responses":{"204":{"description":"No Content"}},"tags":["Customer"],"requestBody":{"$ref":"#/components/requestBodies/CustomerExtensionRequest"}}}}}
```

## BATCH Create customers

> Creates customers\
> Items in:\
> &#x20; \- create :  will be created.\
> &#x20;   \
> &#x20; \- update :  will be updated.\
> &#x20; \- delete:   will be deleted.\
> &#x20; \- upsert:   will create or update if needed.\
> \
> The response http status is either:\
> &#x20;\- 200: all items in request was processed successfully, \
> &#x20;\- 207: one or more item was processed with an error.\
> \
> Required permissions: CUSTOMER<br>

```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":"Access token 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":{"CustomerBatchRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerBatchRequestSchema"}}}}},"schemas":{"CustomerBatchRequestSchema":{"title":"CustomerBatchRequestSchema","type":"object","properties":{"create":{"type":"array","items":{"$ref":"#/components/schemas/CustomerCreateSchema"}},"delete":{"type":"array","items":{"$ref":"#/components/schemas/CustomerBatchDeleteSchema"}},"update":{"type":"array","items":{"$ref":"#/components/schemas/CustomerCreateSchema"}},"upsert":{"type":"array","items":{"$ref":"#/components/schemas/CustomerCreateSchema"}}}},"CustomerCreateSchema":{"title":"CustomerCreateSchema","allOf":[{"$ref":"#/components/schemas/CustomerUpdateSchema"},{"type":"object","required":["customerType"],"properties":{"customerUid":{"$ref":"#/components/schemas/UID"},"customerType":{"$ref":"#/components/schemas/CustomerTypeENUM"},"consents":{"type":"array","items":{"$ref":"#/components/schemas/CustomerCreateConsentSchema"}}}}]},"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","deprecated":true,"description":"This field is deprecated. Use ehf -> enabled instead"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"ehf":{"$ref":"#/components/schemas/CustomerEhfSchema"},"defaultStoreUid":{"$ref":"#/components/schemas/UID"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"}}},"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"}}},"AccountManagerRequestSchema":{"title":"AccountManagerRequestSchema","type":"object","required":["tenantUserUid"],"properties":{"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CustomerEhfSchema":{"title":"CustomerEhfSchema","type":"object","properties":{"enabled":{"type":"boolean","description":"Enable EHF for this customer"},"address":{"type":"string","description":"The EHF address"}}},"CustomerCreateConsentSchema":{"title":"CustomerCreateConsentSchema","allOf":[{"$ref":"#/components/schemas/CustomerConsentChangeSchema"},{"type":"object","required":["consentUid"],"properties":{"consentUid":{"$ref":"#/components/schemas/UID"}}}]},"CustomerConsentChangeSchema":{"title":"CustomerConsentChangeSchema","type":"object","required":["source","status"],"properties":{"source":{"type":"string"},"status":{"type":"boolean","description":"Is the consent active or withdrawn"}}},"CustomerBatchDeleteSchema":{"title":"CustomerBatchDeleteSchema","type":"object","required":["customerUid"],"properties":{"customerUid":{"$ref":"#/components/schemas/UID"}}},"CustomerBatchResponseSchema":{"title":"CustomerBatchResponseSchema","type":"object","required":["create","delete","update","upsert"],"properties":{"create":{"$ref":"#/components/schemas/CustomerBatchResponseItemSchema"},"delete":{"$ref":"#/components/schemas/CustomerBatchResponseItemSchema"},"update":{"$ref":"#/components/schemas/CustomerBatchResponseItemSchema"},"upsert":{"$ref":"#/components/schemas/CustomerBatchResponseItemSchema"}}},"CustomerBatchResponseItemSchema":{"title":"CustomerBatchResponseItemSchema","type":"object","required":["errors","success"],"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/CustomerBatchErrorSchema"}},"success":{"type":"integer"}}},"CustomerBatchErrorSchema":{"title":"CustomerBatchErrorSchema","type":"object","required":["errorCode","message","customerUid"],"properties":{"errorCode":{"type":"string"},"message":{"type":"string"},"customerUid":{"$ref":"#/components/schemas/UID"}}},"PriceBatchResponseSchema":{"properties":{"create":{"$ref":"#/components/schemas/BatchResponseItemProductSchema"},"delete":{"$ref":"#/components/schemas/PriceBatchResponseItemPriceSchema"},"update":{"$ref":"#/components/schemas/PriceBatchResponseItemPriceSchema"},"upsert":{"$ref":"#/components/schemas/BatchResponseItemProductSchema"}},"required":["create","upsert","update","delete"],"title":"PriceBatchResponseSchema","type":"object"},"BatchResponseItemProductSchema":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/BatchErrorProductSchema"},"type":"array"},"success":{"type":"integer"}},"required":["success","errors"],"title":"BatchResponseItemProductSchema","type":"object"},"BatchErrorProductSchema":{"properties":{"errorCode":{"type":"string"},"message":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"}},"required":["productUid","errorCode","message"],"title":"BatchErrorProductSchema","type":"object"},"PriceBatchResponseItemPriceSchema":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/PriceBatchErrorPriceSchema"},"type":"array"},"success":{"type":"integer"}},"required":["success","errors"],"title":"PriceBatchResponseItemPriceSchema","type":"object"},"PriceBatchErrorPriceSchema":{"properties":{"errorCode":{"type":"string"},"message":{"type":"string"},"priceUid":{"$ref":"#/components/schemas/UID"}},"required":["priceUid","errorCode","message"],"title":"PriceBatchErrorPriceSchema","type":"object"}},"responses":{"CustomerBatchResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerBatchResponseSchema"}}}},"PriceBatchResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceBatchResponseSchema"}}},"description":"Response for PriceBatchRequest.\n200: All items in request was processed with no errors\n207: One or more items in request returned an error"}}},"paths":{"/tenants/{tenantUid}/customers/batch":{"post":{"description":"Creates customers\nItems in:\n  - create :  will be created.\n    \n  - update :  will be updated.\n  - delete:   will be deleted.\n  - upsert:   will create or update if needed.\n\nThe response http status is either:\n - 200: all items in request was processed successfully, \n - 207: one or more item was processed with an error.\n\nRequired permissions: CUSTOMER\n","operationId":"post-tenants-customers-batch","requestBody":{"$ref":"#/components/requestBodies/CustomerBatchRequest"},"responses":{"200":{"$ref":"#/components/responses/CustomerBatchResponse"},"207":{"$ref":"#/components/responses/PriceBatchResponse"}},"summary":"BATCH Create customers","tags":["Customer"]}}}}
```

## 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":"Access token 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","customerParentUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehf","customerGroupUids","defaultStore","relevance"],"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"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"},"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":{"type":"string","deprecated":true,"description":"Deprecated. Use ledgerNumber in accountingConfigs instead"},"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","description":"Deprecated: Use ehf -> enabled instead"},"ehf":{"$ref":"#/components/schemas/CustomerEhfResponseSchema"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"defaultStore":{"$ref":"#/components/schemas/CustomerStoreResponseSchema"},"relevance":{"type":"number"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"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"},"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","role"],"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"},"role":{"$ref":"#/components/schemas/CustomerContactRoleENUM"}}},"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.|\n| KLAVIYO_PROFILE_ID | Klaviyo profile ID |","enum":["TWO_INVOICE","KLAVIYO_PROFILE_ID"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerContactRoleENUM":{"title":"CustomerContactRoleENUM","type":"string","enum":["ADMIN","PURCHASER","ACCOUNTING","NONE"]},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","required":["extensionCode","organizationUid"],"properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/OptionalUID"}}},"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","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"}}},"CustomerEhfResponseSchema":{"title":"CustomerEhfResponseSchema","type":"object","required":["enabled","address"],"properties":{"enabled":{"type":"boolean","description":"EHF is enabled for this customer"},"address":{"type":"string","description":"EHF address"}}},"CustomerStoreResponseSchema":{"title":"CustomerStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"}}},"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."}}}}
```

## Merge duplicate customer into this customer

> Merge the duplicate customer in the request body (\`mergeFromCustomerUid\`) into this customer (\`customerUid\` in the path). The path customer is kept; orders and other data tied to the duplicate are moved to it, then the duplicate is deleted.\
> \
> Required permissions: 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":"Access token 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"},"GenericErrorResponse":{"content":{"application/json":{"schema":{"properties":{"code":{"type":"string"},"message":{"type":"string","description":"Error message in the locale you specify in the Accept-Language header or specified on the user"},"logId":{"type":"string","description":"Log identification. Can be used when reporting errors to Flow Solutions"}},"type":"object"}}},"description":"Linking failed. Ther error message will have information about what failed."}},"schemas":{"CustomerResponseSchema":{"title":"CustomerResponseSchema","type":"object","description":"CustomerResponseSchema","required":["address","city","companyName","countryCode","createdAt","customerUid","customerParentUid","customerType","email","externalId","firstname","lastModifiedAt","lastname","mobile","postalCode","pricelistUid","vatNumber","origin","addresses","contacts","extensions","consents","loyaltyId","displayName","credit","paymentTerms","internalNote","accountManager","ehf","customerGroupUids","defaultStore","relevance"],"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"},"customerParentUid":{"description":"References another customer, establishing it as a department under the main customer. Only applicable when customerType is COMPANY.","$ref":"#/components/schemas/OptionalUID"},"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":{"type":"string","deprecated":true,"description":"Deprecated. Use ledgerNumber in accountingConfigs instead"},"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","description":"Deprecated: Use ehf -> enabled instead"},"ehf":{"$ref":"#/components/schemas/CustomerEhfResponseSchema"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"defaultStore":{"$ref":"#/components/schemas/CustomerStoreResponseSchema"},"relevance":{"type":"number"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"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"},"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","role"],"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"},"role":{"$ref":"#/components/schemas/CustomerContactRoleENUM"}}},"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.|\n| KLAVIYO_PROFILE_ID | Klaviyo profile ID |","enum":["TWO_INVOICE","KLAVIYO_PROFILE_ID"],"title":"CustomerExtensionCodeENUM","type":"string"},"CustomerContactRoleENUM":{"title":"CustomerContactRoleENUM","type":"string","enum":["ADMIN","PURCHASER","ACCOUNTING","NONE"]},"CustomerExtensionResponseSchema":{"title":"CustomerExtensionResponseSchema","description":"CustomerExtensionResponseSchema","type":"object","required":["extensionCode","organizationUid"],"properties":{"extensionCode":{"$ref":"#/components/schemas/CustomerExtensionCodeENUM"},"organizationUid":{"$ref":"#/components/schemas/OptionalUID"}}},"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","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"}}},"CustomerEhfResponseSchema":{"title":"CustomerEhfResponseSchema","type":"object","required":["enabled","address"],"properties":{"enabled":{"type":"boolean","description":"EHF is enabled for this customer"},"address":{"type":"string","description":"EHF address"}}},"CustomerStoreResponseSchema":{"title":"CustomerStoreResponseSchema","type":"object","nullable":true,"required":["name","storeUid"],"properties":{"name":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"}}},"CustomerMergeSchema":{"title":"CustomerMergeSchema","type":"object","required":["mergeFromCustomerUid"],"properties":{"mergeFromCustomerUid":{"$ref":"#/components/schemas/UID"}}}},"requestBodies":{"CustomerMergeRequest":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerMergeSchema"}}},"description":"The duplicate customer to merge into the path `customerUid` and remove afterward."}}},"paths":{"/tenants/{tenantUid}/customers/{customerUid}/merge":{"post":{"summary":"Merge duplicate customer into this customer","tags":["Customer"],"responses":{"200":{"$ref":"#/components/responses/CustomerResponse"},"400":{"$ref":"#/components/responses/GenericErrorResponse"},"404":{"$ref":"#/components/responses/GenericErrorResponse"}},"operationId":"post-tenants-tenantUid-customers-customerUid-merge","description":"Merge the duplicate customer in the request body (`mergeFromCustomerUid`) into this customer (`customerUid` in the path). The path customer is kept; orders and other data tied to the duplicate are moved to it, then the duplicate is deleted.\n\nRequired permissions: CUSTOMER","requestBody":{"$ref":"#/components/requestBodies/CustomerMergeRequest"}}}}}
```


---

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

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation 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/api/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.
