# 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.AccountStatus` (integer) Account status: 1 = Active, 2 = Inactive - `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. - `Companies.Code` (string) Company code. Used for company matching if Norce Commerce company id is omitted. - `Companies.Contacts` (array) List of company contacts - `Companies.Contacts.Code` (string, required) Contact code. Used for contact matching. - `Companies.Contacts.IsActive` (boolean) Sets contact to active or inactive. Default true. - `Companies.Customers` (array) List of customers belonging to company. Customers must exist already in Norce Commerce to be added as a relation to this Company. Any identifier can be used and they are ordered as Id, Code, EmailAddress. The first that is given will be used. - `Companies.DeliveryAddresses` (array) List of delivery addresses - `Companies.DeliveryAddresses.AddressLine1` (string) First line of address - `Companies.DeliveryAddresses.AddressLine2` (string) Second line of address - `Companies.DeliveryAddresses.CareOf` (string) Care of - `Companies.DeliveryAddresses.City` (string) City - `Companies.DeliveryAddresses.Code` (string) System agnostic identifier for the company or customer. Max length: 50 - `Companies.DeliveryAddresses.CountryCode` (string) ISO country code (e.g. SE, BY). Max length: 2 - `Companies.DeliveryAddresses.Gln` (string) Global Location Number. Max length: 50 - `Companies.DeliveryAddresses.IsPrimary` (boolean) Set to true to indicate primary delivery address. Null will not change anything. Only one address can be marked primary. - `Companies.DeliveryAddresses.IsValidated` (boolean) Set to true to indicate that the address has been validated. Null will not change anything. - `Companies.DeliveryAddresses.Region` (string) Region - `Companies.DeliveryAddresses.ShippingPhoneNumber` (string) Phone number for shipping notifications (if used as delivery address). Max length: 50 - `Companies.DeliveryAddresses.ZipCode` (string) Zip code - `Companies.DeliveryMethods` (array) List of delivery methods applicable to company - `Companies.DeliveryMethods.Code` (string, required) Delivery method code - `Companies.DeliveryMethods.IsActive` (boolean) Sets delivery method to active or inactive. Default is true. - `Companies.Discounts` (array) List of company discounts - `Companies.Discounts.DiscountPercentage` (number) Value of the discount (in percent) - `Companies.Discounts.PriceListTypeIdSeed` (string) Comma separated list of price list types - `Companies.Discounts.Type` (string) Type of discount: 1 = Category, 2 = Product Discount Class, 3 = Product Flag - `Companies.Discounts.ValueCode` (string) Value code, for Category type this is the category code. For Discount class its the class identifier used in Norce Commerce. - `Companies.EmailAddress` (string) Contact email address - `Companies.Flags` (array) List of company flags - `Companies.Flags.Code` (string, required) Flag code. Used for flag matching. - `Companies.Flags.IsActive` (boolean) Sets flag to active or inactive. Default is true. - `Companies.Flags.IsCreateOnly` (boolean) If true, data is only saved if flag record is new. Default is false. - `Companies.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. - `Companies.Flags.StopDate` (string) Sets the stop date explicitly for inactivated flags. Time of process is used as default. - `Companies.Id` (integer) Norce Commerce's internal company id - `Companies.InvoiceAddress` (object) Company or customer address information - `Companies.IsActive` (boolean) Sets company to active or inactive. Default is true. - `Companies.IsCustomerListDelta` (boolean) If false customers that are not provided for this company in request will be deactivated from the relation to this Company. Default is false. - `Companies.LogoImage` (object) Image information - `Companies.LogoImage.ExternalCode` (string, required) Code for image matching - `Companies.LogoImage.FileTypeName` (string, required) File type. Should match file info set up in Norce Commerce, e.g. MainImage, Additional, Embedded. - `Companies.LogoImage.Url` (string, required) URL where image should be taken from - `Companies.LogoImage.Filename` (string) Image file name. If omitted will be parsed form URL. - `Companies.LogoImage.LastModified` (string) Time when image was changed. Should be set to synchronize image updates. - `Companies.Name` (string) Company name - `Companies.OrganizationNo` (string) Organization number. Used for company matching if Norce Commerce's internal company id and company code are omitted and is false in header. - `Companies.ParentCompanyCode` (string) Can be used for setting parent company (if exists) - `Companies.PaymentMethods` (array) List of company payment methods - `Companies.PaymentMethods.Code` (string, required) Payment method code. Used for payment method matching. - `Companies.PaymentMethods.InvoiceCaptureSettingsCode` (string) Used for specifying the invoice capture setting to use. - `Companies.PaymentMethods.IsActive` (boolean) Sets payment method relation to active or inactive. Default true. - `Companies.PhoneNumber` (string) Contact phone number - `Companies.PriceLists` (array) List of company price lists - `Companies.PriceLists.Code` (string, required) Price list code. Used for price list matching. - `Companies.PriceLists.IsExclusive` (boolean) Determines if price list is exclusive, an exclusive price list overrides best price calculation in Norce Commerce API. - `Companies.VatNo` (string) Vat Number - `Companies.UseInvoiceAddressAsDeliveryAddress` (boolean) Use in conjunction with an invoice address to set the delivery address to the same as the invoice address. Both must be active for the import. - `CrmId` (string) Used to save the customer external id from a crm-system - `DeliveryAddresses` (array) Delivery address - `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 - `Id` (integer) Norce Commerce's internal customer id - `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 - `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.