openapi: 3.0.1
info:
  title: Documentation Norce [Storm] Connect Customer Service
  description: >-
    The Customer Service has Entities and Operations concerned with Customers
    and Companies in Norce [Storm].
  version: '4.0'
servers:
  - url: https://connect.lab.storm.io/4.0/api
paths:
  /Customer/ImportCompanies:
    post:
      tags:
        - Customers
      summary: Import companies
      description: >-
        Insert or update company information as well as attach or disconnect
        customers to the company.<br/>Read more about the method <a
        href='/companyintegration/#importing-companies'>here</a>.
      operationId: ImportCompanies
      parameters:
        - name: X-StormConnect-Header
          in: header
          description: >-
            JSON or XML serialized string of the CustomerHeader object.<br/>Note
            that the enums must be of integer values when using application/xml
            encoding and can be both string or integer for application/json.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Company'
          application/xml:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Company'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
            application/xml:
              schema:
                $ref: '#/components/schemas/JobResponse'
        '400':
          description: Bad Request
          content: {}
        '500':
          description: Internal Server Error
          content: {}
      x-codegen-request-body-name: companies
  /Customer/ImportCustomers:
    post:
      tags:
        - Customers
      summary: Import customers
      description: >-
        Insert or update customer information, create accounts on the customer
        or create, attach or disconnect companies to the customer.<br/>Read more
        about the method <a
        href='/customerintegration/#importing-customers'>here</a>.
      operationId: ImportCustomers
      parameters:
        - name: x-stormconnect-header
          in: header
          description: >-
            JSON or XML serialized string of the CustomerHeader object.<br/>Note
            that the enums must be of integer values when using application/xml
            encoding and can be both string or integer for application/json.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Customer'
          application/xml:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Customer'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
            application/xml:
              schema:
                $ref: '#/components/schemas/JobResponse'
        '400':
          description: Bad Request
          content: {}
        '500':
          description: Internal Server Error
          content: {}
      x-codegen-request-body-name: companies
