-
Notifications
You must be signed in to change notification settings - Fork 0
/
Api_Docs
131 lines (112 loc) · 4.01 KB
/
Api_Docs
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/whoAmI
Body: Null
Returns which node is it connected to.
--------------------------------------
/switch-party/{party}
pathvariable: The name of the party to connect to
Connects to a different node
--------------------------------------
/createShopAccount
Body: {"shopAccountName":"String"}
Creates a shop with the given accountName
--------------------------------------
/createUserAccount
Body: {"userName":"String"}
Creates a buyer account with the given name
--------------------------------------
/createDeliveryAccount
Body: {"deliveryPersonName":"String"}
Creates a delivery person account with the given name
--------------------------------------
/addItem
Body: {
"productName":"String"
"productDetails":"String"
"price":double
"expiryDate":"String"
"quantity":int
"barCode":"String"
"shopAccountName":"String"
}
Creates and adds item to the inventory of the mentioned shop account and returns the product key which is used to uniqiuely identify the product
-----------------------------------------------------------------------
/viewInventory/{shopAccountName}
Pathvariable: shopAccountName
Returns a list of the inventory of the specified account name
--------------------------------------
/placeOrder
Body: {
"productKey":"String"
"buyerAccountName":"String"
"shopAccountName":"String"
"deliveryAddress":"String"
"amtToShop":double
"amtToDelivery":double
}
Places order for the specified product. It returns the trackingId/orderId (both term used with same meaning) of the placed order
--------------------------------------------------------------------------
/getOrders/{shopAccountName}
PathVariable: shopAccountName
Returns list of received orders by the shop whoes account name is specified
----------------------------------------------------------------------------
/requestDelivery
Body: {
"trackingId":"String"
"shopName":"String"
}
Request for delivery service for the order whoes tracking id is mentioned. The shop issuing the request must specify it's account name
----------------------------------------------------------------------------
/acceptDelivery
Body: {
"orderId":"String"
"barCode":"String"
"acceptor":"String"
"shopAccountName":"String"
}
This is called by the delivery person accepting the order. The account name of the accepting account must be specified in acceptor field. The acceptor scans the barCode and the scaned code is send in barCode field
----------------------------------------------------------------------------
/receivedDeliveryRequest
Returns the list of Delivery Requests as received by the Delivery node
----------------------------------------------------------------------------
/getLeftHandovers/{deliveryAccountName}
Pathvariable: Delivery person account name
Returns the list of left over items which are yet to be handed over to the buyer
----------------------------------------------------------------------------
/handoverItem
Body: {
"trackingId":"String"
"deliveryAccountName":"String"
}
This is called when the item is handed over to the buyer of the product
----------------------------------------------------------------------------
/verifyProduct
Body: {
"productKey":"String"
"barCode":"String"
}
This is called by the buyer to verify the product he received
----------------------------------------------------------------------------
/getBalance/{accountName}
pathvariable: Account Name
Returns the balance of the account
----------------------------------------------------------------------------
/issueCoin
Body: {
"accountName":"String",
"value":double
}
Issues coin of specified value to account specified in accountName
----------------------------------------------------------------------------
/rejectOrder
Body: {
"productKey":"String"
"accountName":"String"
}
Reject order with the specific product key by the shop whoes accountName is specified
----------------------------------------------------------------------------
/requestRefund
Body: {
"productKey":"String"
"accountName":"String"
}
Request refund by the user whoes accountName is specified