You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://gitter.im/acm-uiuc/merch-development?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5
4
6
-
Possible information sources:
5
+
6
+
This repository contains all of the code related to controlling the underlying merch hardware (the vending machine).
7
+
Merch runs an embedded webserver that can be accessed at merch.acm.illinois.edu.
8
+
9
+
## API
10
+
11
+
Every request through the API has a token in the header that is unique to groot.
12
+
This way, only groot can make requests to vend things.
13
+
The token is stored in the request header.
14
+
15
+
### Vend a location
16
+
To vend a list of items, POST a request to `/vend`.
17
+
The request is of the form
18
+
```json
19
+
{
20
+
"transaction_id": 1,
21
+
"items": ["A1", "B2", "C3"]
22
+
}
23
+
```
24
+
25
+
The machine will respond with
26
+
```json
27
+
{
28
+
"transaction_id": 1,
29
+
"items": [
30
+
{"location": "A1", "error": null},
31
+
{"location": "B2", "error": "some sort of error"},
32
+
{"location": "C3", "error": null},
33
+
34
+
]
35
+
}
36
+
```
37
+
38
+
The errors that can take place while vending are currently:
0 commit comments