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

# Upsert lot/batch master data.

> Key is (SKU, LotNumber): an existing pair is updated, a new pair is inserted.
Unknown SKUs are skipped (returned in the result), not failed.



## OpenAPI

````yaml /api-reference/openapi.json post /openapi/v1/Lots
openapi: 3.0.1
info:
  title: OmniServices Web API
  version: v1
servers:
  - url: https://api.oplog.one
    description: Production Server
  - url: https://api.staging.oplog.one
    description: Staging Server
security:
  - Authorization: []
paths:
  /openapi/v1/Lots:
    post:
      tags:
        - Lots
      summary: Upsert lot/batch master data.
      description: "Key is (SKU, LotNumber): an existing pair is updated, a new pair is inserted.\r\nUnknown SKUs are skipped (returned in the result), not failed."
      parameters:
        - name: X-Tenant-Id
          in: header
          description: If you want to emulate, please enter TenantId.
          schema:
            type: string
      requestBody:
        content:
          application/json-patch+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/LotRequestDTO'
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/LotRequestDTO'
          text/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/LotRequestDTO'
          application/*+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/LotRequestDTO'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/UpsertLotsCommandResult'
            application/json:
              schema:
                $ref: '#/components/schemas/UpsertLotsCommandResult'
            text/json:
              schema:
                $ref: '#/components/schemas/UpsertLotsCommandResult'
components:
  schemas:
    LotRequestDTO:
      type: object
      properties:
        sku:
          type: string
        lotNumber:
          type: string
        expirationDate:
          type: string
          format: date-time
        productionDate:
          type: string
          format: date-time
        supplierLotNumber:
          type: string
      additionalProperties: false
    UpsertLotsCommandResult:
      required:
        - created
        - updated
      type: object
      properties:
        created:
          type: integer
          format: int32
        updated:
          type: integer
          format: int32
        skippedSkus:
          type: array
          items:
            type: string
      additionalProperties: false
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: Authorization

````