-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorders.http
More file actions
69 lines (57 loc) · 1.75 KB
/
orders.http
File metadata and controls
69 lines (57 loc) · 1.75 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
### Multi-Tenant Order & Audit Platform API Requests
### 1. Get OAuth2 Token (Authorization Code Flow)
### First, you need to authenticate and get a token
### Visit: http://localhost:8080/oauth2/authorize?client_id=order-client&response_type=code&scope=orders:read orders:write&redirect_uri=http://127.0.0.1:8080/login/oauth2/code/order-client
### 2. Create Order
POST http://localhost:8080/api/v1/orders
Content-Type: application/json
Authorization: Bearer {{access_token}}
{
"items": [
{
"sku": "SKU001",
"quantity": 2,
"price": 10.50
},
{
"sku": "SKU002",
"quantity": 1,
"price": 25.00
}
]
}
### 3. Get Order by ID
GET http://localhost:8080/api/v1/orders/1
Authorization: Bearer {{access_token}}
### 4. Update Order
PUT http://localhost:8080/api/v1/orders/1
Content-Type: application/json
Authorization: Bearer {{access_token}}
{
"status": "CONFIRMED",
"items": [
{
"sku": "SKU001",
"quantity": 3,
"price": 10.50
}
]
}
### 5. Search Orders by Status
GET http://localhost:8080/api/v1/orders?status=PENDING
Authorization: Bearer {{access_token}}
### 6. Search Orders by Date Range
GET http://localhost:8080/api/v1/orders?from=2024-01-01T00:00:00&to=2024-12-31T23:59:59
Authorization: Bearer {{access_token}}
### 7. Get All Orders
GET http://localhost:8080/api/v1/orders
Authorization: Bearer {{access_token}}
### 8. Get Audit Events for Order
GET http://localhost:8080/api/v1/audit?entityType=ORDER&entityId=1
Authorization: Bearer {{access_token}}
### 9. Get Order Snapshots
GET http://localhost:8080/api/v1/orders/1/snapshots
Authorization: Bearer {{access_token}}
### 10. Get Auth Events for User
GET http://localhost:8080/api/v1/auth/events?userId=1
Authorization: Bearer {{access_token}}