{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/divvy/main/json-schema/divvy-budget-create-dto-schema.json",
  "title": "BudgetCreateDto",
  "description": "Create a budget",
  "x-generated": "2026-10-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/divvy-bill-v3-api-openapi.yml#/components/schemas/BudgetCreateDto",
  "required": [
    "name",
    "owners",
    "recurringInterval"
  ],
  "type": "object",
  "properties": {
    "name": {
      "minLength": 1,
      "type": "string",
      "description": "Budget name"
    },
    "description": {
      "type": "string",
      "description": "Budget description"
    },
    "owners": {
      "minItems": 1,
      "type": "array",
      "description": "List of BILL-generated user IDs or UUIDs of budget owners. You must specify at least one budget owner.",
      "items": {
        "type": "string"
      }
    },
    "members": {
      "type": "array",
      "description": "List of BILL-generated user IDs or UUIDs of budget members",
      "items": {
        "type": "string"
      }
    },
    "observers": {
      "type": "array",
      "description": "List of BILL-generated user IDs or UUIDs of budget observers",
      "items": {
        "type": "string"
      }
    },
    "expirationDate": {
      "type": [
        "string",
        "null"
      ],
      "description": "Budget expiration date. This value is in the `yyyy-MM-dd` format.",
      "format": "date"
    },
    "recurringInterval": {
      "allOf": [
        {
          "$ref": "#/$defs/PeriodIntervalType"
        },
        {
          "description": "Interval after which the budget is reset. By default, BILL uses the timezone of the company's billing address to reset a budget at 12 AM.\n* `NONE`: Never\n* `DAILY`: Each day at 12 AM\n* `WEEKLY`: Each Monday at 12 AM\n* `MONTHLY`: On the 1st of every month at 12 AM\n* `QUARTERLY`: Once every 3 months, on the 1st of the month at 12 AM. Set the first month with `recurMonth`.\n* `YEARLY`: Once every year, on the 1st of the month at 12 AM. Set the month with `recurMonth`."
        }
      ]
    },
    "recurMonth": {
      "maximum": 12,
      "minimum": 1,
      "type": "integer",
      "description": "The month in which the budget will recur. Set this field only when `recurringInterval` is set as `QUARTERLY` or `YEARLY`. The default value is the current month.",
      "format": "int64"
    },
    "timezone": {
      "type": "string",
      "description": "Timezone in which the budget funds are reset. The default value is the timezone of the company's billing address.\n\nSet this field in the `US/{time_zone}` format. For example, `US/Pacific` or `US/Mountain`."
    },
    "autoAddUsers": {
      "type": "boolean",
      "description": "Set as `true` to automatically add all new users to this budget"
    },
    "receiptRequired": {
      "type": "boolean",
      "description": "Set as `true` if a receipt is required for transactions in the budget"
    },
    "maxTxSize": {
      "type": "number",
      "description": "Maximum transaction size in the budget. Any single transaction for an amount greater than `maxTxSize` will be declined."
    },
    "carryOver": {
      "type": "boolean",
      "description": "Set as `true` for any budget funds assigned to users and vendor cards to carry over from one budget period to the next. The budget period is set with `recurringInterval`."
    },
    "parentBudgetId": {
      "type": "string",
      "description": "BILL-generated ID or UUID of the parent budget. Set this field if this budget is a child budget."
    },
    "budgetGroup": {
      "type": "boolean",
      "description": "Set as `true` if this budget is a budget group. A budget group can be set as a parent of other budgets."
    },
    "limitlessOverspend": {
      "type": "boolean",
      "description": "Set as `true` for enabling spend amounts over the budget limit.\n\n**Note**: You cannot set this field as `true` for budgets with `recurringInterval` set as\n`DAILY` or `WEEKLY`."
    },
    "limit": {
      "type": "number",
      "description": "Spend limit for the initial budget period.\n\n**Note**: This field is required unless `limitlessOverspend` is set as `true`."
    },
    "limitlessGoal": {
      "type": "number",
      "description": "Spend goal for a limitless budget.\n\n**Note**: You can set this field when `limitlessOverspend` is set as `true`."
    },
    "recurringLimit": {
      "type": "number",
      "description": "Spend limit for all future budget periods.\n\n**Note**: This field is required when `recurringInterval` is set as any value other than `NONE`."
    },
    "overspendBuffer": {
      "type": "number",
      "description": "Spend amount allowed above the budget limit before transactions are declined.\n\n**Note**: You cannot set this field when `limitlessOverspend` is set as `true` or for budgets with `recurringInterval` as `DAILY` or `WEEKLY`."
    },
    "shareFunds": {
      "allOf": [
        {
          "$ref": "#/$defs/EditBudgetShareFundsType"
        },
        {
          "description": "Rule for how the budget funds are shared with budget members. The default value is `SHARE_MANUALLY`."
        }
      ]
    }
  },
  "$defs": {
    "EditBudgetShareFundsType": {
      "type": "string",
      "description": "The subset of BudgetShareFundsType options that users are allowed to use for updates/creates. (Other options are read-only.)",
      "enum": [
        "DO_NOT_SHARE",
        "SHARE_MANUALLY"
      ]
    },
    "PeriodIntervalType": {
      "type": "string",
      "description": "PeriodIntervalType.",
      "enum": [
        "NONE",
        "DAILY",
        "WEEKLY",
        "MONTHLY",
        "QUARTERLY",
        "YEARLY"
      ]
    }
  }
}