##Users
- User object
{
id: integer
username: string
email: string
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
Returns all users in the system.
- URL Params None
- Data Params None
- Headers Content-Type: application/json
- Success Response:
- Error Response: OR
Returns the specified user.
- URL Params
Required:
id=[integer] - Data Params None
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
Returns all Orders associated with the specified user.
- URL Params
Required:
id=[integer] - Data Params None
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
Creates a new User and returns the new object.
- URL Params None
- Headers Content-Type: application/json
- Data Params
{
}
- Success Response:
- Error Response: OR
Updates fields on the specified user and returns the updated object.
- URL Params
Required:
id=[integer] - Data Params
{
}
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
Deletes the specified user.
- URL Params
Required:
id=[integer] - Data Params None
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
##Products
- Product object
{
id: integer
name: string
cost: float(2)
available_quantity: integer
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
Returns all products in the system.
- URL Params None
- Data Params None
- Headers Content-Type: application/json
- Success Response:
- Error Response: OR
Returns the specified product.
- URL Params
Required:
id=[integer] - Data Params None
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
Returns all Orders associated with the specified product.
- URL Params
Required:
id=[integer] - Data Params None
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
Creates a new Product and returns the new object.
- URL Params None
- Data Params
{
}
- Headers Content-Type: application/json
- Success Response:
- Error Response: OR
Updates fields on the specified product and returns the updated object.
- URL Params
Required:
id=[integer] - Data Params
{
}
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
Deletes the specified product.
- URL Params
Required:
id=[integer] - Data Params None
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
##Orders
- Order object
{
id: integer
user_id: <user_id>
total: float(2)
products: [
{
product: <product_id>,
quantity: integer
},
{
product: <product_id>,
quantity: integer
},
{
product: <product_id>,
quantity: integer
},
]
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
Returns all users in the system.
- URL Params None
- Data Params None
- Headers Content-Type: application/json
- Success Response:
- Error Response: OR
Returns the specified order.
- URL Params
Required:
id=[integer] - Data Params None
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
Returns all Products associated with the specified order.
- URL Params
Required:
id=[integer] - Data Params None
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
Returns all Users associated with the specified order.
- URL Params
Required:
id=[integer] - Data Params None
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
Creates a new Order and returns the new object.
- URL Params None
- Data Params
{
}
- Headers Content-Type: application/json
- Success Response:
- Error Response: OR
Updates fields on the specified order and returns the updated object.
- URL Params
Required:
id=[integer] - Data Params
{
}
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR
Deletes the specified order.
- URL Params
Required:
id=[integer] - Data Params None
- Headers Content-Type: application/json Authorization: Bearer
- Success Response:
- Error Response: OR