Kantata Kantata OX Knowledge Base
Release Notes
Status Page

Expense Categories

An Expense Category represents the type of expense that is being reported. Expense categories have no attributes and consist of just their name as a string. They can be changed by Account Administrators.

Fetching a list of Expense Categories

This endpoint returns structured Expense Category 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_categories top-level JSON key. Please see our Response Format section for more information.

Request
query Parameters
matching
string

By expense category names that match the specified name.

only
string

Allows you to request one or more resources directly by ID. Multiple IDs can be supplied in a comma separated list, like GET /api/v1/workspaces.json?only=5,6,7.

only_active
boolean
Default: true

Only include expense categories that have not been deleted (deleted_at is NULL).

order
string
Default: "alphabetical:asc"

Supply order with the name of a valid sort field for the endpoint and a direction.

Valid values: alphabetical:asc and alphabetical:desc.

page
integer <int32>
Default: 1
per_page
integer <int32> <= 200
Default: 20
Responses
200

A list of Expense Categories have been retrieved.

Response Schema: application/json
count
integer <int32>
object
Array of objects
object
400

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

get/expense_categories
Request samples
Response samples
application/json
{
  • "count": 0,
  • "meta": {
    },
  • "results": [
    ],
  • "expense_categories": {
    }
}

Creating a new Expense Category

This endpoint returns structured Expense Category 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_categories top-level JSON key. Please see our Response Format section for more information.

Request
Request Body schema: application/json
required
object
name
required
string

The name of the expense category.

Responses
200

Expense Category has been created.

Response Schema: application/json
count
integer <int32>
object
Array of objects
object
400

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

post/expense_categories
Request samples
application/json
{
  • "expense_category": {
    }
}
Response samples
application/json
{
  • "count": 0,
  • "meta": {
    },
  • "results": [
    ],
  • "expense_categories": {
    }
}

Updating an existing Expense Category

This endpoint returns structured Expense Category 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_categories top-level JSON key. Please see our Response Format section for more information.

Request
path Parameters
id
required
integer

The ID of the Model.

Request Body schema: application/json
required
object
name
string

The name of the expense category.

Responses
200

Expense Category has been updated.

Response Schema: application/json
count
integer <int32>
object
Array of objects
object
400

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

put/expense_categories/{id}
Request samples
application/json
{
  • "expense_category": {
    }
}
Response samples
application/json
{
  • "count": 0,
  • "meta": {
    },
  • "results": [
    ],
  • "expense_categories": {
    }
}

Deleting an existing Expense Category

Deleting an expense category updates the deleted_at attribute to the current time. Deleted expense categories are not included by default in the index action and can be retrieved by setting only_active filter as false.

The response will contain no content and an HTTP 204 status code if the request was successful, or a standard Kantata OX error message explaining why the object could not be deleted.

Request
path Parameters
id
required
integer

The ID of the Model.

Responses
204

Expense Category has been deleted.

400

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

delete/expense_categories/{id}
Request samples
Response samples
application/json
{
  • "errors": [
    ]
}