Delete Expense Code


DELETE /v2/api/corporate/expenseCode

Use this Api to delete an existing expense code.


Request Parameters

Name Data Type Description Type Remark
expense_code string Expense Code Name Payload Mandatory
  • Example Request

    DELETE

    https://devapi.olacabs.com/v2/api/corporate/expenseCode

    
        {
          "expense_code" : "ExpenseCodeName"
        }
    
        Headers: {
          X-CORPORATE-TOKEN: fd5d4d3726121212f12ff12f12f1f12f1f12fa
        }
    
    

    Example Response (Success)

    
        {
          "expense_code": "ExpenseCodeName",
          "expense_code_created": true,
          "successful_scopes": 0,
          "failed_scopes": 0,
          "expense_code_message": "expense code deleted successfully",
          "expense_code_scope_error_dtos": []
        }
    
    

    Example Responses (Failures)

    • expense code was never added for the entity

        Request:
          [
            {
              "expense_code": "EXPENSECODE",
              "expense_code_creation_level": "CORPORATE",
              "expense_code_created_for": null
            },
            {
              "expense_code": "EXPENSECODE",
              "expense_code_creation_level": "GROUP",
              "expense_code_created_for": "Manager Group"
            },
            {
              "expense_code": "EXPENSECODE",
              "expense_code_creation_level": "EMPLOYEE",
              "expense_code_created_for": "employee@corporate.com"
            }
          ]
      
        Response:
          {
            "deleted_count": 0,
            "error_count": 3,
            "error_messages": [
              {
                "expense_code_creation_level": "CORPORATE",
                "expense_code_created_for": null,
                "expense_code": "EXPENSECODE",
                "message": "Expense code not found"
              },
              {
                "expense_code_creation_level": "GROUP",
                "expense_code_created_for": "Manager Group",
                "expense_code": "EXPENSECODE",
                "message": "Expense code not found"
              },
              {
                "expense_code_creation_level": "EMPLOYEE",
                "expense_code_created_for": "employee@corporate.com",
                "expense_code": "EXPENSECODE",
                "message": "Expense code not found"
              }
            ]
          }
      
      
    • expense code already deleted for the entity

        Request:
          [
            {
              "expense_code": "EXPENSECODE",
              "expense_code_creation_level": "CORPORATE",
              "expense_code_created_for": null
            },
            {
              "expense_code": "EXPENSECODE",
              "expense_code_creation_level": "GROUP",
              "expense_code_created_for": "Manager Group"
            },
            {
              "expense_code": "EXPENSECODE",
              "expense_code_creation_level": "EMPLOYEE",
              "expense_code_created_for": "employee@corporate.com"
            }
          ]
      
        Response:
          {
            "deleted_count": 0,
            "error_count": 3,
            "error_messages": [
              {
                "expense_code_creation_level": "CORPORATE",
                "expense_code_created_for": null,
                "expense_code": "EXPENSECODE",
                "message": "Expense code already deleted"
              },
              {
                "expense_code_creation_level": "GROUP",
                "expense_code_created_for": "Manager Group",
                "expense_code": "EXPENSECODE",
                "message": "Expense code already deleted"
              },
              {
                "expense_code_creation_level": "EMPLOYEE",
                "expense_code_created_for": "employee@corporate.com",
                "expense_code": "EXPENSECODE",
                "message": "Expense code already deleted"
              }
            ]
          }
      
      
    • expense_code_created_for does not exists

        Request:
          [
           {
             "expense_code": "EXPENSECODE",
             "expense_code_creation_level": "GROUP",
             "expense_code_created_for": "Wrong Group"
           },
           {
             "expense_code": "EXPENSECODE",
             "expense_code_creation_level": "EMPLOYEE",
             "expense_code_created_for": "wrong.employee"
           }
         ]
      
        Response:
         {
           "deleted_count": 0,
           "error_count": 2,
           "error_messages": [
             {
               "expense_code_creation_level": "GROUP",
               "expense_code_created_for": "Wrong Group",
               "expense_code": "EXPENSECODE",
               "message": "Corporate Group not found with given name"
             },
             {
               "expense_code_creation_level": "EMPLOYEE",
               "expense_code_created_for": "wrong.employee",
               "expense_code": "EXPENSECODE",
               "message": "Corporate User not found with given email address"
             }
           ]
         }