# Creating a new Expense Budgets

Creates a new expense budget.
The following combinations of fixed_fee, burns_budget, and billable are allowed:
- fixed_fee and burns_budget and billable: Known as a fixed fee budget
- burns_budget and billable: Known as an itemized budget
- burns_budget only: Known as a cost-only budget
- billable only: Known as a pass-through budget
- fixed_fee and billable: Known as a pass-through fixed fee budget


This endpoint returns structured Expense Budgets objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the expense_budgets top-level JSON key.
Please see our Response Format section for more information.

Endpoint: POST /expense_budgets
Version: 1.0.0

## Query parameters:

  - `include` (string)
    Any of the below associations can be included in your request by providing the include param, e.g. include=association1,association2.
- expenses (Expense) - The expenses associated with the expense budget.
- external_references (ExternalReference) - Includes references to external integrations for this object.
- fixed_fee_items (FixedFeeItem) - The fixed fee items associated with the expense budget.
- story (Story) - Retrieves the associated story (task). The response will include story_id, which references the data in the stories top-level key.
- workspace (Workspace) - Retrieves the workspace (project) the expense budget is on. The response will include workspace_id, which references the data in the workspaces top-level key.

  - `optional_fields` (array)
    Allows you to request one or more optional fields as an array.
    Enum: "quantity", "markup_type", "markup_per_unit_in_subunits", "markup_percentage"

## Request fields (application/json):

  - `expense_budget` (object)

  - `expense_budget.workspace_id` (integer, required)
    The ID of the workspace to create the expense budget for.

  - `expense_budget.title` (string, required)
    The name of the expense budget.

  - `expense_budget.fixed_fee` (boolean, required)
    Whether the expense will be billed as a fixed cost.

  - `expense_budget.burns_budget` (boolean, required)
    Whether the expense budget affects the project margin.

  - `expense_budget.billable` (boolean, required)
    Whether the expense will be billed to the client.

  - `expense_budget.description` (string)
    The description of the expense budget.

  - `expense_budget.expected_by` (string)
    When the expenses are expected to be logged by. The date must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

  - `expense_budget.story_id` (integer)
    The ID of the story (task) to associate this expense budget to.

  - `expense_budget.cost_per_unit_in_subunits` (integer)
    The cost, in the subunits of the currency (e.g. cents for USD).

  - `expense_budget.markup_per_unit_in_subunits` (integer)
    When the markup_type is set to flat_fee, this is the markup per unit,
in the subunits of the currency (e.g. cents for USD). This is
multiplied by the quantity and added to the total cost to produce the
total fees.

  - `expense_budget.quantity` (integer)
    The number of units.

  - `expense_budget.markup_type` (string)
    The markup type. Options are percentage and flat_fee. If not set, no markup is applied.

  - `expense_budget.markup_percentage` (number)
    When the markup_type is set to percentage, this is the markup percentage.
This is multiplied by the total cost to produce the total markup,
then added to the total cost to produce the total fees.

  - `expense_budget.external_reference` (object)
    Typically populated programmatically by a third party system via an integration, this is an optional
object that holds data from an external system. It connects objects in an external system with objects in
Kantata OX (for example, to connect a Jira issue to a Kantata OX Project).

  - `expense_budget.external_reference.service_name` (string, required)
    The provider name of the integration. If you are adding multiple external references to the same object, the service_name must be unique.

  - `expense_budget.external_reference.service_model` (string, required)
    The object type of the external object this external reference belongs to.

  - `expense_budget.external_reference.service_model_ref` (string, required)
    The object ID of the external object this external reference belongs to.

  - `expense_budget.external_reference.status` (string)
    The status of the integration. Options are successful, pending,  or failed.

  - `expense_budget.external_reference.external_message` (string)
    The message on the external object.

  - `expense_budget.external_reference.external_link` (string)
    The link to the external object.

  - `expense_budget.external_reference.external_status` (string)
    The status of the external object in the external system.

  - `expense_budget.external_reference.locked` (boolean)
    Whether the subject is locked.

## Response 200 fields (application/json):

  - `count` (integer)

  - `meta` (object)

  - `meta.count` (integer)

  - `meta.page_count` (integer)

  - `meta.page_number` (integer)

  - `meta.page_size` (integer)

  - `results` (array)

  - `results.key` (string)

  - `results.id` (string)

  - `expense_budgets` (object)

  - `external_references` (object)

  - `workspaces` (object)

  - `stories` (object)

  - `expenses` (object)

  - `fixed_fee_items` (object)

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)


