{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/ch-robinson-worldwide/main/json-schema/ch-robinson-worldwide-load-document-callback-schema.json",
  "title": "loadDocumentCallback",
  "description": "Object containing the search event response.",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ch-robinson-worldwide-documents-api-openapi.yml#/components/schemas/loadDocumentCallback",
  "type": "object",
  "properties": {
    "billToReferenceNumber": {
      "type": "string",
      "description": "Primary bill to reference number"
    },
    "customerReferenceNumber": {
      "type": "string",
      "description": "Primary customer reference number"
    },
    "event": {
      "type": "object",
      "description": "Object containing document saved detail",
      "properties": {
        "billTos": {
          "type": "array",
          "description": "Array containing bill to entities and references by customerCode",
          "items": {
            "type": "object",
            "properties": {
              "customerCode": {
                "type": "string",
                "description": "CHR defined Bill to customerCode"
              },
              "referenceNumbers": {
                "description": "Array containing bill to references",
                "items": {
                  "$ref": "#/$defs/referenceNumber"
                }
              }
            }
          }
        },
        "customer": {
          "type": "array",
          "description": "Array containing customer entities and references by customerCode",
          "items": {
            "type": "object",
            "properties": {
              "customerCode": {
                "type": "string",
                "description": "CHR defined customer code"
              },
              "referenceNumbers": {
                "description": "Array containing customer references",
                "items": {
                  "$ref": "#/$defs/referenceNumber"
                }
              }
            }
          }
        },
        "documentFileName": {
          "type": "string",
          "description": "Filename and extension of the carrier document"
        },
        "documentType": {
          "type": "string",
          "enum": [
            "BOL",
            "POD",
            "LUMPER",
            "INTL_BOL",
            "INTL_POD"
          ],
          "description": "Defines type of carrier document, such as POD (Proof of Delivery), BOL (Bill of Lading), LMP (Lumper Receipt) - see enums"
        },
        "eventType": {
          "type": "string",
          "description": "DOCUMENT SAVED"
        },
        "loadNumber": {
          "type": "string",
          "description": "CHR load number"
        }
      }
    },
    "eventTime": {
      "type": "string",
      "format": "date-time",
      "description": "The date/time in ISO8601 UTC format when the event was reported to have occured."
    },
    "time": {
      "type": "string",
      "format": "date-time",
      "description": "The date/time in ISO8601 UTC format when the event was written to the Enterprise API database."
    },
    "documentFileData": {
      "type": "object",
      "description": "Object containing image byte array and contentType",
      "properties": {
        "document": {
          "type": "string",
          "description": "Base64 encoded carrier document"
        },
        "contentType": {
          "type": "string",
          "description": "String showing Content-type of the document, such as application/pdf",
          "enum": [
            "application/pdf",
            "application/tif",
            "application/jpeg"
          ]
        }
      }
    }
  },
  "$defs": {
    "referenceNumber": {
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "C.H. Robinson defined code for reference number types. Here is a list of the most commonly used reference number types: \n\n`SHID` - Shipment ID #, `MBOL` - Master Bill of Lading #, `PO` - Purchase Order #, `BOL` - Bill of Lading #, `CRID` - Customer Specific Ref Number, `CUSTPO` - Customer PO Number, `DEL` - Delivery #, `JNO` - Job Number, `PU` - Pickup #, `CON` - Customer Order Number, `APPT` - Appointment Number \n\nFor a detailed description of all enumerated codes please find them <a href=\"https://api.navisphere.com/api/B2B/Portal/v1/documents/descriptions/ReferenceNumberTypes.xlsx\" target=\"_blank\">here</a>.",
          "enum": [
            "SHID",
            "MBOL",
            "PO",
            "BOL",
            "CFRM",
            "CRID",
            "CUSTPO",
            "DEL",
            "DIST",
            "FIN",
            "GL",
            "JNO",
            "PU",
            "RANumber",
            "RLPRO",
            "MREF",
            "Empty",
            "PRO",
            "CCN",
            "SBOL",
            "CON",
            "APPT",
            "CHRW_ID",
            "FDA",
            "IREF",
            "LIC",
            "ORD",
            "PLU",
            "SCAC",
            "SEAL",
            "SKU",
            "SREF",
            "STCC",
            "TEB",
            "VPO",
            "WB",
            "XXXX",
            "TRIA",
            "TRANS",
            "GCC",
            "SDATE",
            "CDATE",
            "ACCT",
            "CCTR",
            "IGM",
            "GIGM",
            "LIGM",
            "SMTP",
            "PERMIT",
            "RNO",
            "DVCN",
            "PRCL",
            "CPUC",
            "SHPMD",
            "AFR",
            "BUYID",
            "VNDID",
            "DIV",
            "DEPT",
            "POTYPE",
            "GRGI",
            "DUNS",
            "PALLETREF",
            "CITTN",
            "CIN",
            "SHIPWITH",
            "PN",
            "UPC",
            "PRCD",
            "VESSEL",
            "VOYAGE",
            "FN",
            "FEEDVESS",
            "FEEDVOY",
            "SHIPREF",
            "CBL",
            "SPAC",
            "POLN",
            "VPOLN",
            "EIN",
            "CNSG",
            "PROFITCTR",
            "MFGPART",
            "PACKSLIP",
            "THIRDPRTY",
            "DEFATTR",
            "FSTRK",
            "FOItemID",
            "POLineNum",
            "PARCELSPC",
            "CNS1",
            "CNS2",
            "CNS3",
            "CNS4",
            "CNS5",
            "CNS6",
            "CNS7",
            "TREF",
            "VREF",
            "UPRICE",
            "FWPARTY",
            "BYPARTY",
            "HBL",
            "CBP",
            "TRANSFER",
            "SO",
            "ORDTRK",
            "QUOTEID",
            "EQT",
            "BOOTH",
            "TS",
            "OH #",
            "CNTNR",
            "VAS",
            "Size",
            "Color",
            "Style",
            "HCERT",
            "B#",
            "ETMSID",
            "214-IMO",
            "SHPWeight",
            "SHPVolume",
            "SHPDims",
            "SERIALIZED",
            "SERIALNUM",
            "CPSIA",
            "EDIINVREF",
            "SQID",
            "QSeqNum",
            "OuterPkStu",
            "GLC",
            "COMP",
            "COST",
            "DTYGL",
            "DTYCC",
            "BRKGL",
            "BRKCC",
            "GPS",
            "IAC",
            "WHRCT",
            "ERGUID",
            "SONUM",
            "CCNUM",
            "PrimCCNUM",
            "PrevCCNUM",
            "CMRN",
            "TRANSSHIP",
            "PGIDATE",
            "AESFIL",
            "CUSTQUOTID",
            "QUOTETRACE",
            "ODATE",
            "FRCLS",
            "NMFC",
            "OrderItemId"
          ]
        },
        "value": {
          "type": "string",
          "minimum": 1,
          "maximum": 100,
          "description": "The actual value of the reference number."
        }
      }
    }
  }
}