# Import companies Insert or update company information as well as attach or disconnect customers to the company.Read more about the method here. Endpoint: POST /Customer/ImportCompanies 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): - `ApplicationKey` (string, required) Application identifier. Determines which application company belongs to. - `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 - `Code` (string) Company code. Used for company matching if Norce Commerce company id is omitted. - `Contacts` (array) List of company contacts - `Contacts.Code` (string, required) Contact code. Used for contact matching. - `Contacts.IsActive` (boolean) Sets contact to active or inactive. Default true. - `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. - `Customers.Accounts` (array) List of registered customer accounts - `Customers.Accounts.ApplicationKey` (string, required) Application identifier. Determines which application the account belongs to. - `Customers.Accounts.LoginName` (string, required) Account login name - `Customers.Accounts.Password` (string) Account password - `Customers.Accounts.Roles` (array) List of account roles to assign - `Customers.Accounts.Roles.Code` (string, required) Unique code of account role (e.g. Administrator, User). The role needs to exist in Norce Commerce. - `Customers.Accounts.Roles.IsActive` (boolean) Sets account role to active or inactive. Default is true. - `Customers.Accounts.Status` (integer) Account status: 1 = Active, 2 = Inactive (Use integers if import format is XML) - `Customers.CellPhoneNumber` (string) Mobile phone number - `Customers.Code` (string) Customer code. Used for customer matching if Norce Commerce's internal customer id is omitted. - `Customers.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. - `Customers.Companies.Code` (string) Company code. Used for company matching if Norce Storm company id is omitted. - `Customers.Companies.Id` (integer) Norce [Storm]'s internal company id - `Customers.Companies.IsPrimary` (boolean) Sets company as primary for the customer. Default is false. - `Customers.Companies.Name` (string) Company name - `Customers.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. - `Customers.CrmId` (string) Used to save the customer external id from a crm-system - `Customers.DeliveryAddresses` (array) Delivery address - `Customers.DeliveryAddresses.AddressLine1` (string) First line of address - `Customers.DeliveryAddresses.AddressLine2` (string) Second line of address - `Customers.DeliveryAddresses.CareOf` (string) Care of - `Customers.DeliveryAddresses.City` (string) City - `Customers.DeliveryAddresses.Code` (string) System agnostic identifier for the company or customer. Max length: 50 - `Customers.DeliveryAddresses.CountryCode` (string) ISO country code (e.g. SE, BY). Max length: 2 - `Customers.DeliveryAddresses.Gln` (string) Global Location Number. Max length: 50 - `Customers.DeliveryAddresses.IsPrimary` (boolean) Set to true to indicate primary delivery address. Null will not change anything. Only one address can be marked primary. - `Customers.DeliveryAddresses.IsValidated` (boolean) Set to true to indicate that the address has been validated. Null will not change anything. - `Customers.DeliveryAddresses.Region` (string) Region - `Customers.DeliveryAddresses.ShippingPhoneNumber` (string) Phone number for shipping notifications (if used as delivery address). Max length: 50 - `Customers.DeliveryAddresses.ZipCode` (string) Zip code - `Customers.EmailAddress` (string) Customer email address. Used for customer matching if Norce Commerce customer id and code is omitted and SearchOnlyByCode is false in header. - `Customers.FirstName` (string) First name - `Customers.Flags` (array) Customer flags - `Customers.Flags.Code` (string, required) Flag code. Used for flag matching. - `Customers.Flags.IsActive` (boolean) Sets flag to active or inactive. Default is true. - `Customers.Flags.IsCreateOnly` (boolean) If true, data is only saved if flag record is new. Default is false. - `Customers.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. - `Customers.Flags.StopDate` (string) Sets the stop date explicitly for inactivated flags. Time of process is used as default. - `Customers.Id` (integer) Norce Commerce's internal customer id - `Customers.InvoiceAddress` (object) Company or customer address information - `Customers.IsActive` (boolean) Sets customer to active or inactive. Default is true. - `Customers.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. - `Customers.LastName` (string) Last name - `Customers.MiddleName` (string) Middle name - `Customers.PhoneNumber` (string) Phone number - `Customers.PriceLists` (array) Customer price lists - `Customers.PriceLists.Code` (string, required) Price list code. Used for price list matching. - `Customers.PriceLists.IsExclusive` (boolean) Determines if price list is exclusive, an exclusive price list overrides best price calculation in Norce Commerce Shopping API. - `Customers.SocialSecurityNumber` (string) Social security number - `Customers.Title` (string) Title - `Customers.Type` (integer) Customer type: 1 = Customer, 2 = Company contact - `DeliveryAddresses` (array) List of delivery addresses - `DeliveryMethods` (array) List of delivery methods applicable to company - `DeliveryMethods.Code` (string, required) Delivery method code - `DeliveryMethods.IsActive` (boolean) Sets delivery method to active or inactive. Default is true. - `Discounts` (array) List of company discounts - `Discounts.DiscountPercentage` (number) Value of the discount (in percent) - `Discounts.PriceListTypeIdSeed` (string) Comma separated list of price list types - `Discounts.Type` (string) Type of discount: 1 = Category, 2 = Product Discount Class, 3 = Product Flag - `Discounts.ValueCode` (string) Value code, for Category type this is the category code. For Discount class its the class identifier used in Norce Commerce. - `EmailAddress` (string) Contact email address - `Flags` (array) List of company flags - `Id` (integer) Norce Commerce's internal company id - `IsActive` (boolean) Sets company to active or inactive. Default is true. - `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. - `LogoImage` (object) Image information - `LogoImage.ExternalCode` (string, required) Code for image matching - `LogoImage.FileTypeName` (string, required) File type. Should match file info set up in Norce Commerce, e.g. MainImage, Additional, Embedded. - `LogoImage.Url` (string, required) URL where image should be taken from - `LogoImage.Filename` (string) Image file name. If omitted will be parsed form URL. - `LogoImage.LastModified` (string) Time when image was changed. Should be set to synchronize image updates. - `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. - `ParentCompanyCode` (string) Can be used for setting parent company (if exists) - `PaymentMethods` (array) List of company payment methods - `PaymentMethods.Code` (string, required) Payment method code. Used for payment method matching. - `PaymentMethods.InvoiceCaptureSettingsCode` (string) Used for specifying the invoice capture setting to use. - `PaymentMethods.IsActive` (boolean) Sets payment method relation to active or inactive. Default true. - `PhoneNumber` (string) Contact phone number - `PriceLists` (array) List of company price lists - `VatNo` (string) Vat Number - `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. ## 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.