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

# Import SKUs using CSV

> Import SKUs into the repository using a CSV file.

The CSV file has to include headers in the first line. All properties which cannot be mapped to standard SKU fields will be added to the metadata object. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b98d08c9b585083488a4c/Import_SKUS_template.csv). 

> 🚧 Import sequence
>
> First import products using the [dedicated endpoint](/api-reference/products/import-products-using-csv), then import SKUs using this endpoint to properly match SKUs to products.



> 📘 Standard SKU fields mapping
>
> - **Required** fields are `source_id` and `product_id`.
> - Supported CSV file headers: `product_id,sku,source_id,price,image_url,attributes`
> - SKU **source_id** must be unique in the entire product catalog, no duplicates are allowed.
> - SKU attributes need to be in the form of a stringy-fied json, i.e.`"{'color':'blue'}"`. These attributes must be defined in the **product** beforehand so you can import them to the SKU.
> - You can use this method to update the following parameters in bulk: **sku** and the sku **price**.
> - Columns that cannot be mapped to standard fields will be mapped to Custom attributes and added as product metadata. There is no limit on the number of custom attributes that you can import as metadata.

This API request starts a process that affects Voucherify data in bulk. 

In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. 

The result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).



## OpenAPI

````yaml /openapi/products.json post /v1/skus/importCSV
openapi: 3.0.1
info:
  title: Voucherify API - Products
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /v1/skus/importCSV:
    post:
      tags:
        - Products
      summary: Import SKUs using CSV
      description: >-
        Import SKUs into the repository using a CSV file.


        The CSV file has to include headers in the first line. All properties
        which cannot be mapped to standard SKU fields will be added to the
        metadata object. You can find an example template
        [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b98d08c9b585083488a4c/Import_SKUS_template.csv). 


        > 🚧 Import sequence

        >

        > First import products using the [dedicated
        endpoint](/api-reference/products/import-products-using-csv), then
        import SKUs using this endpoint to properly match SKUs to products.




        > 📘 Standard SKU fields mapping

        >

        > - **Required** fields are `source_id` and `product_id`.

        > - Supported CSV file headers:
        `product_id,sku,source_id,price,image_url,attributes`

        > - SKU **source_id** must be unique in the entire product catalog, no
        duplicates are allowed.

        > - SKU attributes need to be in the form of a stringy-fied json,
        i.e.`"{'color':'blue'}"`. These attributes must be defined in the
        **product** beforehand so you can import them to the SKU.

        > - You can use this method to update the following parameters in bulk:
        **sku** and the sku **price**.

        > - Columns that cannot be mapped to standard fields will be mapped to
        Custom attributes and added as product metadata. There is no limit on
        the number of custom attributes that you can import as metadata.


        This API request starts a process that affects Voucherify data in bulk. 


        In case of small jobs (like bulk update) the request is put into a queue
        and processed once every other bulk request placed in the queue prior to
        this request is finished. However, when the job takes a longer time
        (like vouchers generation) then it is processed in small portions in a
        round-robin fashion. When there is a list of vouchers generation
        scheduled, then they will all have the `IN_PROGRESS` status shortly.
        This way, small jobs added just after scheduling big jobs of the same
        type will be processed in a short time window. 


        The result will return the async ID. You can verify the status of your
        request via this [API
        request](/api-reference/async-actions/get-async-action).
      operationId: import-SKUs-using-csv
      parameters: []
      requestBody:
        description: The file path is stored in the form `file` header.
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SkusImportCSVRequestBody'
        required: true
      responses:
        '200':
          description: >-
            Returns ID of the scheduled async action. The response informs you
            that your request has been accepted and SKUs will be added to the
            repository asynchronously. To check the import status and result,
            copy the `async_action_id` from the response and pass it using the
            [Get Async Action](/api-reference/async-actions/get-async-action)
            endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkusImportCsvCreateResponseBody'
              examples:
                Async Action:
                  value:
                    async_action_id: aa_0a875d56c805df6601
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - skus
components:
  schemas:
    SkusImportCSVRequestBody:
      type: object
      title: Skus Import Csv Request Body
      description: Response body schema for **POST** `v1/skus/importCSV`.
      allOf:
        - $ref: '#/components/schemas/ImportCSVRequestBody'
    SkusImportCsvCreateResponseBody:
      type: object
      title: Skus Import Csv Create Response Body
      description: Response body schema for **POST** `v1/skus/importCSV`.
      allOf:
        - $ref: '#/components/schemas/AsyncActions'
    ImportCSVRequestBody:
      type: object
      title: Import CSV file
      description: Request body schema for importing data using a CSV file.
      format: binary
      properties:
        file:
          type: string
          format: binary
          description: File path.
      required:
        - file
    AsyncActions:
      type: object
      title: Asynchronous Actions
      description: Response to requests that are processed asynchronously.
      properties:
        async_action_id:
          type: string
          example: aa_0a875d56c805df6601
          description: The ID of the scheduled asynchronous action.
      required:
        - async_action_id
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    X-Voucherify-OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://api.voucherify.io/v1/oauth/token
          scopes:
            api: Gives access to whole server-side API.
            vouchers: >-
              Gives access to all endpoints and methods starting with
              `v1/vouchers`.
            client_api: Gives access to whole client-side API.
            client_vouchers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/vouchers`.
            promotions: >-
              Gives access to all endpoints and methods starting with
              `/v1/promotions`.
            client_promotions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/promotions`
            campaigns: >-
              Gives access to all endpoints and methods starting with
              `v1/campaigns`.
            client_publish: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/publish`.
            exports: >-
              Gives access to all endpoints and methods starting with
              `/v1/exports`.
            publications: >-
              Gives access to all endpoints and methods starting with
              `/v1/publications`.
            client_validate: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validate`.
            validations: >-
              Gives access to all endpoints and methods starting with
              `/v1/validations`.
            client_validations: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validations`.
            qualifications: >-
              Gives access to all endpoints and methods starting with
              `/v1/qualifications`.
            client_qualifications: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/qualifications`.
            client_redeem: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redeem
            redemptions: >-
              Gives access to all endpoints and methods starting with
              `/v1/redemptions`.
            client_redemptions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redemptions`
            customers: >-
              Gives access to all endpoints and methods starting with
              `/v1/customers`.
            client_customers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/customers`.
            orders: >-
              Gives access to all endpoints and methods starting with
              `/v1/orders`.
            products: >-
              Gives access to all endpoints and methods starting with
              `/v1/products`.
            skus: >-
              Gives access to all endpoints and methods starting with
              `/v1/SKUs`.
            validation-rules: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules`.
            validation-rules-assignments: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules-assignments
            segments: >-
              Gives access to all endpoints and methods starting with
              `/v1/segments`.
            events: >-
              Gives access to all endpoints and methods starting with
              `/v1/events`.
            client_events: >-
              Gives access to all endpoints and methods starting with
              `client/v1/events`.
            rewards: >-
              Gives access to all endpoints and methods starting with
              `/v1/rewards`.
            assets: >-
              Gives access to all endpoints and methods starting with
              `/v1/assets`.
            task-results: >-
              Gives access to all endpoints and methods starting with
              `/v1/task-results`.
            loyalties: >-
              Gives access to all endpoints and methods starting with
              `/v1/loyalties`.
            client_consents: >-
              Gives access to all endpoints and methods starting with
              `client/v1/consents`.
            consents: >-
              Gives access to all endpoints and methods starting with
              `/v1/consents`.
            async-actions: >-
              Gives access to all endpoints and methods starting with
              `/v1/async-actions`.
            product-collections: >-
              Gives access to all endpoints and methods starting with
              `/v1/product-collections`.
            categories: >-
              Gives access to all endpoints and methods starting with
              `/v1/categories`.
            metadata-schemas: >-
              Gives access to all endpoints and methods starting with
              `/v1/metadata-schemas`.
            locations: >-
              Gives access to all endpoints and methods starting with
              `/v1/locations`.
            referrals: >-
              Gives access to all endpoints and methods starting with
              `/v1/referrals`.
            trash-bin: >-
              Gives access to all endpoints and methods starting with
              `/v1/trash-bin`.
            templates: >-
              Gives access to all endpoints and methods starting with
              `/v1/templates`.

````