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

# Complete mapping and start processing

> Applies the submitted column mappings, then starts row processing. Omit `mappings`
to accept the auto-assigned ones from the create response. Returns 422 when a
required field is left unmapped (`details.missing_required_fields`).




## OpenAPI

````yaml /api-reference/seller.yaml patch /api/v3/seller/imports/{id}/complete_mapping
openapi: 3.0.3
info:
  title: Seller API
  contact:
    name: Spree Commerce
    url: https://spreecommerce.org
    email: hello@spreecommerce.org
  description: |
    Spree Seller API v3 - the marketplace seller panel, where a seller runs
    their own shop inside someone else's marketplace.

    This is a branch of its own, not a narrowing of the Admin API. Every
    endpoint is scoped server-side to the seller the request acts as, which
    is what makes cross-seller access impossible by construction rather
    than by rule. Sellers never call the Admin API.

    ## Authentication

    Sign in at `POST /api/v3/seller/auth/login` and send the returned JWT as
    `Authorization: Bearer <token>`. The token carries a `seller_api`
    audience — a token minted for the storefront or the back office is not
    accepted here, and vice versa.

    There is deliberately **no secret API key** for this branch: a
    credential that could act as a seller without a seller signing in is
    exactly what the separate audience exists to prevent.

    ### Choosing a seller

    A user may run more than one seller. Login returns the list; send the
    chosen seller's ID in the `X-Spree-Seller-Id` header on every
    authenticated request. The store is derived from the seller — never
    sent — so no header can widen what a seller reaches. A request that
    names no seller the caller belongs to is rejected with `403`.

    ## Response Format

    All responses are JSON. List endpoints return paginated responses with
    `data` and `meta` keys.

    ## Error Handling

    Errors return a consistent format:
    ```json
    {
      "error": {
        "code": "validation_error",
        "message": "Validation failed",
        "details": { "name": ["can't be blank"] }
      }
    }
    ```
  version: v3
servers:
  - url: http://{defaultHost}
    variables:
      defaultHost:
        default: localhost:3000
security: []
tags:
  - name: Authentication
    description: Seller sign-in, token refresh, logout, and invitation acceptance
  - name: Account
    description: The signed-in user, the sellers they may act for, and what they may do
  - name: Countries
    description: Country and state reference data for the panel's address forms
  - name: Delivery Methods
    description: >-
      The seller's own ways to ship, and the marketplace methods shared with
      them
  - name: Delivery Profiles
    description: >-
      The marketplace's delivery vocabulary — what kind of goods a product is,
      which decides how it ships
  - name: Delivery Zones
    description: >-
      The marketplace's destinations, for narrowing where a seller's own method
      ships
  - name: Onboarding
    description: >-
      The marketplace checklist a seller completes before admission, and what
      they submit against it
  - name: Policies
    description: The seller's own legal documents, as the marketplace asks them to publish
  - name: Product Types
    description: The types a seller may list a product against, and what each adds
  - name: Products
    description: The seller's own catalog
  - name: Profile
    description: >-
      The seller's own record — presentation, contact details, addresses, and
      tax registration
  - name: Stock Locations
    description: Where the seller keeps stock, and so where their returns are sent
  - name: Team
    description: Who runs this seller, and the invitations nobody has accepted yet
  - name: Files
    description: Uploading the files a profile, a submission or an import uses
