> 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/batch-create-customers.md).

# BATCH Create customers

Creates customers Items in:

* create : will be created.
* update : will be updated.
* delete: will be deleted.
* upsert: will create or update if needed.

The response http status is either:

* 200: all items in request was processed successfully,
* 207: one or more item was processed with an error.

Required permissions: CUSTOMER\_BATCH

```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":{"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"}}},"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_BATCH\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"]}}}}
```


---

# 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/batch-create-customers.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.
