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

# Bulk add or update ReceivingOrders.

> An order whose referenceNumber already exists is updated in place (line items only);
otherwise it is created. Always returns 200; orders that cannot be updated are reported
in updateFailures.



## OpenAPI

````yaml /api-reference/openapi.json post /openapi/v1/ReceivingOrders/BulkUpsert
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/ReceivingOrders/BulkUpsert:
    post:
      tags:
        - ReceivingOrders
      summary: Bulk add or update ReceivingOrders.
      description: "An order whose referenceNumber already exists is updated in place (line items only);\r\notherwise it is created. Always returns 200; orders that cannot be updated are reported\r\nin updateFailures."
      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/CreateReceivingOrderRequestDTO'
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CreateReceivingOrderRequestDTO'
          text/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CreateReceivingOrderRequestDTO'
          application/*+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CreateReceivingOrderRequestDTO'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/BulkUpsertReceivingOrdersResponseDTO'
            application/json:
              schema:
                $ref: '#/components/schemas/BulkUpsertReceivingOrdersResponseDTO'
            text/json:
              schema:
                $ref: '#/components/schemas/BulkUpsertReceivingOrdersResponseDTO'
components:
  schemas:
    CreateReceivingOrderRequestDTO:
      required:
        - lineItems
        - receiveType
        - transferType
      type: object
      properties:
        integrationId:
          type: string
          format: uuid
        referenceNumber:
          type: string
        receiveType:
          $ref: '#/components/schemas/ReceiveType'
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/CreateReceivingOrderLineItemInputDTO'
        lineItemLotNumbers:
          type: array
          items:
            $ref: '#/components/schemas/CreateReceivingOrderLineItemLotNumberInputDTO'
        transferType:
          $ref: '#/components/schemas/ReceivingOrderTransferType'
        cargoTransfer:
          $ref: '#/components/schemas/CargoTransferDTO'
        pickupTransfer:
          $ref: '#/components/schemas/PickupTransferDTO'
        carriageTransfer:
          $ref: '#/components/schemas/CarriageTransferDTO'
      additionalProperties: false
    BulkUpsertReceivingOrdersResponseDTO:
      type: object
      properties:
        updateFailures:
          type: array
          items:
            $ref: '#/components/schemas/BulkUpsertReceivingOrdersFailureResponseDTO'
          nullable: true
      additionalProperties: false
    ReceiveType:
      enum:
        - Standard
        - Deducted
        - Return
      type: string
    CreateReceivingOrderLineItemInputDTO:
      required:
        - expectedQuantity
        - hasLimitCheck
        - sku
        - tolerance
      type: object
      properties:
        itemNo:
          type: integer
          format: int32
        sku:
          type: string
        expectedQuantity:
          type: integer
          format: int32
        lotNumber:
          type: string
        hasLimitCheck:
          type: boolean
        tolerance:
          type: integer
          format: int32
        externalLineItemId:
          type: string
      additionalProperties: false
    CreateReceivingOrderLineItemLotNumberInputDTO:
      required:
        - expectedQuantity
      type: object
      properties:
        sku:
          type: string
        lotNumber:
          type: string
        expectedQuantity:
          type: integer
          format: int32
      additionalProperties: false
    ReceivingOrderTransferType:
      enum:
        - CargoTransfer
        - PickupTransfer
        - CarriageTransfer
      type: string
    CargoTransferDTO:
      type: object
      properties:
        shipmentDate:
          type: string
          format: date-time
        cargoCompanyName:
          type: string
        trackingNumber:
          type: string
      additionalProperties: false
      required:
        - shipmentDate
    PickupTransferDTO:
      type: object
      properties:
        pickupDate:
          type: string
          format: date-time
        pickupAddress:
          type: string
      additionalProperties: false
      required:
        - pickupDate
    CarriageTransferDTO:
      type: object
      properties:
        shipmentDate:
          type: string
          format: date-time
        carriageCompanyName:
          type: string
        waybillNumber:
          type: string
      additionalProperties: false
      required:
        - shipmentDate
    BulkUpsertReceivingOrdersFailureResponseDTO:
      type: object
      properties:
        referenceNumber:
          type: string
        message:
          type: string
      additionalProperties: false
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: Authorization

````