Update a Expense

PUT/api/expenses

Headers

FieldTypeDescription
authtoken String Authentication token, generated from admin area

Parameters

FieldTypeDescription
expense_name String optional Optional. Name
note String optional Optional. Note
category Number Mandatory. Expense Category
amount Decimal Mandatory. Expense Amount
date Date Mandatory. Expense Date
clientid Number Optional. Customer id
currency Number Mandatory. currency field
tax Number Optional. Tax 1
tax2 Number Optional. Tax 2
paymentmode Number Optional. Payment mode
reference_no String optional Optional. Reference #
recurring String optional Optional. recurring 1 to 12 or custom
repeat_every_custom Number optional Optional. if recurring is custom set number gap
repeat_type_custom String optional Optional. if recurring is custom set gap option day/week/month/year
curl -X PUT "https://yoursite.com/api/expenses" \
  -H "authtoken: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "category": "...", "amount": "...", "date": "...", "clientid": "...", "currency": "...", "tax": "...", "tax2": "...", "paymentmode": "..." }'

Success-Response:

HTTP/1.1 200 OK
{
  "status": true,
  "message": "Expense Updated Successfully"
}

Error-Response:

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Expense Update Fail"
}

Error-Response:

HTTP/1.1 409 Conflict
{
  "status": false,
  "error": {
     "category":"The Expense Category is not found"
 },
 "message": "The Expense Category is not found"
}

Error-Response:

HTTP/1.1 409 Conflict
{
  "status": false,
  "error": {
     "date":"The Expense date field is required."
 },
 "message": "The Expense date field is required."
}

Error-Response:

HTTP/1.1 409 Conflict
{
  "status": false,
  "error": {
     "amount":"The Amount field is required."
 },
 "message": "The Amount field is required."
}
MethodPUT
Path/api/expenses
GroupExpenses
Sincev0.3.0
Defined inmodules/api/controllers/Expenses.php