paths:
  /api/v3/seller/imports/{id}/complete_mapping:
    parameters:
      - name: id
        in: path
        required: true
        description: Import prefixed ID
        schema:
          type: string
    patch:
      tags:
        - Imports
      summary: Complete mapping and start processing
      description: >
        Applies the submitted column mappings, then starts row processing. Omit
        `mappings`

        to accept the auto-assigned ones from the create response. Returns 422
        when a

        required field is left unmapped (`details.missing_required_fields`).
      parameters:
        - name: X-Spree-Seller-Id
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportCompleteMappingParams'
      responses:
        '200':
          description: mapping completed, processing queued
          content:
            application/json:
              example:
                id: imp_UkLWZg9DAJ
                number: IM1001
                rows_count: 0
                created_at: '2026-01-15T12:00:00.000Z'
                updated_at: '2026-01-15T12:00:00.000Z'
                type: products
                status: completed_mapping
                store_id: store_UkLWZg9DAJ
                seller_id: sel_UkLWZg9DAJ
                user_id: adm_UkLWZg9DAJ
                processing_errors: null
                delimiter: ','
                original_filename: products_import.csv
                original_byte_size: 3627
                original_file_url: /api/v3/seller/imports/imp_UkLWZg9DAJ/download
                completed_rows_count: 0
                failed_rows_count: 0
                schema_fields:
                  - name: slug
                    label: Slug
                    required: true
                  - name: sku
                    label: SKU
                    required: true
                  - name: name
                    label: Name
                    required: true
                  - name: price
                    label: Price
                    required: true
                  - name: status
                    label: Status
                    required: false
                  - name: description
                    label: Description
                    required: false
                  - name: meta_title
                    label: Meta Title
                    required: false
                  - name: meta_description
                    label: Meta Description
                    required: false
                  - name: meta_keywords
                    label: Meta Keywords
                    required: false
                  - name: tags
                    label: Tags
                    required: false
                  - name: compare_at_price
                    label: Compare at Price
                    required: false
                  - name: currency
                    label: Currency
                    required: false
                  - name: width
                    label: Width
                    required: false
                  - name: height
                    label: Height
                    required: false
                  - name: depth
                    label: Depth
                    required: false
                  - name: dimensions_unit
                    label: Dimensions Unit
                    required: false
                  - name: weight
                    label: Weight
                    required: false
                  - name: weight_unit
                    label: Weight Unit
                    required: false
                  - name: available_on
                    label: Available On
                    required: false
                  - name: discontinue_on
                    label: Discontinue On
                    required: false
                  - name: track_inventory
                    label: Track Inventory
                    required: false
                  - name: inventory_count
                    label: Inventory Count
                    required: false
                  - name: inventory_backorderable
                    label: Inventory Backorderable
                    required: false
                  - name: stock_location
                    label: Stock Location
                    required: false
                  - name: tax_category
                    label: Tax Category
                    required: false
                  - name: product_type
                    label: Product Type
                    required: false
                  - name: hs_code
                    label: HS Code
                    required: false
                  - name: country_of_origin
                    label: Country of Origin
                    required: false
                  - name: customs_description
                    label: Customs Description
                    required: false
                  - name: carton
                    label: Carton
                    required: false
                  - name: units_per_carton
                    label: Units per Carton
                    required: false
                  - name: carton_weight
                    label: Carton Weight
                    required: false
                  - name: cartons_per_pallet
                    label: Cartons per Pallet
                    required: false
                  - name: image1_src
                    label: Image 1 URL
                    required: false
                  - name: image2_src
                    label: Image 2 URL
                    required: false
                  - name: image3_src
                    label: Image 3 URL
                    required: false
                  - name: option1_name
                    label: Option 1 Name
                    required: false
                  - name: option1_value
                    label: Option 1 Value
                    required: false
                  - name: option2_name
                    label: Option 2 Name
                    required: false
                  - name: option2_value
                    label: Option 2 Value
                    required: false
                  - name: option3_name
                    label: Option 3 Name
                    required: false
                  - name: option3_value
                    label: Option 3 Value
                    required: false
                  - name: category1
                    label: Category 1
                    required: false
                  - name: category2
                    label: Category 2
                    required: false
                  - name: category3
                    label: Category 3
                    required: false
                csv_headers: []
                sample_row: {}
                mappings:
                  - id: immap_UkLWZg9DAJ
                    schema_field: slug
                    file_column: slug
                    required: true
                  - id: immap_gbHJdmfrXB
                    schema_field: sku
                    file_column: sku
                    required: true
                  - id: immap_EfhxLZ9ck8
                    schema_field: name
                    file_column: name
                    required: true
                  - id: immap_VqXmZF31wY
                    schema_field: price
                    file_column: price
                    required: true
                  - id: immap_uw2YK1rnl0
                    schema_field: status
                    file_column: status
                    required: false
                  - id: immap_OIJLhNcSbf
                    schema_field: description
                    file_column: description
                    required: false
                  - id: immap_AXs1igzRC6
                    schema_field: meta_title
                    file_column: meta_title
                    required: false
                  - id: immap_p6klVeMgbn
                    schema_field: meta_description
                    file_column: meta_description
                    required: false
                  - id: immap_nJqfPa3Cpe
                    schema_field: meta_keywords
                    file_column: meta_keywords
                    required: false
                  - id: immap_98FqgRua4h
                    schema_field: tags
                    file_column: tags
                    required: false
                  - id: immap_xhoCpeNMWu
                    schema_field: compare_at_price
                    file_column: compare_at_price
                    required: false
                  - id: immap_vEmzDoNU0H
                    schema_field: currency
                    file_column: currency
                    required: false
                  - id: immap_2KY5XM6frI
                    schema_field: width
                    file_column: width
                    required: false
                  - id: immap_HOVtlDrOmL
                    schema_field: height
                    file_column: height
                    required: false
                  - id: immap_ed6l8wVqSM
                    schema_field: depth
                    file_column: depth
                    required: false
                  - id: immap_s18jaGonyx
                    schema_field: dimensions_unit
                    file_column: dimensions_unit
                    required: false
                  - id: immap_GZUcnUYI5A
                    schema_field: weight
                    file_column: weight
                    required: false
                  - id: immap_ROeNhrwyV9
                    schema_field: weight_unit
                    file_column: weight_unit
                    required: false
                  - id: immap_L3pHOn63Vw
                    schema_field: available_on
                    file_column: available_on
                    required: false
                  - id: immap_PQNMcnNFWw
                    schema_field: discontinue_on
                    file_column: discontinue_on
                    required: false
                  - id: immap_C9SrJgpzQ4
                    schema_field: track_inventory
                    file_column: track_inventory
                    required: false
                  - id: immap_YHETxCGlb0
                    schema_field: inventory_count
                    file_column: inventory_count
                    required: false
                  - id: immap_5OQZnCRf8J
                    schema_field: inventory_backorderable
                    file_column: inventory_backorderable
                    required: false
                  - id: immap_F0GX8NaP3Y
                    schema_field: stock_location
                    file_column: null
                    required: false
                  - id: immap_kOKT9MVfb0
                    schema_field: tax_category
                    file_column: tax_category
                    required: false
                  - id: immap_3uWpPTcf5W
                    schema_field: product_type
                    file_column: null
                    required: false
                  - id: immap_D6Psx31WaT
                    schema_field: hs_code
                    file_column: null
                    required: false
                  - id: immap_msx3nOJap6
                    schema_field: country_of_origin
                    file_column: null
                    required: false
                  - id: immap_5CQZnCRf8J
                    schema_field: customs_description
                    file_column: null
                    required: false
                  - id: immap_M2nyloHRUQ
                    schema_field: carton
                    file_column: null
                    required: false
                  - id: immap_prklVeMgbn
                    schema_field: units_per_carton
                    file_column: null
                    required: false
                  - id: immap_so8jaGonyx
                    schema_field: carton_weight
                    file_column: null
                    required: false
                  - id: immap_rsClYtECFI
                    schema_field: cartons_per_pallet
                    file_column: null
                    required: false
                  - id: immap_8DR0I7fEbw
                    schema_field: image1_src
                    file_column: image1_src
                    required: false
                  - id: immap_aAtNvLSUAr
                    schema_field: image2_src
                    file_column: image2_src
                    required: false
                  - id: immap_QiA48cIW7A
                    schema_field: image3_src
                    file_column: image3_src
                    required: false
                  - id: immap_QDA48cIW7A
                    schema_field: option1_name
                    file_column: option1_name
                    required: false
                  - id: immap_8cR0I7fEbw
                    schema_field: option1_value
                    file_column: option1_value
                    required: false
                  - id: immap_oqlrKdXjaP
                    schema_field: option2_name
                    file_column: option2_name
                    required: false
                  - id: immap_48Olu6p4zZ
                    schema_field: option2_value
                    file_column: option2_value
                    required: false
                  - id: immap_qp31JYFduR
                    schema_field: option3_name
                    file_column: option3_name
                    required: false
                  - id: immap_JgaEBgznCp
                    schema_field: option3_value
                    file_column: option3_value
                    required: false
                  - id: immap_tXyJwvFCuK
                    schema_field: category1
                    file_column: category1
                    required: false
                  - id: immap_NJzXvxTk8u
                    schema_field: category2
                    file_column: category2
                    required: false
                  - id: immap_XLbb5HTmVa
                    schema_field: category3
                    file_column: category3
                    required: false
              schema:
                $ref: '#/components/schemas/Import'
      security:
        - bearer_auth: []
      x-codeSamples:
        - lang: javascript
          label: Spree Seller SDK
          source: >-
            import { createSellerClient } from '@spree/seller-sdk'


            const client = createSellerClient({
              baseUrl: 'https://your-store.com',
              jwtToken: 'eyJhbGciOi...',
              sellerId: 'sel_UkLWZg9DAJ',
            })


            const productImport = await
            client.imports.completeMapping('imp_UkLWZg9DAJ', {
              mappings: [{ schema_field: 'name', file_column: 'Product name' }],
            })
