Skip to main content

DELETE /api/accrued-expenses/:id

Deletes an existing manual expense. Only expenses with tipo_origen: MANUAL can be deleted. XML-imported expenses cannot be removed through this endpoint.

Authentication

This endpoint requires authentication. Include your access token in the request cookies.

Path Parameters

id
string
required
Unique identifier of the expense to delete

Response

message
string
required
Success message confirming deletion

Example Request

curl -X DELETE "https://api.contafy.com/api/accrued-expenses/expense-789" \
  -H "Cookie: access_token=your_access_token"

Example Response

{
  "message": "Expense deleted successfully"
}

Error Responses

401 Unauthorized
error
Authentication required or token expired
{
  "error": "Unauthorized",
  "message": "Authentication required"
}
400 Bad Request
error
Attempting to delete an XML-imported expense
{
  "error": "Bad Request",
  "message": "Cannot delete XML-imported expenses. Only manual expenses can be deleted."
}
403 Forbidden
error
User does not have permission to delete this expense
{
  "error": "Forbidden",
  "message": "You do not have permission to delete this expense"
}
404 Not Found
error
Expense not found
{
  "error": "Not Found",
  "message": "Expense not found"
}
500 Internal Server Error
error
Server error occurred
{
  "error": "Internal Server Error",
  "message": "An unexpected error occurred"
}
This operation is permanent and cannot be undone. Ensure you want to delete the expense before making this request.