Inventories
The inventories your key can reach, and what it may do in each.
List inventories
GET
/inventories
Every inventory your key can reach, and what it may do in each. can lists read, and add, edit, move and delete where both your role and the key allow them.
Reply
200, with a list of inventories in data.
Request
curl https://api.additem.to/api/v1/inventories \
-H "Authorization: Bearer $ADDITEM_KEY"
const res = await fetch("https://api.additem.to/api/v1/inventories", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ADDITEM_KEY}`,
},
});
const { data } = await res.json();
import os, requests
res = requests.get(
"https://api.additem.to/api/v1/inventories",
headers={"Authorization": f"Bearer {os.environ['ADDITEM_KEY']}"},
)
data = res.json()["data"]
Reply 200
{
"data": [
{
"id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
"name": "Workshop",
"currency": "GBP",
"role": "manager",
"can": [
"read",
"add",
"edit",
"move",
"delete"
]
}
]
}
Get an inventory
GET
/inventories/{inventory_id}
One inventory, in the same shape as the list.
Path
inventory_iduuid | The inventory's id, from List inventories. |
Reply
200, with an inventory in data.
Request
curl https://api.additem.to/api/v1/inventories/0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70 \
-H "Authorization: Bearer $ADDITEM_KEY"
const res = await fetch("https://api.additem.to/api/v1/inventories/0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ADDITEM_KEY}`,
},
});
const { data } = await res.json();
import os, requests
res = requests.get(
"https://api.additem.to/api/v1/inventories/0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
headers={"Authorization": f"Bearer {os.environ['ADDITEM_KEY']}"},
)
data = res.json()["data"]
Reply 200
{
"data": {
"id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
"name": "Workshop",
"currency": "GBP",
"role": "manager",
"can": [
"read",
"add",
"edit",
"move",
"delete"
]
}
}
The inventory object
Every reply with an inventory in it has these fields, in this order. Version 1 may add fields at the end, and never renames or removes one.
| Field | What it holds |
|---|---|
iduuid | The inventory's id. |
namestring | Its name. |
currencystring or null | Its currency, such as GBP. Prices are in this. |
rolestring | Your role there. owner, manager, editor, mover, viewer, or custom for a role the owner made. |
canarray | What this key may do there. read, and add, edit, move and delete where both your role and the key allow them. |