{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/divvy/json-schema/divvy-bill-update-request-dto-schema.json",
  "title": "BillUpdateRequestDto",
  "description": "Update a bill",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/divvy-bills-api-openapi.yml#/components/schemas/BillUpdateRequestDto",
  "required": [
    "paymentTermId"
  ],
  "type": "object",
  "properties": {
    "vendorId": {
      "type": "string",
      "description": "BILL-generated ID of the vendor. The value begins with `009`."
    },
    "description": {
      "maxLength": 4000,
      "type": "string",
      "description": "Bill description"
    },
    "dueDate": {
      "type": "string",
      "description": "Bill due date. The value is in the `yyyy-MM-dd` format.",
      "format": "date"
    },
    "paymentTermId": {
      "type": "string"
    },
    "billLineItems": {
      "type": "array",
      "description": "Bill line items information",
      "items": {
        "$ref": "#/$defs/BillUpdateLineItemDto"
      }
    },
    "invoice": {
      "allOf": [
        {
          "$ref": "#/$defs/BillUpdateInvoiceRequestDto"
        },
        {
          "description": "Invoice information"
        }
      ]
    },
    "payFromChartOfAccountId": {
      "type": "string",
      "description": "BILL-generated ID of the chart of accounts for the bill payment. The value begins with `0ca`."
    },
    "classifications": {
      "allOf": [
        {
          "$ref": "#/$defs/BillClassificationsDto"
        },
        {
          "description": "General ledger classifications information for the bill"
        }
      ]
    },
    "vendorCredits": {
      "type": "array",
      "description": "Vendor credits applied to the bill",
      "items": {
        "$ref": "#/$defs/BillVendorCreditRequestItemDto"
      }
    },
    "purchaseOrderNumber": {
      "type": "string",
      "description": "Purchase order number linked with the bill"
    },
    "billApprovals": {
      "type": "boolean",
      "description": "Set as `true` for BILL to add approvals information in the response.\n\nWhen you have approval policies set up for bills and a bill matches a policy, you see an additional `approvers` array of objects in the response. The array shows the list of individual users and/or user groups assigned as bill approvers. In addition, the array provides information about the status of the bill in the current approval flow.\n\n**Note**: When you set `billApprovals` as `true`, you must set the field as `true` if you want to replace the bill with `PUT /v3/bills/{billId}`."
    },
    "policyRematch": {
      "type": "boolean",
      "description": "Rule for whether BILL re-matches the updated bill against your approval policies. The default value is `false`.\n* `true`: Rematch the updated bill. BILL removes any previously assigned approvers that are no longer valid, and then assigns any new approvers that match your policy rules.\n* `false`: Do not rematch the updated bill. BILL assigns any new approvers that match your policy rules. Any previously assigned approvers are not removed."
    }
  },
  "$defs": {
    "BillClassificationsDto": {
      "type": "object",
      "properties": {
        "chartOfAccountId": {
          "type": "string",
          "description": "BILL-generated ID of the chart of accounts. The value begins with `0ca`."
        },
        "accountingClassId": {
          "type": "string",
          "description": "BILL-generated ID of the accounting class. The value begins with `cls`."
        },
        "departmentId": {
          "type": "string",
          "description": "BILL-generated ID of the department. The value begins with `0de`."
        },
        "locationId": {
          "type": "string",
          "description": "BILL-generated ID of the location. The value begins with `loc`."
        },
        "itemId": {
          "type": "string",
          "description": "BILL-generated ID of the item. The value begins with `0ii`."
        }
      },
      "description": "DTO for Bill classifications."
    },
    "BillLineItemClassificationsDto": {
      "type": "object",
      "properties": {
        "chartOfAccountId": {
          "type": "string",
          "description": "BILL-generated ID of the chart of accounts. The value begins with `0ca`."
        },
        "accountingClassId": {
          "type": "string",
          "description": "BILL-generated ID of the accounting class. The value begins with `cls`."
        },
        "departmentId": {
          "type": "string",
          "description": "BILL-generated ID of the department. The value begins with `0de`."
        },
        "employeeId": {
          "type": "string",
          "description": "BILL-generated ID of the employee. The value begins with `emp`."
        },
        "jobId": {
          "type": "string",
          "description": "BILL-generated ID of the job. The value begins with `job`."
        },
        "locationId": {
          "type": "string",
          "description": "BILL-generated ID of the location. The value begins with `loc`."
        },
        "itemId": {
          "type": "string",
          "description": "BILL-generated ID of the item. The value begins with `0ii`."
        },
        "customerId": {
          "type": "string",
          "description": "BILL-generated ID of the customer. The value begins with `0cu`."
        }
      },
      "description": "DTO for Bill Line Item classifications."
    },
    "BillUpdateInvoiceRequestDto": {
      "type": "object",
      "properties": {
        "invoiceNumber": {
          "maxLength": 100,
          "type": "string",
          "description": "User-generated invoice number. This value can be your chosen number scheme or bill due date."
        },
        "invoiceDate": {
          "type": "string",
          "description": "Date when the invoice is sent. This value is in the `yyyy-MM-dd` format.",
          "format": "date"
        }
      },
      "description": "Invoice linked to a bill."
    },
    "BillUpdateLineItemDto": {
      "required": [
        "id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "minLength": 1,
          "type": "string",
          "description": "BILL-generated ID of the bill line item. The value begins with `bli`."
        },
        "amount": {
          "type": "number",
          "description": "Bill line item amount. For a bill in an international currency (not USD), this value is in the local currency.\n\nIf you set `amount`, `quantity`, and `price`, BILL uses the `amount` value as the bill line item total amount."
        },
        "quantity": {
          "type": "number",
          "description": "Bill line item unit quantity"
        },
        "price": {
          "type": "number",
          "description": "Bill line item unit price. For a bill in an international currency (not USD), this value is in the local currency."
        },
        "description": {
          "maxLength": 4000,
          "type": "string",
          "description": "Bill line item description"
        },
        "classifications": {
          "allOf": [
            {
              "$ref": "#/$defs/BillLineItemClassificationsDto"
            },
            {
              "description": "General ledger classifications information for the bill line item"
            }
          ]
        }
      },
      "description": "Line items that define a bill's overall amount."
    },
    "BillVendorCreditRequestItemDto": {
      "required": [
        "amount",
        "id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "minLength": 1,
          "type": "string",
          "description": "BILL-generated ID of the vendor credit applied to the bill payment. The value begins with `vcr`."
        },
        "amount": {
          "minimum": 0,
          "type": "number",
          "description": "Credit amount"
        }
      },
      "description": "API level DTO for apply vendor credit to bill request item."
    }
  }
}