> ## Documentation Index
> Fetch the complete documentation index at: https://help.lobyco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import chains

> Imports chains from .csv file. Will totally replace all chains with new ones. If invalid chain row passed, it won't be imported.
Expected CSV columns:       
- Id*: string - Identifier of chain, to which store belongs
- Name*: string - Name of store chain
- LogoAssetId*: string - Identifier of logo asset identifier. Asset identifier is returned back by POST assets/{path} endpoint
- Color: string - chain color
- LogoWhiteAssetId: string - Identifier of white logo asset identifier
- PinIconAssetId: string - Identifier of pin icon asset identifier

Import modes:
- Incremental (Default): Adds new and updates an existing chains.
- Full: Fully reload all the chains. New chains will be added, existing - updated, and missing - deleted.



## OpenAPI

````yaml openapi/store-v3.json POST /v3/Chains/import
openapi: 3.0.4
info:
  title: StoreApi - V3
  version: v3
servers:
  - url: https://{host}/store
    description: Your Lobyco environment
    variables:
      host:
        default: your-environment.lobyco.net
        description: >-
          The API host for your Lobyco environment. Replace it with the host you
          were given — this placeholder does not resolve.
security:
  - oauth2: []
paths:
  /v3/Chains/import:
    post:
      tags:
        - Service2Service
      summary: Import chains
      description: >-
        Imports chains from .csv file. Will totally replace all chains with new
        ones. If invalid chain row passed, it won't be imported.

        Expected CSV columns:       

        - Id*: string - Identifier of chain, to which store belongs

        - Name*: string - Name of store chain

        - LogoAssetId*: string - Identifier of logo asset identifier. Asset
        identifier is returned back by POST assets/{path} endpoint

        - Color: string - chain color

        - LogoWhiteAssetId: string - Identifier of white logo asset identifier

        - PinIconAssetId: string - Identifier of pin icon asset identifier


        Import modes:

        - Incremental (Default): Adds new and updates an existing chains.

        - Full: Fully reload all the chains. New chains will be added, existing
        - updated, and missing - deleted.
      parameters:
        - name: mode
          in: query
          description: Import mode
          schema:
            $ref: '#/components/schemas/ImportMode'
      requestBody:
        description: List of chains to import
        content:
          application/json-patch+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CsvImportChainItemDto'
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CsvImportChainItemDto'
          text/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CsvImportChainItemDto'
          application/*+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CsvImportChainItemDto'
      responses:
        '207':
          description: >-
            In case if chains were imported. Status code assumes that imported
            chains may have different import result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResult'
        '400':
          description: >-
            In case if there is no input file, file is empty or invalid header
            found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebServiceError'
components:
  schemas:
    ImportMode:
      enum:
        - Incremental
        - Full
      type: string
    CsvImportChainItemDto:
      required:
        - id
        - isAvailableForStoreSelection
        - logoAssetId
        - name
      type: object
      properties:
        id:
          maxLength: 450
          minLength: 1
          type: string
        name:
          maxLength: 256
          minLength: 1
          type: string
        logoAssetId:
          maxLength: 256
          minLength: 1
          type: string
        logoAliasAssetId:
          maxLength: 256
          type: string
          nullable: true
        color:
          type: string
          nullable: true
        pinIconAssetId:
          type: string
          nullable: true
        logoWhiteAssetId:
          type: string
          nullable: true
        displayOrder:
          type: integer
          format: int32
          nullable: true
        isAvailableForStoreSelection:
          type: boolean
      additionalProperties: false
    ImportResult:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/WebServiceError'
          nullable: true
      additionalProperties: false
    WebServiceError:
      required:
        - message
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
        message:
          minLength: 1
          type: string
        details:
          nullable: true
      additionalProperties: false
  securitySchemes:
    oauth2:
      type: apiKey
      name: Authorization
      in: header

````