Budgets

List All Budgets for an Event

GET /budgets/list/{event_id}

Request

Replace {event_id} with the ID of the event to retrieve budgets.

Response

{
  "status": "success",
  "return_count": 2,
  "data": [
    {
      "id": 1,
      "name": "Budget 1",
      "total_amount": 500.00,
      "items_count": 3
    },
    {
      "id": 2,
      "name": "Budget 2",
      "total_amount": 1000.00,
      "items_count": 2
    }
  ]
}

The response includes the status, total number of budgets, and an array of budget details.

View Single Budget

GET /budgets/view/{id}

Request

Replace {id} with the ID of the budget you want to view.

Response

{
  "status": "success",
  "return_count": 1,
  "data": {
    "id": 1,
    "name": "Budget 1",
    "total_amount": 500.00,
    "items_count": 3
  }
}

The response includes the status, total number of budgets (1 in this case), and details of the requested budget.

Create Budget

POST /budgets/create/{event_id}

Request

Replace {event_id} with the ID of the event to which the budget belongs.

{
  "name": "New Budget",
  "description": "Description for New Budget"
}

Response

{
  "status": "success",
  "message": "Budget saved successfully"
}
{
  "status": "error",
  "message": "Budget failed to save"
}
{
  "status": "error",
  "message": "Invalid request method"
}

Update Budget

POST /budgets/update/{id}

Request

Replace {id} with the ID of the budget you want to update.

{
  "name": "Updated Budget",
  "description": "Updated description for Budget"
}

Response

{
  "status": "success",
  "message": "Budget saved successfully"
}
{
  "status": "error",
  "message": "Budget failed to save"
}
{
  "status": "error",
  "message": "Invalid request method"
}

Delete Budget

POST /budgets/delete/{id}

Request

Replace {id} with the ID of the budget you want to delete.

Response

{
  "status": "success",
  "message": "Budget deleted successfully"
}
{
  "status": "error",
  "message": "Budget failed to delete"
}
{
  "status": "error",
  "message": "Invalid request method"
}

List Items for a Budget

GET /budgets/list-items/{id}

Request

Replace {id} with the ID of the budget to retrieve items.

Response

{
  "status": "success",
  "return_count": 3,
  "data": [
    {
      "id": 1,
      "name": "Item 1",
      "amount": 100.00
    },
    {
      "id": 2,
      "name": "Item 2",
      "amount": 200.00
    },
    {
      "id": 3,
      "name": "Item 3",
      "amount": 300.00
    }
  ]
}

The response includes the status, total number of items, and an array of item details for the specified budget.

Create Item for a Budget

POST /budgets/create-item/{id}

Request

Replace {id} with the ID of the budget to which the item belongs.

{
  "name": "New Item",
  "amount": 200.00
}

Response

{
  "status": "success",
  "message": "Item saved successfully"
}
{
  "status": "error",
  "message": "Item failed to save"
}
{
  "status": "error",
  "message": "Invalid request method"
}

Update Item for a Budget

POST /budgets/update-item/{id}

Request

Replace {id} with the ID of the budget item you want to update.

{
  "name": "Updated Item",
  "amount": 150.00
}

Response

{
  "status": "success",
  "message": "Item saved successfully"
}
{
  "status": "error",
  "message": "Item failed to save"
}
{
  "status": "error",
  "message": "Invalid request method"
}

Delete Item for a Budget

POST /budgets/delete-item/{id}

Request

Replace {id} with the ID of the budget item you want to delete.

Response

{
  "status": "success",
  "message": "Item deleted successfully"
}
{
  "status": "error",
  "message": "Item failed to delete"
}
{
  "status": "error",
  "message": "Invalid request method"
}