You can get a list of the inventory of an entity by using the following endpoint.
{warning} Don't forget that all endpoints documented here need to be prefixed with
api/1.0/campaigns/{campaign.id}/
.
Method | URI | Headers |
---|---|---|
GET/HEAD | entities/{entity.id}/inventories |
Default |
{
"data": [
{
"created_at": "2019-01-30T00:01:44.000000Z",
"created_by": 1,
"entity_id": 69,
"id": 31,
"item_id": 5,
"visibility": "all",
"amount": "5",
"position": "Bank",
"updated_at": "2019-08-29T13:48:54.000000Z",
"updated_by": null
}
]
}
To add an item to an entity, use the following endpoint.
Method | URI | Headers |
---|---|---|
POST | entities/{entity.id}/inventories |
Default |
Parameter | Type | Detail |
---|---|---|
item_id |
integer (Required) |
ID of the item |
amount |
string |
The amount of items |
position |
string |
The position of the item in the inventory |
entity_id |
integer (Required) |
The inventory's parent entity |
visibility |
string |
The visibility: all , self , admin or self-admin . |
{success} Code 200 with JSON body of the new inventory.
To update an inventory, use the following endpoint.
Method | URI | Headers |
---|---|---|
PUT/PATCH | entities/{entity.id}/inventories/{inventory.id} |
Default |
The same body parameters are available as for when creating an inventory.
{success} Code 200 with JSON body of the updated inventory.
To delete an inventory, use the following endpoint.
Method | URI | Headers |
---|---|---|
DELETE | entities/{entity.id}/inventories/{inventory.id} |
Default |
{success} Code 200 with JSON.