# Import customers Insert or update customer information, create accounts on the customer or create, attach or disconnect companies to the customer.Read more about the method here. Endpoint: POST /Customer/ImportCustomers Version: 4.0 ## Header parameters: - `x-stormconnect-header` (string, required) JSON or XML serialized string of the CustomerHeader object.Note that the enums must be of integer values when using application/xml encoding and can be both string or integer for application/json. ## Request fields (application/json): - `Accounts` (array) List of registered customer accounts - `Accounts.ApplicationKey` (string, required) Application identifier. Determines which application the account belongs to. - `Accounts.LoginName` (string, required) Account login name - `Accounts.Password` (string) Account password - `Accounts.Roles` (array) List of account roles to assign - `Accounts.Roles.Code` (string, required) Unique code of account role (e.g. Administrator, User). The role needs to exist in Norce Commerce. - `Accounts.Roles.IsActive` (boolean) Sets account role to active or inactive. Default is true. - `Accounts.Status` (integer) Account status: 1 = Active, 2 = Inactive (Use integers if import format is XML) - `AdditionalInfo` (array) List of additional information fields - `AdditionalInfo.Code` (string, required) Information field code. Used for info matching. - `AdditionalInfo.Value` (string, required) Value to set - `ApplicationKey` (string) Application identifier. Determines which application company belongs to. - `CellPhoneNumber` (string) Mobile phone number - `Code` (string) Customer code. Used for customer matching if Norce Commerce's internal customer id is omitted. - `Companies` (array) List of companies belonging to this customer. Companies must exist already in Norce Commerce to be added as a relation to this Customer. Any identifier can be used and they are ordered as Id, Code, OrganizationNo. The first that is given will be used. If more than one is marked IsPrimary then only the first will be marked as primary. - `Companies.Code` (string) Company code. Used for company matching if Norce Storm company id is omitted. - `Companies.Id` (integer) Norce [Storm]'s internal company id - `Companies.IsPrimary` (boolean) Sets company as primary for the customer. Default is false. - `Companies.Name` (string) Company name - `Companies.OrganizationNo` (string) Organization number. Used for company matching if Norce [Storm]'s internal company id and company code are omitted and is false in header. - `CrmId` (string) Used to save the customer external id from a crm-system - `DeliveryAddresses` (array) Delivery address - `DeliveryAddresses.AddressLine1` (string) First line of address - `DeliveryAddresses.AddressLine2` (string) Second line of address - `DeliveryAddresses.CareOf` (string) Care of - `DeliveryAddresses.City` (string) City - `DeliveryAddresses.Code` (string) System agnostic identifier for the company or customer. Max length: 50 - `DeliveryAddresses.CountryCode` (string) ISO country code (e.g. SE, BY). Max length: 2 - `DeliveryAddresses.Gln` (string) Global Location Number. Max length: 50 - `DeliveryAddresses.IsPrimary` (boolean) Set to true to indicate primary delivery address. Null will not change anything. Only one address can be marked primary. - `DeliveryAddresses.IsValidated` (boolean) Set to true to indicate that the address has been validated. Null will not change anything. - `DeliveryAddresses.Region` (string) Region - `DeliveryAddresses.ShippingPhoneNumber` (string) Phone number for shipping notifications (if used as delivery address). Max length: 50 - `DeliveryAddresses.ZipCode` (string) Zip code - `EmailAddress` (string) Customer email address. Used for customer matching if Norce Commerce customer id and code is omitted and SearchOnlyByCode is false in header. - `FirstName` (string) First name - `Flags` (array) Customer flags - `Flags.Code` (string, required) Flag code. Used for flag matching. - `Flags.IsActive` (boolean) Sets flag to active or inactive. Default is true. - `Flags.IsCreateOnly` (boolean) If true, data is only saved if flag record is new. Default is false. - `Flags.IsLimitedUpdate` (boolean) If true, data is only saved if flag record is new or last updated by the same account as the one initiating the update. Default is false. - `Flags.StopDate` (string) Sets the stop date explicitly for inactivated flags. Time of process is used as default. - `Id` (integer) Norce Commerce's internal customer id - `InvoiceAddress` (object) Company or customer address information - `IsActive` (boolean) Sets customer to active or inactive. Default is true. - `IsCompanyListDelta` (boolean) If false companies that are not provided for this customer in request will be deactivated from the relation to this Company. Default is false. - `LastName` (string) Last name - `MiddleName` (string) Middle name - `PhoneNumber` (string) Phone number - `PriceLists` (array) Customer price lists - `PriceLists.Code` (string, required) Price list code. Used for price list matching. - `PriceLists.IsExclusive` (boolean) Determines if price list is exclusive, an exclusive price list overrides best price calculation in Norce Commerce Shopping API. - `SocialSecurityNumber` (string) Social security number - `Title` (string) Title - `Type` (integer) Customer type: 1 = Customer, 2 = Company contact ## Response 200 fields (application/json): - `StatusCode` (string) Status of the job - `Description` (string) Short message describing the job - `JobId` (string) Norce Commerce's interal id created for this job. Refer to this for future requests. - `ValidationSummary` (object) Validation data for accepted payload - `ValidationSummary.NrOfItemsInTotal` (integer) Total number of items in payload. - `ValidationSummary.NrOfValidationFailures` (integer) Number of items that failed initial validation. - `ValidationSummary.Messages` (array) Messages concerning the validation.