InvMan/README.md
2020-10-16 18:56:31 -05:00

4.3 KiB

InvMan

Table of Contents

  1. What is InvMan?
  2. API Usage
    1. GET Requests
    2. POST Requests

What is InvMan?

InvMan is a Flask app which provides a web API and web UI to keep inventory using a PostgreSQL backend.


API Usage

GET requests (getting information)


Please keep in mind:

  • Text surrounded by [ and ] are parameters which should be replaced.
  • Names are case-sensitive.

Get a list of locations

GET /api/v1/locations

Get information about a location

GET /api/v1/location/name/[location-name]

Get the quantities of all products at a location

GET /api/v1/location/[location-name]/quantities

Get the quantity of a product (by UPC) at a location

GET /api/v1/location/[location-name]/quantity/upc/[product-upc]

Get the quantity of a product (by name) at a location

GET /api/v1/location/[location-name]/quantity/name/[product-name]

Get a list of products

GET /api/v1/products

Get information about a product (by UPC)

GET /api/v1/product/upc/[product-upc]

Get information about a product (by name)

GET /api/v1/product/name/[product-name]

Get a list of brands

GET /api/v1/brands

Get information about a brand

GET /api/v1/brand/name/[brand-name]

Get a list of units

GET /api/v1/units

Get information about a unit (by name)

GET /api/v1/unit/name/[unit-name]

Get a list of purchases

GET /api/v1/purchases

Get information about a purchase (by id)

GET /api/v1/purchase/id/[purchase-id]

Get a list of uses

GET /api/v1/uses

Get information about a use (by id)

GET /api/v1/purchase/id/[use-id]

POST Requests (creating objects)


Create a location

POST /api/v1/create_location
Argument Name Description Required?
name Name of the location Yes
description Description of the location No

Request form:

Create a brand

POST /api/v1/create_brand
Argument Name Description Required?
name Name of the brand Yes
description Description of the brand No

Request form:

Create a unit

POST /api/v1/create_unit
Argument Name Description Required?
name Name of the unit Yes
description Description of the unit No

Request form:

Create a product

POST /api/v1/create_product
Argument Name Description Required?
upc UPC of the product Yes
brand Brand which makes the product Yes
name Name of the product Yes
size Size of the product Yes
sizeunit Unit used in size Yes
description Description of the product No

Request form:

Create a purchase

POST /api/v1/create_purchase
Argument Name Description Required?
upc UPC of the product which was purchased Yes
quantity Quantity of the product purchased Yes
date Date of this purchase Yes
location Location to link this purchase to Yes

Create a use

POST /api/v1/create_use
Argument Name Description Required?
upc UPC of the product which was used Yes
quantity Quantity of the product used Yes
date Date of this usage Yes
location Location to link this usage to Yes