Invoice API Documentation ๐Ÿ“„๐Ÿ’ป

This project provides a simple API for managing invoices. Below are the available endpoints for creating, reading, updating, and deleting invoices. Each request is designed to be easy to use for integrating with various invoicing systems.

๐Ÿ› ๏ธ API Endpoints

1. Create an Invoice ๐Ÿงพ

Endpoint:

POST /api.php?entity=invoices

Request Body (JSON):

{
  "client_name": "John Doe",
  "amount": 150.0,
  "due_date": "2024-10-20"
}

Description:
Creates a new invoice with the specified client_name, amount, and due_date.


2. Read All Invoices ๐Ÿ“‹

Endpoint:

GET /api.php?entity=invoices

Description:
Fetches all invoices from the system. This endpoint returns a list of all created invoices in JSON format.


3. Update an Invoice โœ๏ธ

Endpoint:

PUT /api.php?entity=invoices&id=1

Request Body (JSON):

{
  "amount": 200.0
}

Description:
Updates an existing invoice by modifying the amount. Replace id=1 with the ID of the invoice you want to update.


4. Delete an Invoice ๐Ÿ—‘๏ธ

Endpoint:

DELETE /api.php?entity=invoices&id=1

Description:
Deletes an invoice by ID. Replace id=1 with the actual invoice ID you want to remove.


โš™๏ธ Setup

  1. Clone the repository:

    git clone https://github.com/digitalterrene/invoice-api.git
    
  2. Install dependencies (if any).

  3. Run the server:

    php -S localhost:8000
    

๐Ÿ’ฌ Feedback and Contributions

Feel free to open issues or submit pull requests for any features or bug fixes. Contributions are welcome! ๐Ÿ˜Š


Made with โค๏ธ by Digital Terrene