POST
/v2/api/corporate/expenseCode/bulk
For corporates that wish to integrate internal trip approval flows with the Expense Code feature, the following process may be followed:
Name | Data Type | Description | Type | Remark |
---|---|---|---|---|
expense_code | string | Expense Code Name | Payload | Mandatory |
capping | map |
Capping
|
Payload | Optional |
scopes | list of objects |
Scopes
|
Payload | Mandatory |
POST
https://devapi.olacabs.com/v2/api/corporate/expenseCode/bulk
[
{
"expense_code": "MyExpenseCode1",
"scopes": [
{
"expense_code_creation_level": "EMPLOYEE1",
"expense_code_created_for": "test.user@abc.com"
},
{
"expense_code_creation_level": "GROUP1",
"expense_code_created_for": "ExampleGroup"
},
{
"expense_code_creation_level": "CORPORATE",
"expense_code_created_for": null
}
],
"capping": {
"start_time": "08-01-2017 00:09:11",
"end_time": "12-01-2018 00:19:00",
"ride_cap": 10
}
},
{
"expense_code": "MyExpenseCode2",
"scopes": [
{
"expense_code_creation_level": "EMPLOYEE2",
"expense_code_created_for": "test.user@abc.com"
},
{
"expense_code_creation_level": "EMPLOYEE3",
"expense_code_created_for": "xyz@corporate_partners.com"
},
{
"expense_code_creation_level": "GROUP2",
"expense_code_created_for": "ExampleGroup"
},
{
"expense_code_creation_level": "GROUP2",
"expense_code_created_for": "testtesttest"
},
{
"expense_code_creation_level": "CORPORATE",
"expense_code_created_for": null
},
{
"expense_code_creation_level": "CORPORATE",
"expense_code_created_for": null
}
],
"capping": {
"start_time": "08-01-2017 00:09:11",
"end_time": "12-01-2018 00:19:00",
"ride_cap": 100
}
}
]
Headers: {
X-CORPORATE-TOKEN: fd5d4d3726121212f12ff12f12f1f12f1f12fa
}
{
"successful_expense_codes": 2,
"failed_expense_codes": 0,
"expense_code_responses": [
{
"expense_code": "MyExpenseCode1",
"expense_code_created": true,
"successful_scopes": 1,
"failed_scopes": 2,
"expense_code_message": "Expense code successfully created",
"expense_code_scope_error_dtos": [
{
"entity_type": "EMPLOYEE1",
"entity_created_as": "test.user@abc.com",
"entity_error": "Scope addition failed, type can only be EMPLOYEE, GROUP or\nCORPORATE",
"successful": false
},
{
"entity_type": "GROUP1",
"entity_created_as": "ExampleGroup",
"entity_error": "Scope addition failed, type can only be EMPLOYEE, GROUP or\nCORPORATE",
"successful": false
},
{
"entity_type": "CORPORATE",
"entity_created_as": "NA",
"entity_error": "Successfully Added",
"successful": true
}
]
},
{
"expense_code": "MyExpenseCode2",
"expense_code_created": true,
"successful_scopes": 1,
"failed_scopes": 5,
"expense_code_message": "Expense code successfully created",
"expense_code_scope_error_dtos": [
{
"entity_type": "EMPLOYEE2",
"entity_created_as": "test.user@abc.com",
"entity_error": "Scope addition failed, type can only be EMPLOYEE, GROUP or\nCORPORATE",
"successful": false
},
{
"entity_type": "EMPLOYEE3",
"entity_created_as": "xyz@corporate_partners.com",
"entity_error": "Scope addition failed, type can only be EMPLOYEE, GROUP or\nCORPORATE",
"successful": false
},
{
"entity_type": "GROUP2",
"entity_created_as": "ExampleGroup",
"entity_error": "Scope addition failed, type can only be EMPLOYEE, GROUP or\nCORPORATE",
"successful": false
},
{
"entity_type": "GROUP2",
"entity_created_as": "testtesttest",
"entity_error": "Scope addition failed, type can only be EMPLOYEE, GROUP or\nCORPORATE",
"successful": false
},
{
"entity_type": "CORPORATE",
"entity_created_as": "NA",
"entity_error": "Successfully Added",
"successful": true
},
{
"entity_type": "CORPORATE",
"entity_created_as": "NA",
"entity_error": "Scope already exists",
"successful": false
}
]
}
]
}