API version 1 Internal Expenses

1. List Internal Expenses (api1/internal_expenses)

This method will answer with a collection of iinsight's Internal Expenses. The collection wil be in JSON format.
The results would be paginated, having a default 100 records per page. An empty collection and a status code 200 response, means that there is no records in the specified page.

URL
Server URL HTTP type
UAT https://api-uk-uat.iinsightonline.com/api1/internal_expenses GET
PRODUCTION https://api-uk.iinsightonline.com/api1/internal_expenses GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes

Query Params (Query Builder)

Parameter Value Mandatory
fields Billings fields separated by commas with no spaces. (i.e.: field_name1,field_name2,...) (default: all) No
query JSON string specifying filter conditions. Each key should be a field name and the value should be an array of conditions. (i.e.: {"case_id":["=25"],"description":["%Assessment%"]}) No
sort JSON string specifying sort conditions. Each key should be a field name and the value should be the sort direction (asc or desc). (i.e.: {"field1":"asc","field2":"desc"}) No
page The page number of the paginated results. (i.e.: 2) (default: 1) No
limit The number of records to display per page. (i.e.: 50) (default: 100) No
Response
{
    "status": true,
    "data": [
        {
            "case_id": "-2",
            "id": "3803",
            "time_based": "1",
            "description": "Meeting",
            "reference_date": "1453896000",
            "quantity": "1.00",
            "unit_charge": "100.00",
            "tax_amount": "10.00",
            "tax_rate": "0.10",
            "total_charge": "110.00",
            "charge_code": "901"
        }
    ],
    "displayed_records": 1,
    "total_records": 123
}
	

2. Create Internal Expense (api1/internal_expenses)

This method will create a Internal Expense and get an answer with the data of the Internal Expense created in iinsight. The collection wil be in JSON format.

URL
Server URL HTTP type
UAT https://api-uk-uat.iinsightonline.com/api1/internal_expenses POST
PRODUCTION https://api-uk.iinsightonline.com/api1/internal_expenses POST
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
description Description. (i.e.: Travel) Yes
time_based Time Based. (i.e.: Yes) (Values: Yes or No) Yes
quantity Quantity. (i.e.: 1.5) Yes
unit_charge Unit Charge. (i.e.: 195.75) Yes
tax_rate Tax Rate. (i.e.: 0.1) Yes
charge_code Charge Code. (i.e.: OC07) Yes
Response
{
    "status": true,
    "message": "Cost successfully created",
    "data": {
        "case_id": "-2",
        "id": "8769",
        "time_based": "1",
        "description": "Huascar Meeting 2",
        "reference_date": "0",
        "quantity": "1.00",
        "unit_charge": "200.00",
        "tax_amount": "20.00",
        "tax_rate": "0.10",
        "total_charge": "220.00",
        "charge_code": "OS02"
    }
}
	

3. Update Internal Expense (api1/internal_expenses)

This method will update a Internal Expense and get an answer with the data of the Internal Expense updated in iinsight. The collection wil be in JSON format.

URL
Server URL HTTP type
UAT https://api-uk-uat.iinsightonline.com/api1/internal_expenses PUT
PRODUCTION https://api-uk.iinsightonline.com/api1/internal_expenses PUT
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
id Id. (i.e.: 3015) Yes
Description Description. (i.e.: Travel) No
time_based Time Based. (i.e.: No) (Values: Yes or No) No
quantity Quantity. (i.e.: 1.5) No
unit_charge Unit Charge. (i.e.: 195.75) No
tax_rate Tax Rate. (i.e.: 0.1) No
charge_code Charge Code. (i.e.: OC07) No
Response
{
    "status": true,
    "message": "Cost successfully updated",
    "data": {
        "case_id": -2,
        "id": "8768",
        "time_based": "1",
        "description": "Huascar Meeting",
        "reference_date": "0",
        "quantity": "1.00",
        "unit_charge": "250",
        "tax_amount": 25,
        "tax_rate": "0.10",
        "total_charge": 275,
        "charge_code": "OS02"
    }
}
	

4. Delete Internal Expense (api1/internal_expenses)

This method will delete a Internal Expense and get an answer confirming the deletion of the record in iinsight. The collection wil be in JSON format.

URL
Server URL HTTP type
UAT https://api-uk-uat.iinsightonline.com/api1/internal_expenses DELETE
PRODUCTION https://api-uk.iinsightonline.com/api1/internal_expenses DELETE
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
id Id. (i.e.: 3015) Yes
Response
{
    "status": true,
    "message": "Cost successfully deleted"
}