Inventory Storage Item Batch Sync API (v0.5)

http://localhost

Table of contents

Inventory Storage Item Batch Sync API

Batch API for synchronously uploading items into the inventory

Item Batch Upload Sync API

POST /item-storage/batch/synchronous

Create or update a collection of items in a single synchronous request

POST /item-storage/batch/synchronous
Query Parameters
  • upsert: (boolean - default: false)

    When a record with the same id already exists upsert=true will update it, upsert=false will fail the complete batch.

Body

Media type: application/json

Type: json

Content:

{
  "$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"
  ]
}

Example:

{
  "items": [
    {
      "id": "f2901bcc-6290-417a-843b-a6d97ee9a418",
      "holdingsRecordId": "65cb2bf0-d4c2-4886-8ad0-b76f1ba75d61",
      "barcode": "456743454532",
      "status": {
        "name": "Available"
      },
      "materialTypeId": "240886da-17d9-435f-985e-21111e586fc8",
      "permanentLoanTypeId": "2e48e713-17f3-4c13-a9f8-23845bb210a4"
    },
    {
      "id": "0b96a642-5e7f-452d-9cae-9cee66c9a892",
      "holdingsRecordId": "65cb2bf0-d4c2-4886-8ad0-b76f1ba75d61",
      "barcode": "645398607547",
      "status": {
        "name": "Available"
      },
      "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892",
      "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27",
      "temporaryLoanTypeId": "e8b311a6-3b21-43f2-a269-dd9310cb2d0e",
      "temporaryLocationId": "0df935eb-f3f4-4741-9ac6-33c500174b96"
    }
  ]
}

Response 201

All items have been successfully created or updated

Response 413

Payload Too Large

Body

Media type: text/plain

Type: any

Example:

Payload Too Large

Response 422

Unprocessable Entity

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error