This repository contains the backend code for the CoffeeShopManagement project.
- Clone the repository:
git clone https://github.com/FiveD-SE/CoffeShopMangementBackend.git
- Install dependencies:
npm install
- Start the server:
npm start
- Access the API endpoints at
http://localhost:3000
.
-
POST
/orders/create
- Creates a new order.
- Request Body:
{ "description": "string", "returnUrl": "string", "cancelUrl": "string", "amount": "number" }
- Response Body:
{ "error": 0, "message": "Success", "data": { "bin": "string", "checkoutUrl": "string", "accountNumber": "string", "accountName": "string", "amount": "number", "description": "string", "orderCode": "number", "qrCode": "string" } }
-
GET
/orders/:orderId
- Retrieves an order by ID.
- Response Body:
{ "error": 0, "message": "ok", "data": { // Order details } }
-
PUT
/orders/:orderId
- Cancels an order by ID.
- Request Body:
{ "cancellationReason": "string" }
- Response Body:
{ "error": 0, "message": "ok", "data": { // Order details } }
-
POST
/orders/confirm-webhook
- Confirms a webhook URL.
- Request Body:
{ "webhookUrl": "string" }
- Response Body:
{ "error": 0, "message": "ok", "data": null }
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.