Invoices Management
The Invoices API allows you to manage invoices, including creation, updates, approvals, and deletion. This section details the various endpoints available for working with invoices.
Endpoints
1. List Invoices
Endpoint:
GET /api/invoices
Description: Retrieves a list of invoices for the authenticated company, with optional filtering and pagination.
Request Parameters:
company_id(optional): The company ID to filter invoices by. Defaults to the authenticated company's ID.transaction_id(optional): The transaction ID to filter invoices by.status(optional): Filter by invoice status (e.g.,pending,paid).sort(optional): Sort the results (default iscreated_at).order(optional): The order of the results, eitherascordesc(default isdesc).per_page(optional): The number of results per page (default is 10).
Response:
jsonCopy code{
"message": "Invoices retrieved successfully.",
"invoices": [
{
"id": 101,
"description": "Consulting services for Q3",
"service_date": "2024-10-10",
"provider_name": "ABC Consulting",
"total_amount": "5000.00",
"amount_requested": "4500.00",
"status": "unpaid",
"approval_status": "pending",
"balance": "500.00",
"category_name": "Consulting",
"subcategory_name": "Business",
"payment_method": "self",
"transaction_id": "H360-XYZ123",
"user_email": "[email protected]",
"relationship_manager_email": "[email protected]",
"finance_approver_email": null,
"approved_by_manager_email": null,
"comment": null
}
]
}2. Show Invoice Details
Endpoint:
GET /api/invoices/{transaction_id}
Description: Retrieve the details of a specific invoice by its transaction ID.
Response:
3. Create an Invoice
Endpoint:
POST /api/invoices
Description: Creates a new invoice.
Request Body:
Response:
4. Update an Invoice
Endpoint:
PUT /api/invoices/{transaction_id}
Description: Updates an existing invoice by its transaction ID.
Request Body:
Response:
5. Approve an Invoice
Endpoint:
PUT /api/invoices/{transaction_id}/approve
Description: Approves an invoice and optionally notifies the finance approver.
Request Body:
Response:
6. Approve or Deny Finance Approval
Endpoint:
PUT /api/invoices/{transaction_id}/finance-approve
Description: Approves or denies finance approval for an invoice.
Request Body:
Response:
7. Delete an Invoice
Endpoint:
DELETE /api/invoices/{transaction_id}/destroy
Description: Deletes an invoice if it has not been paid or partially paid.
Request Body:
Response:
This documentation is structured for GitBook and can
Last updated