{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trimble/json-schema/trimble-put-ap-invoice-schema.json",
  "title": "PutApInvoice",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trimble-truckmate-finance-openapi.yml#/components/schemas/PutApInvoice",
  "type": "object",
  "properties": {
    "vendorId": {
      "type": "string",
      "nullable": false,
      "maxLength": 10
    },
    "vendorBillNumber": {
      "type": "string",
      "nullable": false,
      "maxLength": 20
    },
    "vendorBillAmount": {
      "type": "number"
    },
    "vendorBillDate": {
      "type": "string",
      "description": "Date: yyyy-MM-dd",
      "pattern": "^\\d{4}-(?:(0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|02-(0[1-9]|1\\d|2[0-9]))$",
      "nullable": false
    },
    "vendorBillReference": {
      "type": "string",
      "maxLength": 40
    },
    "currencyCode": {
      "type": "string",
      "description": "The currency code. If not provided, retrieved from the vendor profile. If no currency code is found for the vendor, the request will fail.",
      "maxLength": 3
    },
    "poNumber": {
      "type": "string",
      "maxLength": 25
    },
    "equipmentId": {
      "type": "string",
      "maxLength": 10
    },
    "powerUnitId": {
      "type": "string",
      "maxLength": 10
    },
    "trailerId": {
      "type": "string",
      "maxLength": 10
    },
    "payableType": {
      "type": "string",
      "enum": [
        "bill",
        "credit",
        "debit"
      ]
    },
    "payableHold": {
      "type": "string",
      "enum": [
        "False",
        "True"
      ]
    },
    "payableTerms": {
      "type": "string",
      "description": "Payment terms. If not provided, retrieved from the vendor profile.",
      "maxLength": 10
    },
    "payableAgingDate": {
      "type": "string",
      "description": "Date: yyyy-MM-dd. If not provided, calculated from the vendor profile payment terms.",
      "pattern": "^\\d{4}-(?:(0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|02-(0[1-9]|1\\d|2[0-9]))$"
    },
    "payableDiscount": {
      "type": "number",
      "description": "Payable discount. If not provided, calculated from the vendor profile payment terms."
    },
    "payableDiscountDate": {
      "type": "string",
      "description": "Date: yyyy-MM-dd. If not provided, calculated from the vendor profile payment terms.",
      "pattern": "^\\d{4}-(?:(0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|02-(0[1-9]|1\\d|2[0-9]))$"
    },
    "payableDueDate": {
      "type": "string",
      "description": "Date: yyyy-MM-dd. If not provided, calculated from the vendor profile payment terms.",
      "pattern": "^\\d{4}-(?:(0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|02-(0[1-9]|1\\d|2[0-9]))$"
    },
    "glAccount": {
      "type": "string",
      "description": "General ledger account. If not provided, retrieved from the vendor profile (based on vendorId and currencyCode).",
      "maxLength": 50,
      "pattern": "^[A-Za-z0-9]+(-[A-Za-z0-9]+){0,4}$"
    },
    "autoForeignExchange": {
      "type": "string",
      "enum": [
        "False",
        "True"
      ]
    },
    "isIntercompany": {
      "type": "string",
      "description": "Indicates if the invoice is intercompany. If not provided, retrieved from the vendor profile.",
      "enum": [
        "False",
        "True"
      ]
    }
  }
}