{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trimble/json-schema/trimble-check-schema.json",
  "title": "check",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trimble-truckmate-finance-openapi.yml#/components/schemas/check",
  "type": "object",
  "properties": {
    "checkId": {
      "type": "integer"
    },
    "payType": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "driver",
        "vendor",
        "client",
        "payroll",
        ""
      ]
    },
    "payTo": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 10
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 50
    },
    "address1": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 40
    },
    "address2": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 40
    },
    "city": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 30
    },
    "province": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 4
    },
    "postalCode": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 10
    },
    "country": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 10
    },
    "contact": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 40
    },
    "payFrom": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "bank",
        "vendor",
        ""
      ]
    },
    "payFromVendor": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 10
    },
    "checkNumber": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 15
    },
    "checkAmount": {
      "type": [
        "number",
        "null"
      ]
    },
    "checkFunctionalAmount": {
      "type": [
        "number",
        "null"
      ]
    },
    "checkDate": {
      "type": [
        "string",
        "null"
      ],
      "oneOf": [
        {
          "enum": [
            ""
          ]
        },
        {
          "pattern": "^\\d{4}-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12]\\d)((T| )([01]\\d|2[0-3]):([0-5]\\d):([0-5]\\d))?$"
        }
      ]
    },
    "checkReference": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 40
    },
    "glAccount": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 50,
      "oneOf": [
        {
          "enum": [
            ""
          ]
        },
        {
          "pattern": "^[A-Za-z0-9]+(-[A-Za-z0-9]+){0,4}$"
        }
      ]
    },
    "checkPosted": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "False",
        "True",
        ""
      ]
    },
    "transactionDate": {
      "type": [
        "string",
        "null"
      ],
      "oneOf": [
        {
          "enum": [
            ""
          ]
        },
        {
          "pattern": "^\\d{4}-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12]\\d)((T| )([01]\\d|2[0-3]):([0-5]\\d):([0-5]\\d))?$"
        }
      ]
    },
    "transactionCleared": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "False",
        "True",
        ""
      ]
    },
    "transactionClearedDate": {
      "type": [
        "string",
        "null"
      ],
      "oneOf": [
        {
          "enum": [
            ""
          ]
        },
        {
          "pattern": "^\\d{4}-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12]\\d)((T| )([01]\\d|2[0-3]):([0-5]\\d):([0-5]\\d))?$"
        }
      ]
    },
    "transactionVoided": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "False",
        "True",
        ""
      ]
    },
    "transactionVoidedId": {
      "type": [
        "integer",
        "null"
      ]
    },
    "replacementCheckId": {
      "type": [
        "integer",
        "null"
      ]
    },
    "splitCheckId": {
      "type": [
        "integer",
        "null"
      ]
    },
    "tripNumber": {
      "type": "integer"
    },
    "user1": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 20
    },
    "user2": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 20
    },
    "user3": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 20
    },
    "checkType": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 30
    },
    "bills": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/checkBill"
      }
    }
  },
  "$defs": {
    "checkBill": {
      "type": "object",
      "properties": {
        "checkId": {
          "type": "integer"
        },
        "checkBillId": {
          "type": "integer"
        },
        "accountsPayableId": {
          "type": "integer"
        },
        "billAmount": {
          "type": [
            "number",
            "null"
          ]
        },
        "billFunctionalAmount": {
          "type": [
            "number",
            "null"
          ]
        },
        "billGlAccount": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 50
        },
        "billDiscountGlAccount": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 50
        },
        "billDiscountAmount": {
          "type": [
            "number",
            "null"
          ]
        },
        "billReference": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 40
        },
        "transactionAmount": {
          "type": [
            "number",
            "null"
          ]
        },
        "vendorBillNumber": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 20
        }
      }
    }
  }
}