Back to Kantata.com Blog Tour Status

How to Create and Delete Expense Categories

Available in: All Plans
User Permissions Needed: Account Administrator

Overview

Kantata OX has six default expense categories: Entertainment, Food, Lodging, Mileage, Travel, and Other. You can create and delete expense categories via the Kantata OX API. You must be an Account Administrator to modify expense categories.

Before you begin, download and install an API client. We recommend Postman.

To use the API to create or delete expense categories, you’ll first need an OAuth token.

How to Obtain an OAuth Token

  1. In Kantata OX, select Settings > API from the left navigation.
  2. On the API Settings page, click View your Account's Registered Applications.
  3. At the bottom of the Oauth Applications page, click Register a new Mavenlink Application.
  4. Enter an Application Name. We recommend a name that makes it clear who the application belongs to and what it’s used for.
  5. In Application Callback URI, enter https://localhost.
    Application_fields.png
  6. Click Save. The application details page opens.
  7. In the Your OAuth Token section, click Show your OAuth Token.
    Click_Show_your_OAuth_token.png
  8. Copy the value that appears and save it for later.
    Copy_your_OAuth_token.png

WARNING

OAuth tokens allow you to access and change data in Kantata OX via the API. You should treat OAuth tokens like passwords and never share them with anyone.

How to Create an Expense Category

  1. In Postman, select New from the sidebar.
    Click_New.png
  2. In the modal that opens, select HTTP Request. A new tab opens within the center pane.
  3. In the request tab, change the method type from GET to POST using the drop-down menu.
    Select_POST5.png
  4. Enter https://api.mavenlink.com/api/v1/expense_categories as the request URL.
    Enter_the_request_URL2__create_.png
  5. Select the Authorization tab which appears below the method and request URL.
    Select_Authorization__create_.png
  6. In the Type drop-down menu, select Bearer Token.
    Select_Bearer_Token.png
  7. In the Token field, paste the OAuth token you copied earlier.
    Paste_your_token.png
  8. Select the Body tab, then select raw.
    Select_raw.png
  9. In the type drop-down menu, select JSON.
    Select_JSON.png
  10. In the text area, paste the following JSON code, making sure to replace category_name_here with your actual desired name.
    { 
      "expense_category": 
        { 
           "name": "category_name_here"
        }
    }
    Paste_the_JSON_body.png
  11. Click Send.
  12. If the creation is successful, you’ll see a 200 OK status in the bottom pane. You’ll also see JSON containing details about the new category in the Body tab.
    Create_expense_category_200_response.png
  13. To see the new expense category in Kantata OX, go to Time & Expense > Expenses and open the Category drop-down menu.
    New_category_expense_in_Kantata.png

How to Delete an Expense Category

Deleting an expense category prevents people from logging expenses against the category in the future. When you delete an expense category, expenses previously logged against the category are not affected.

Warning: Deleted expense categories cannot be restored.
Note: You cannot delete the Other expense category.
  1. In Postman, select New from the sidebar.
    Click_New.png
  2. In the modal that opens, select HTTP Request. A new tab opens within the center pane.
  3. Enter https://api.mavenlink.com/api/v1/expense_categories as the request URL.
    Enter_the_request_URL2__get_.png
  4. Select the Authorization tab which appears below the method and request URL.
    Select_Authorization2__get_.png
  5. In the Type drop-down menu, select Bearer Token.
    Select_Bearer_Token.png
  6. In the Token field, paste the OAuth token you copied earlier.
    Paste_your_token.png
  7. Click Send. In the Body tab in the bottom pane, details about the expense categories on your account will appear. 
  8. Locate the expense category you want to delete, then copy its id.
    Copy_the_expense_category_ID.png
  9. In the request tab, change the method type from GET to DELETE using the drop-down menu.
    Select_DELETE.png
  10. At the end of the request URL, add / then paste the ID you copied.
    Add_slash_and_the_expense_category_ID_to_the_request_URL3.png
  11. Click Send.
  12. If the expense category is deleted successfully, you’ll see a 204 No Content status in the bottom pane and no response body.
    Delete_expense_category_204_response.png
  13. To confirm the expense category was deleted, go to Time & Expense > Expenses in Kantata OX and open the Category drop-down menu.

Related Articles

Created on