Skip to content

Build

Version 1

Schema

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "title": "Barrett Distribution Centers, Inc. Order Schema",
    "description": "Version 1",
    "additionalProperties": false,
    "properties": {
        "orderId": {
            "type": "string"
        },
        "buildId": {
            "type": "string"
        },
        "builtItemId": {
            "type": "string"
        },
        "builtQuantity": {
            "type": "number"
        },
        "custom": {
            "$ref": "#/definitions/custom"
        },
        "components": {
            "$ref": "#/definitions/component"
        }
    },
    "required": [
        "orderId",
        "orderType",
        "customerId",
        "item"
    ],
    "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"
            ]
        },
        "component": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "itemId": {
                    "type": "string"
                },
                "quantity": {
                    "type": "integer"
                },
                "lotNumber": {
                    "type": "string"
                },
                "serialNumber": {
                    "type": "string"
                },
                "manufactureDate": {
                    "type": "string",
                    "format": "date"
                },
                "expirationDate": {
                    "type": "string",
                    "format": "date"
                },
                "custom": {
                    "$ref": "#/definitions/custom"
                }
            },
            "required": [
                "itemId",
                "quantity"
            ]
        }
    }
}

Sample

{
  "orderId": "WORK123",
  "buildId": "15465782-1",
  "builtItemId": "WX9536",
  "builtQuantity": 10,
  "dateBuilt": "2024-07-29",
  "lotNumber": "JULY2024",
  "expirationDate": "2025-01-01T05:00:00.000Z",
  "components": [
    {
      "itemId": "PK-OU-BO-EN-1",
      "quantity": 10
    },
    {
      "itemId": "MD12-BO-A-2",
      "quantity": 60,
      "expirationDate": "2025-01-01T05:00:00.000Z",
      "lotNumber": "12345"
    }
  ]
}

Railroad Diagrams

Note

Items in green represent the properties that Barrett requires. Items in blue represent optional properties that may be additionally sent by the customer.

Build

Component

Custom

Custom String

Custom Number

Custom Date