components:
  schemas:
    ImportCompleteMappingParams:
      type: object
      properties:
        mappings:
          type: array
          items:
            type: object
            properties:
              schema_field:
                type: string
                description: Canonical schema field name.
              file_column:
                type: string
                description: CSV header to read the field from; `null` unmaps the field.
                nullable: true
            required:
              - schema_field
              - file_column
          description: Column assignments to apply before processing starts.
    Import:
      type: object
      properties:
        id:
          type: string
        number:
          type: string
        rows_count:
          type: number
        created_at:
          type: string
        updated_at:
          type: string
        type:
          type: string
          nullable: true
          description: >-
            Import type. Built-in: products, product_translations, customers,
            price_list_prices. Extensions may register more.
        status:
          anyOf:
            - type: string
              enum:
                - pending
                - mapping
                - completed_mapping
                - processing
                - completed
                - failed
            - type: string
          description: The values listed are the built-in ones; extensions may add more.
        store_id:
          type: string
          nullable: true
        seller_id:
          type: string
          nullable: true
        user_id:
          type: string
          nullable: true
        processing_errors:
          type: string
          nullable: true
        delimiter:
          type: string
        original_filename:
          type: string
          nullable: true
        original_byte_size:
          type: number
          nullable: true
        original_file_url:
          type: string
          nullable: true
        completed_rows_count:
          type: number
        failed_rows_count:
          type: number
        schema_fields:
          type: array
          items:
            $ref: '#/components/schemas/ImportSchemaField'
        csv_headers:
          type: array
          items:
            type: string
        sample_row:
          type: object
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/ImportMapping'
      required:
        - id
        - number
        - rows_count
        - created_at
        - updated_at
        - type
        - status
        - store_id
        - seller_id
        - user_id
        - processing_errors
        - delimiter
        - original_filename
        - original_byte_size
        - original_file_url
        - completed_rows_count
        - failed_rows_count
        - schema_fields
        - csv_headers
        - sample_row
        - mappings
      x-typelizer: true
    ImportSchemaField:
      type: object
      description: >-
        A canonical column of an import type, including per-store custom field
        columns
      properties:
        name:
          type: string
          description: Canonical field name used in mappings
          example: slug
        label:
          type: string
          description: Human-readable label
          example: Slug
        required:
          type: boolean
          description: Whether the field must be mapped before processing
      required:
        - name
        - label
        - required
    ImportMapping:
      type: object
      properties:
        id:
          type: string
        schema_field:
          type: string
        file_column:
          type: string
          nullable: true
        required:
          type: boolean
      required:
        - id
        - schema_field
        - file_column
        - required
      x-typelizer: true
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token for an authenticated seller session (`seller_api` audience)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.