The iRecharge API is designed to manage articles related to different providers, currencies, and prices. It provides CRUD operations (Create, Read, Update, Delete) for articles stored in a MySQL database.
-
Clone the repository:
git clone https://github.com/davitacols/irecharge_api.git postman https://www.postman.com/material-pilot-19389684/workspace/irecharge/collection/32869036-a5585faa-3d1a-45e9-ad61-e1fac2ef8886?action=share&creator=32869036
-
Change to the project directory:
cd irecharge-api -
Set up the MySQL database:
- Create a database named
irecharge. - Update the
DATABASE_URLinmain.pywith your MySQL credentials.
- Create a database named
Endpoint: GET /articles/
Description: Retrieve a list of all articles.
Response:
```json
[
{
"article_no": 101,
"currency": "US Dollar",
"provider_no": "0001",
"provider": "Flutterwave",
"price": 1000
},
]
-
Endpoint:
POST /articles/ -
Description: Create a new article.
-
Request:
{ "article_no": 104, "currency": "EU Euro", "provider_no": "0009", "provider": "Stripe", "price": 1500 } -
Response:
{ "article_no": 104, "currency": "EU Euro", "provider_no": "0009", "provider": "Stripe", "price": 1500 }
- Endpoint:
PUT /articles/{article_no} - Description: Update details of a specific article by its article_no.
- Request:
{ "article_no": 104, "currency": "EU Euro", "provider_no": "0009", "provider": "Stripe", "price": 2000 } - Response:
{ "article_no": 104, "currency": "EU Euro", "provider_no": "0009", "provider": "Stripe", "price": 2000 }
-
Endpoint:
DELETE /articles/{article_no} -
Description: Delete a specific article by its article_no.
-
Response:
{ "article_no": 104, "currency": "EU Euro", "provider_no": "0009", "provider": "Stripe", "price": 2000 }
To run tests, use pytest:
```bash
pytest tests/
```
Contributions are welcome! Please check the Contribution Guidelines for more details.
This project is licensed under the MIT License - see the LICENSE file for details.