-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransactions.http
More file actions
39 lines (34 loc) · 805 Bytes
/
transactions.http
File metadata and controls
39 lines (34 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
### Successful Transaction
POST http://localhost:3000/transaction
Content-Type: application/json
{
"user": {
"username": "john_doe2",
"email": "john2@example.com"
},
"order": {
"user_id": 1,
"product_name": "Smartphone",
"quantity": 1,
"total_price": 999.99
}
}
### Unsuccessful Transaction (Invalid Order - Negative Quantity)
POST http://localhost:3000/transaction
Content-Type: application/json
{
"user": {
"username": "jane_doe",
"email": "jane@example.com"
},
"order": {
"user_id": 2,
"product_name": "Laptop",
"quantity": -1,
"total_price": 1499.99
}
}
### Get All Transactions
GET http://localhost:3000/transactions
### Get Specific Transaction (replace with actual transaction ID)
GET http://localhost:3000/transaction/1234567890