foliolib.folio.api.inventoryStorage.ItemSync

class foliolib.folio.api.inventoryStorage.ItemSync(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

Inventory Storage Item Batch Sync API

Batch API for synchronously uploading items into the inventory

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

set_synchronou(synchronou, **kwargs)

Create or update a collection of items in a single synchronous request; if any item fails the complete batch will be rejected (all or nothing)

set_synchronou(synchronou: dict, **kwargs)

Create or update a collection of items in a single synchronous request; if any item fails the complete batch will be rejected (all or nothing)

POST /item-storage/batch/synchronous

Parameters
  • synchronou (dict) –

  • **kwargs (properties) – Keyword Arguments: See Schema below

Keyword Arguments

upsert (bool) – (default=False) When a record with the same id already exists upsert=true will update it, upsert=false will fail the complete batch. The _version property of each item to be updated must match the stored _version property (optimistic locking).

Raises
  • OkapiRequestConflict – Conflict

  • OkapiRequestPayloadToLarge – Payload Too Large

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of item records",
  "type": "object",
  "properties": {
    "items": {
      "description": "List of item records",
      "id": "items",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "item.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "items"
  ]
}