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

# 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":{"preferredLanguage":{"description":"The language the customer prefers to be written to in. A language the platform does not support is refused. Send an empty string to clear the preference; the tenant language then applies.","allOf":[{"$ref":"#/components/schemas/LanguageCode"}]},"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":"Deprecated. Use ledgerNumber in accountingConfigs instead","type":"string","deprecated":true},"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"},"representedStoreUid":{"description":"Inter-store trade: the store this customer represents (the buyer). Only settable when the INTER_STORE_TRADE extension is active.","allOf":[{"$ref":"#/components/schemas/OptionalUID"}]},"customerParentUid":{"$ref":"#/components/schemas/OptionalUID"}}},"LanguageCode":{"title":"LanguageCode","description":"Lowercase two-letter ISO 639-1 language code, like nb, en or sv.","type":"string"},"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","customerNumber","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","preferredLanguage"],"properties":{"preferredLanguage":{"description":"The language the customer prefers to be written to in. Messages and the service portal use it, falling back to the tenant language. An empty string when the customer has no recorded preference.","allOf":[{"$ref":"#/components/schemas/LanguageCode"}]},"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"},"customerNumber":{"type":"string","description":"Tenant-scoped running customer number, assigned on creation. An empty string for customers created before customer numbers were enabled, or when the tenant has no customer number series."},"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","deprecated":true},"ehf":{"$ref":"#/components/schemas/CustomerEhfResponseSchema"},"customerGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"defaultStore":{"$ref":"#/components/schemas/CustomerStoreResponseSchema"},"representedStore":{"description":"Inter-store trade: the store this customer represents (the buyer). Only set when the INTER_STORE_TRADE extension is active.","allOf":[{"$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","address","postalCode","city","createdAt","lastModifiedAt","customerContactUid","extensions","displayName","role"],"properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"$ref":"#/components/schemas/EmailTYPE"},"mobile":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"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"]}}}}
```


---

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

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

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

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

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

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

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