Skip to content

Inventory

Version 1

Schema

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "title": "Barrett Distribution Centers, Inc. Inventory Advice Schema",
    "description": "Version 1",
    "additionalProperties": false,
    "properties": {
        "effectiveDate": {
            "type": "string",
            "format": "date"
        },
        "customerId": {
            "type": "string"
        },
        "custom": {
            "$ref": "#/definitions/custom"
        },
        "items": {
            "type": "array",
            "minItems": 1,
            "items": {
                "$ref": "#/definitions/item"
            }
        }
    },
    "required": [
        "effectiveDate",
        "customerId",
        "items"
    ],
    "definitions": {
        "custom": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "customStrings": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/customString"
                    }
                },
                "customNumbers": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/customNumber"
                    }
                },
                "customDates": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/customDate"
                    }
                }
            },
            "anyOf": [
                {
                    "required": [
                        "customStrings"
                    ]
                },
                {
                    "required": [
                        "customNumbers"
                    ]
                },
                {
                    "required": [
                        "customDates"
                    ]
                }
            ]
        },
        "customString": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "name": {
                    "type": "string"
                },
                "value": {
                    "type": "string"
                }
            },
            "required": [
                "name",
                "value"
            ]
        },
        "customNumber": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "name": {
                    "type": "string"
                },
                "value": {
                    "type": "number"
                }
            },
            "required": [
                "name",
                "value"
            ]
        },
        "customDate": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "name": {
                    "type": "string"
                },
                "value": {
                    "type": "string",
                    "format": "date"
                }
            },
            "required": [
                "name",
                "value"
            ]
        },
        "item": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "itemId": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "facility": {
                    "type": "string"
                },
                "totalQuantity": {
                    "type": "integer"
                },
                "totalQuantityUom": {
                    "type": "string"
                },
                "custom": {
                    "$ref": "#/definitions/custom"
                },
                "statuses": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/status"
                    }
                }
            },
            "required": [
                "itemId",
                "facility",
                "totalQuantity",
                "totalQuantityUom",
                "statuses"
            ]
        },
        "status": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "statusId": {
                    "type": "string"
                },
                "statusQuantity": {
                    "type": "integer",
                    "minimum": 0,
                    "exclusiveMaximum": 10000000000
                },
                "statusQuantityUom": {
                    "type": "string"
                },
                "lotNumber": {
                    "type": "string"
                },
                "inventoryClass": {
                    "type": "string"
                },
                "inventoryClassDescription": {
                    "type": "string"
                }
            },
            "required": [
                "statusId",
                "statusQuantity",
                "statusQuantityUom",
                "inventoryClass"
            ]
        }
    }
}

Sample

{
    "effectiveDate": "1982-12-22",
    "customerId": "6856",
    "items": [
        {
            "itemId": "BXD4774533",
            "facility": "ORF",
            "totalQuantity": 200,
            "totalQuantityUom": "EA",
            "statuses": [
                {
                    "statusId": "2",
                    "statusQuantity": 140,
                    "statusQuantityUom": "EA",
                    "inventoryClass": "RG",
                    "inventoryClassDescription": "Regular"
                },
                {
                    "statusId": "5",
                    "statusQuantity": 60,
                    "statusQuantityUom": "EA",
                    "inventoryClass": "TY",
                    "custom": {
                        "customNumbers": [
                            {
                                "name": "Another Custom Number",
                                "value": 150
                            },
                            {
                                "name": "Yet Another Custom Number",
                                "value": 50
                            }
                        ]
                    }
                }
            ],
            "custom": {
                "customDates": [
                    {
                        "name": "First Custom Date",
                        "value": "1974-02-07"
                    },
                    {
                        "name": "Second Custom Date",
                        "value": "1990-09-16"
                    }
                ]
            }
        },
        {
            "itemId": "BXD88477289",
            "description" : "New Shoes",
            "facility": "ORF",
            "totalQuantity": 500,
            "totalQuantityUom": "EA",
            "statuses": [
                {
                    "statusId": "3",
                    "statusQuantity": 500,
                    "statusQuantityUom": "EA",
                    "lotNumber": "B-01580609",
                    "inventoryClass": "RG",
                    "inventoryClassDescription": "Regular"
                }
            ],
            "custom": {
                "customStrings": [
                    {
                        "name": "A Custom String",
                        "value": "This is a custom string"
                    }
                ]
            }
        }
    ],
    "custom": {
        "customDates": [
            {
                "name": "Last Update",
                "value": "1949-10-14"
            },
            {
                "name": "End Date",
                "value": "2007-03-21"
            }
        ]
    }
}

Railroad Diagrams

Note

Items in green represent the properties that are always present. Items in blue represent additional properties that may or may not be present.

Inventory

Item

Status

Custom

Custom String

Custom Number

Custom Date