components:
  schemas:
    CustomerHeader:
      required:
        - AccountId
        - CompanyFieldsThatAreSet
        - CustomerFieldsThatAreSet
      type: object
      properties:
        AccountId:
          type: integer
          description: >-
            Account which initiated the import. Learn about system accounts <a
            href='/connectintegration/#using-system-accounts'>here</a>.
          format: int32
        CompanyFieldsThatAreSet:
          type: array
          description: >-
            Array of strings representing company fields to be
            processed.<br/>(Use the integer instead of the name for the xml
            content type)<br/>Not required for ImportCustomers<br/><br/>0 =
            ApplicationKey<br>1 = Id<br>2 = Code<br>3 = OrganizationNo<br>4 =
            Name<br>5 = EmailAddress<br>6 = PhoneNumber<br>7 = LogoImage<br>8 =
            ParentCompanyCode<br>9 = IsActive<br>10 = InvoiceAddress<br>11 =
            DeliveryAddresses<br>12 = AdditionalInfo<br>13 = Contacts<br>14 =
            Customers (set values in CustomerFieldsThatAreSet)<br>15 =
            DeliveryMethods<br>16 = Discounts<br>17 = Flags<br>18 =
            PaymentMethods<br>19 = PriceLists<br>20 = SearchOnlyByCode (matches
            the customer only on the value on the code field, allows for
            duplicated OrganizationNo)<br>21 = VatNo<br>22 = PreserveFlags
            (Flags not passed in, will be left on the entity, otherwise they
            will be removed and replaced with the ones imported)
          items:
            type: string
            enum:
              - ApplicationKey
              - Id
              - Code
              - OrganizationNo
              - Name
              - EmailAddress
              - PhoneNumber
              - LogoImage
              - ParentCompanyCode
              - IsActive
              - InvoiceAddress
              - DeliveryAddresses
              - AdditionalInfo
              - Contacts
              - Customers
              - DeliveryMethods
              - Discounts
              - Flags
              - PaymentMethods
              - PriceLists
              - SearchOnlyByCode
              - VatNo
              - PreserveFlags
        CustomerFieldsThatAreSet:
          type: array
          description: >-
            Array of strings representing customer fields to be
            processed.<br/>(Use the integer instead of the name for the xml
            content type)<br/>Not required for ImportCompanies, but if used
            there, 'Customers' must be set in CompanyFieldsThatAreSet<br/><br/>0
            = ApplicationKey<br>1 = Id<br>2 = Code<br>3 = EmailAddress<br>4 =
            SocialSecurityNumber<br>5 = Title<br>6 = FirstName<br>7 =
            MiddleName<br>8 = LastName<br>9 = PhoneNumber<br>10 =
            CellPhoneNumber<br>11 = IsActive<br>12 = InvoiceAddress<br>13 =
            DeliveryAddresses<br>14 = Accounts (set values in
            AccountFieldsThatAreSet)<br>15 = AdditionalInfo<br>16 = Flags<br>17
            = PriceLists<br>18 = SearchOnlyByCode (matches the customer only on
            the value on the code field, alows for duplicated email
            addresses)<br>19 = Companies (set values in
            CompanyFieldsThatAreSet)<br>20 = CrmId<br>21 = PreserveFlags (Flags
            not passed in, will be left on the entity, otherwise they will be
            removed and replaced with the ones imported)
          items:
            type: string
            enum:
              - ApplicationKey
              - Code
              - EmailAddress
              - SocialSecurityNumber
              - Title
              - FirstName
              - MiddleName
              - LastName
              - PhoneNumber
              - CellPhoneNumber
              - IsActive
              - InvoiceAddress
              - DeliveryAddresses
              - Accounts
              - AdditionalInfo
              - Flags
              - PriceLists
              - SearchOnlyByCode
              - Companies
              - CrmId
              - PreserveFlags
        AccountFieldsThatAreSet:
          type: array
          description: >-
            Array of strings representing account fields to be
            processed.<br/>(Use the integer instead of the name for the xml
            content type)<br/>Not required for ImportCompanies<br/>Required
            settings: Accounts (in CustomerFieldsThatAreSet)<br/><br/>0 =
            PasswordCreateOnly (Value is only set if the entity is created by
            the import)<br>1 = Status<br>2 = StatusCreateOnly (Value is only set
            if the entity is created by the import)<br>3 = Roles<br>4 =
            RolesCreateOnly (Value is only set if the entity is created by the
            import)
          items:
            type: string
            enum:
              - PasswordCreateOnly
              - Status
              - StatusCreateOnly
              - Roles
              - RolesCreateOnly
        JobId:
          type: string
          description: >-
            Norce Commerce Connect job id. Only exists in import logs. Should be
            omitted in the import request.
          format: int32
        SerializationType:
          type: array
          description: >-
            Request serialization type.(Use the integer instead of the name for
            the xml content type)<br/><br/>0 = JSON, 1 = XML
          items:
            type: string
            enum:
              - JSON
              - XML
        StorageName:
          type: string
          description: >-
            Location of the import file on Norce's file area. Can be used
            instead of sending data directly in payload.
          format: uri
        SupplierId:
          type: string
          description: Derived from base header. Ignored in this import.
          format: int32
      format: CustomerHeader
    Account:
      required:
        - ApplicationKey
        - LoginName
      type: object
      properties:
        ApplicationKey:
          type: string
          description: >-
            Application identifier. Determines which application the account
            belongs to.
          format: uuid
        LoginName:
          type: string
          description: Account login name
        Password:
          type: string
          description: Account password
        Roles:
          type: array
          description: List of account roles to assign
          items:
            $ref: '#/components/schemas/AccountRole'
        AccountStatus:
          type: integer
          description: 'Account status: 1 = Active, 2 = Inactive'
          format: int32
      description: Customer account information
      format: Account
    AccountRole:
      required:
        - Code
      type: object
      properties:
        Code:
          type: string
          description: >-
            Unique code of account role (e.g. Administrator, User). The role
            needs to exist in Norce Commerce.
        IsActive:
          type: boolean
          description: Sets account role to active or inactive. Default is true.
      description: Determines what actions account can perform
      format: AccountRole
    Address:
      type: object
      properties:
        AddressLine1:
          type: string
          description: First line of address
        AddressLine2:
          type: string
          description: Second line of address
        CareOf:
          type: string
          description: Care of
        City:
          type: string
          description: City
        Code:
          type: string
          description: >-
            System agnostic identifier for the company or customer. Max length:
            50
        CountryCode:
          type: string
          description: 'ISO country code (e.g. SE, BY). Max length: 2'
        Gln:
          type: string
          description: 'Global Location Number. Max length: 50'
        IsPrimary:
          type: boolean
          description: >-
            Set to true to indicate primary delivery address. Null will not
            change anything. Only one address can be marked primary.
        IsValidated:
          type: boolean
          description: >-
            Set to true to indicate that the address has been validated. Null
            will not change anything.
        Region:
          type: string
          description: Region
        ShippingPhoneNumber:
          type: string
          description: >-
            Phone number for shipping notifications (if used as delivery
            address). Max length: 50
        ZipCode:
          type: string
          description: Zip code
      description: Company or customer address information
      format: Address
    Company:
      required:
        - ApplicationKey
      type: object
      properties:
        ApplicationKey:
          type: string
          description: >-
            Application identifier. Determines which application company belongs
            to.
          format: uuid
        AdditionalInfo:
          type: array
          description: List of additional information fields
          items:
            $ref: '#/components/schemas/Info'
        Code:
          type: string
          description: >-
            Company code. Used for company matching if Norce Commerce company id
            is omitted.
        Contacts:
          type: array
          description: List of company contacts
          items:
            $ref: '#/components/schemas/Contact'
        Customers:
          type: array
          description: >-
            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.
          items:
            $ref: '#/components/schemas/Customer'
        DeliveryAddresses:
          type: array
          description: List of delivery addresses
          items:
            $ref: '#/components/schemas/Address'
        DeliveryMethods:
          type: array
          description: List of delivery methods applicable to company
          items:
            $ref: '#/components/schemas/DeliveryMethod'
        Discounts:
          type: array
          description: List of company discounts
          items:
            $ref: '#/components/schemas/Discount'
        EmailAddress:
          type: string
          description: Contact email address
        Flags:
          type: array
          description: List of company flags
          items:
            $ref: '#/components/schemas/Flag'
        Id:
          type: integer
          description: Norce Commerce's internal company id
          format: int32
        InvoiceAddress:
          $ref: '#/components/schemas/Address'
        IsActive:
          type: boolean
          description: Sets company to active or inactive. Default is true.
        IsCustomerListDelta:
          type: boolean
          description: >-
            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:
          $ref: '#/components/schemas/Image'
        Name:
          type: string
          description: Company name
        OrganizationNo:
          type: string
          description: >-
            Organization number. Used for company matching if Norce Commerce's
            internal company id and company code are omitted and
            `SearchOnlyByCode` is false in header.
        ParentCompanyCode:
          type: string
          description: Can be used for setting parent company (if exists)
        PaymentMethods:
          type: array
          description: List of company payment methods
          items:
            $ref: '#/components/schemas/PaymentMethod'
        PhoneNumber:
          type: string
          description: Contact phone number
        PriceLists:
          type: array
          description: List of company price lists
          items:
            $ref: '#/components/schemas/PriceList'
        VatNo:
          type: string
          description: Vat Number
        UseInvoiceAddressAsDeliveryAddress:
          type: boolean
          description: >-
            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.
      description: Company information
      format: Company
    Contact:
      required:
        - Code
      type: object
      properties:
        Code:
          type: string
          description: Contact code. Used for contact matching.
        IsActive:
          type: boolean
          description: Sets contact to active or inactive. Default true.
      description: Company contact information.
      format: Contact
    Customer:
      type: object
      properties:
        Accounts:
          type: array
          description: List of registered customer accounts
          items:
            $ref: '#/components/schemas/Account'
        AdditionalInfo:
          type: array
          description: List of additional information fields
          items:
            $ref: '#/components/schemas/Info'
        ApplicationKey:
          type: string
          description: >-
            Application identifier. Determines which application company belongs
            to.
          format: uuid
        CellPhoneNumber:
          type: string
          description: Mobile phone number
        Code:
          type: string
          description: >-
            Customer code. Used for customer matching if Norce Commerce's
            internal customer id is omitted.
        Companies:
          type: array
          description: >-
            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.
          items:
            $ref: '#/components/schemas/Company'
        CrmId:
          type: string
          description: Used to save the customer external id from a crm-system
        DeliveryAddresses:
          type: array
          description: Delivery address
          items:
            $ref: '#/components/schemas/Address'
        EmailAddress:
          type: string
          description: >-
            Customer email address. Used for customer matching if Norce Commerce
            customer id and code is omitted and SearchOnlyByCode is false in
            header.
        FirstName:
          type: string
          description: First name
        Flags:
          type: array
          description: Customer flags
          items:
            $ref: '#/components/schemas/Flag'
        Id:
          type: integer
          description: Norce Commerce's internal customer id
          format: int32
        InvoiceAddress:
          $ref: '#/components/schemas/Address'
        IsActive:
          type: boolean
          description: Sets customer to active or inactive. Default is true.
        IsCompanyListDelta:
          type: boolean
          description: >-
            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:
          type: string
          description: Last name
        MiddleName:
          type: string
          description: Middle name
        PhoneNumber:
          type: string
          description: Phone number
        PriceLists:
          type: array
          description: Customer price lists
          items:
            $ref: '#/components/schemas/PriceList'
        SocialSecurityNumber:
          type: string
          description: Social security number
        Title:
          type: string
          description: Title
        Type:
          type: integer
          description: 'Customer type: 1 = Customer, 2 = Company contact'
          format: int32
      description: Customer information
      format: Customer
    DeliveryMethod:
      required:
        - Code
      type: object
      properties:
        Code:
          type: string
          description: Delivery method code
        IsActive:
          type: boolean
          description: Sets delivery method to active or inactive. Default is true.
      description: Company delivery method information
      format: DeliveryMethod
    Discount:
      type: object
      properties:
        DiscountPercentage:
          type: number
          description: Value of the discount (in percent)
        PriceListTypeIdSeed:
          type: string
          description: Comma separated list of price list types
        Type:
          type: string
          description: >-
            Type of discount: 1 = Category, 2 = Product Discount Class, 3 =
            Product Flag
          format: int32
        ValueCode:
          type: string
          description: >-
            Value code, for Category type this is the category code. For
            Discount class its the class identifier used in Norce Commerce.
      description: Discount rules applied to a specific company
      format: Discount
    Flag:
      required:
        - Code
      type: object
      properties:
        Code:
          type: string
          description: Flag code. Used for flag matching.
        IsActive:
          type: boolean
          description: Sets flag to active or inactive. Default is true.
        IsCreateOnly:
          type: boolean
          description: If true, data is only saved if flag record is new. Default is false.
        IsLimitedUpdate:
          type: boolean
          description: >-
            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.
        StopDate:
          type: string
          description: >-
            Sets the stop date explicitly for inactivated flags. Time of process
            is used as default.
          format: DateTime
      description: Company flag
      format: Flag
    Image:
      required:
        - ExternalCode
        - FileTypeName
        - Url
      type: object
      properties:
        ExternalCode:
          type: string
          description: Code for image matching
        FileTypeName:
          type: string
          description: >-
            File type. Should match file info set up in Norce Commerce, e.g.
            MainImage, Additional, Embedded.
        Url:
          type: string
          description: URL where image should be taken from
          format: uri
        Filename:
          type: string
          description: Image file name. If omitted will be parsed form URL.
        LastModified:
          type: string
          description: >-
            Time when image was changed. Should be set to synchronize image
            updates.
          format: DateTime
      description: Image information
      format: Image
    Info:
      required:
        - Code
        - Value
      type: object
      properties:
        Code:
          type: string
          description: Information field code. Used for info matching.
        Value:
          type: string
          description: Value to set
      description: Additional information field
      format: Info
    JobResponse:
      type: object
      properties:
        StatusCode:
          type: string
          description: Status of the job
        Description:
          type: string
          description: Short message describing the job
        JobId:
          type: string
          description: >-
            Norce Commerce's interal id created for this job. Refer to this for
            future requests.
          format: int32
        ValidationSummary:
          $ref: '#/components/schemas/ValidationSummary'
      description: General response for async Connect jobs
      format: JobResponse
    PaymentMethod:
      required:
        - Code
      type: object
      properties:
        Code:
          type: string
          description: Payment method code. Used for payment method matching.
        InvoiceCaptureSettingsCode:
          type: string
          description: Used for specifying the invoice capture setting to use.
        IsActive:
          type: boolean
          description: Sets payment method relation to active or inactive. Default true.
      description: Payment method applied to company
      format: PaymentMethod
    PriceList:
      required:
        - Code
      type: object
      properties:
        Code:
          type: string
          description: Price list code. Used for price list matching.
        IsExclusive:
          type: boolean
          description: >-
            Determines if price list is exclusive, an exclusive price list
            overrides best price calculation in Norce Commerce API.
      description: Customer or company specific price list
      format: PriceList
    ValidationSummary:
      type: object
      properties:
        NrOfItemsInTotal:
          type: integer
          description: Total number of items in payload.
          format: int32
        NrOfValidationFailures:
          type: integer
          description: Number of items that failed initial validation.
          format: int32
        Messages:
          type: array
          description: Messages concerning the validation.
          items:
            type: string
      description: Validation data for accepted payload
      format: ValidationSummary
x-original-swagger-version: '2.0'
