> ## 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.

# Public Add Matches



## OpenAPI

````yaml https://clientapi.retailgrid.io/openapi.json post /v1/matching/matches:batch-add
openapi: 3.1.0
info:
  title: Retailgrid Public API
  version: v1
servers: []
security: []
paths:
  /v1/matching/matches:batch-add:
    post:
      tags:
        - matching
      summary: Public Add Matches
      operationId: public_add_matches_v1_matching_matches_batch_add_post
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            format: uuid
            title: Idempotency-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddMatches'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddedMatches'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AddMatches:
      properties:
        pairs:
          items:
            $ref: '#/components/schemas/MatchPair'
          type: array
          maxItems: 500
          minItems: 1
          title: Pairs
      additionalProperties: false
      type: object
      required:
        - pairs
      title: AddMatches
    AddedMatches:
      properties:
        external_org_id:
          type: string
          format: uuid
          title: External Org Id
        request_id:
          type: string
          title: Request Id
        results:
          items:
            $ref: '#/components/schemas/AddedMatch'
          type: array
          maxItems: 500
          title: Results
        counts:
          additionalProperties:
            type: integer
          type: object
          title: Counts
      type: object
      required:
        - external_org_id
        - request_id
        - results
        - counts
      title: AddedMatches
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MatchPair:
      properties:
        rg_item_id:
          type: string
          maxLength: 128
          minLength: 1
          pattern: ^\S(?:.*\S)?$
          title: Rg Item Id
        competitor_product_id:
          type: string
          maxLength: 36
          minLength: 1
          title: Competitor Product Id
        relation:
          type: string
          enum:
            - direct
            - substitute
          title: Relation
          default: direct
      additionalProperties: false
      type: object
      required:
        - rg_item_id
        - competitor_product_id
      title: MatchPair
    AddedMatch:
      properties:
        outcome:
          type: string
          enum:
            - created
            - restored
            - unchanged
          title: Outcome
        match:
          $ref: '#/components/schemas/LiveMatch'
      type: object
      required:
        - outcome
        - match
      title: AddedMatch
    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
    LiveMatch:
      properties:
        match_id:
          type: string
          title: Match Id
        version:
          type: integer
          exclusiveMinimum: 0
          title: Version
        rg_item_id:
          type: string
          title: Rg Item Id
        competitor_product_id:
          type: string
          title: Competitor Product Id
        competitor:
          $ref: '#/components/schemas/MatchCompetitor'
        product:
          $ref: '#/components/schemas/MatchProduct'
        match:
          $ref: '#/components/schemas/MatchEvidence'
        offer:
          anyOf:
            - $ref: '#/components/schemas/MatchOffer'
            - type: 'null'
        matched_at:
          type: string
          title: Matched At
        our_product:
          anyOf:
            - type: string
            - type: 'null'
          title: Our Product
        our_details:
          anyOf:
            - $ref: '#/components/schemas/MatchTarget'
            - type: 'null'
      type: object
      required:
        - match_id
        - version
        - rg_item_id
        - competitor_product_id
        - competitor
        - product
        - match
        - offer
        - matched_at
      title: LiveMatch
    MatchCompetitor:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        name:
          type: string
          title: Name
        domain:
          type: string
          title: Domain
      type: object
      required:
        - id
        - name
        - domain
      title: MatchCompetitor
    MatchProduct:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        url:
          type: string
          title: Url
        sku:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku
        barcode:
          anyOf:
            - type: string
            - type: 'null'
          title: Barcode
        brand:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand
        size:
          anyOf:
            - type: string
            - type: 'null'
          title: Size
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
      type: object
      required:
        - name
        - url
        - sku
        - barcode
        - brand
        - size
        - unit
        - image_url
      title: MatchProduct
    MatchEvidence:
      properties:
        relation:
          type: string
          enum:
            - direct
            - substitute
            - unknown
          title: Relation
        method:
          anyOf:
            - type: string
            - type: 'null'
          title: Method
        confidence:
          anyOf:
            - type: number
            - type: 'null'
          title: Confidence
        is_manual:
          type: boolean
          title: Is Manual
      type: object
      required:
        - relation
        - method
        - confidence
        - is_manual
      title: MatchEvidence
    MatchOffer:
      properties:
        price:
          anyOf:
            - $ref: '#/components/schemas/MatchMoney'
            - type: 'null'
        regular_price:
          anyOf:
            - $ref: '#/components/schemas/MatchMoney'
            - type: 'null'
        promo_price:
          anyOf:
            - $ref: '#/components/schemas/MatchMoney'
            - type: 'null'
        availability:
          type: string
          title: Availability
        observed_at:
          type: string
          title: Observed At
        assurance:
          type: string
          title: Assurance
      type: object
      required:
        - price
        - regular_price
        - promo_price
        - availability
        - observed_at
        - assurance
      title: MatchOffer
    MatchTarget:
      properties:
        item_id:
          type: string
          title: Item Id
        name:
          type: string
          title: Name
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        price:
          anyOf:
            - type: number
            - type: 'null'
          title: Price
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        brand:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand
        barcode:
          anyOf:
            - type: string
            - type: 'null'
          title: Barcode
        sku:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku
        size:
          anyOf:
            - type: string
            - type: 'null'
          title: Size
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        variant_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Variant Name
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        product_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Url
        stock:
          anyOf:
            - type: number
            - type: 'null'
          title: Stock
      type: object
      required:
        - item_id
        - name
      title: MatchTarget
    MatchMoney:
      properties:
        amount:
          type: string
          title: Amount
        currency:
          type: string
          title: Currency
      type: object
      required:
        - amount
        - currency
      title: MatchMoney

````

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