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

# Import raw competitor CSVs

> Store raw competitor prices, with optional automatic catalog matching.

Upload one UTF-8 raw CSV with `country_code` and `currency`, using your Public API bearer key and a UUID `Idempotency-Key`.

```bash theme={null}
curl -X POST "$RETAILGRID_API_URL/v1/matching/raw-imports" \
  -H "Authorization: Bearer $RETAILGRID_API_KEY" \
  -H "Idempotency-Key: $REQUEST_UUID" \
  -F "file=@competitors.csv" -F "country_code=ES" -F "currency=EUR"
```

Country and currency are required two-letter and three-letter codes, normalized to uppercase. The header must fit within 64 KiB and omit `item_id`, `external_match_id`, `match_relation`, `match_method`, and `match_confidence`. Use the existing raw competitor CSV format. Already matched files belong on `matched-snapshots`.

The entire multipart request is limited to 25 MiB, including overhead. Coverage/removal fields do not apply to raw imports. A successful request returns `202` and `job_id`. Poll [`GET /v1/matching/jobs/{job_id}/progress`](https://docs.retailgrid.io/api-reference/matching/get-progress). By default (`match_catalog=true`), this synchronizes the catalog and runs automatic matching. To store data for later matching, add `-F "match_catalog=false"` to the request. Load-only imports do not synchronize or require a catalog and do not launch matching. Every valid raw row remains in Price Radar, even without a catalog match. Results include counts and at most 200 rejection samples.

Existing raw CSV validation still applies: an import with more than 2% invalid rows fails rather than committing a partial dataset.

For load-only imports, `result_summary.stored` counts stored valid rows, `accepted` equals `stored`, `rejected` counts invalid input rows only, and `sent` equals `stored + rejected`. `row_errors` contains invalid-row diagnostics; unmatched rows are not rejections. With matching enabled, existing accepted/rejected semantics remain unchanged and `stored` is omitted. Loading raw rows does not create matches or refresh grid prices; match the stored data later to publish those effects.

One organization-wide matching upload runs at a time; a different concurrent upload returns `409`. An identical retry returns the same job without another matching run. Reusing a key with different file bytes, market options, or `match_catalog` returns `409`. Receipt bindings are retained indefinitely. Abandoned admissions without a job expire after 24 hours, their files are removed by maintenance, and the same key returns `410`; use a new key. Terminal job file cleanup follows the existing worker lifecycle. Authentication failures return `401`, oversize requests `413`, and invalid headers/market fields `422`. Check the job's terminal status even after `202`.


## OpenAPI

````yaml POST /v1/matching/raw-imports
openapi: 3.1.0
info:
  title: Retailgrid Public API
  version: v1
servers: []
security: []
paths:
  /v1/matching/raw-imports:
    post:
      tags:
        - matching
      summary: Import Raw Matches
      operationId: import_raw_matches_v1_matching_raw_imports_post
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            format: uuid
            title: Idempotency-Key
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_import_raw_matches_v1_matching_raw_imports_post
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobHandle'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_import_raw_matches_v1_matching_raw_imports_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
        country_code:
          type: string
          title: Country Code
        currency:
          type: string
          title: Currency
      type: object
      required:
        - file
        - country_code
        - currency
      title: Body_import_raw_matches_v1_matching_raw_imports_post
    JobHandle:
      properties:
        job_id:
          type: string
          format: uuid
          title: Job Id
      additionalProperties: false
      type: object
      required:
        - job_id
      title: JobHandle
      description: |-
        Minimal handle returned by async enqueue endpoints.

        The full job status is fetched separately via ``GET /v1/jobs/{id}``.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

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