Headers:
{
statusCode: 200,
message: 'User fecthed Correctly',
data: {
email,
address,
name,
cartItems, // may not be present
lastItemAddedAt, // may not be present
orders // may not be present
}
}
400: Required fields missing or they were invalid
403: Unauthorized access
404: User not Found
500: Insufficient Permissions
email* (Required)
password* (Required)
name* (Required)
address* (Required)
Headers:
{
statusCode: 200,
message: 'User created',
data: {
email,
address,
name
}
}
400: User already exists
400: Required fields missing or they were invalid
500: Insufficient Permissions
/users?email=example@mail.com
Headers:
{
statusCode: 200,
message: 'User updated correctly',
data: {
email,
address,
name
}
}
400: User already exists
400: Nothing to update
400: Email in query is required
403: Unauthorized access
404: User not found
421: Email cannot be updated
500: Insufficient Permissions
/users?email=example@mail.com
Headers:
{
statusCode: 200,
message: 'user removed correctly',
data: {}
}
400: Required fields missing or they were invalid
403: Unauthorized access
404: User not found
500: Insufficient Permissions
Headers:
{
statusCode: 200,
message: 'Token fecthed Correctly',
data: {
id,
userEmail,
expires
}
}
400: Required fields missing or they were invalid
403: Unauthorized access
404: Token not Found
500: Insufficient Permissions
email* (Required)
password* (Required)
Headers:
{
statusCode: 200,
message: 'user logged in',
data: {
id,
userEmail,
expires
}
}
400: Required fields missing or they were invalid
400: wrong email or password
400: Token already exists
404: User does not exists
500: Insufficient Permissions
Headers:
{
statusCode: 200,
message: 'Token updated correctly',
data: {
id,
userEmail,
expires
}
}
400: Nothing to update
400: id in query is required
403: Unauthorized access
404: Token not found
421: id cannot be updated
500: Insufficient Permissions
Headers:
{
statusCode: 200,
message: 'token removed correctly',
data: {}
}
400: Required fields missing or they were invalid
403: Unauthorized access
404: Token not found
500: Insufficient Permissions
id (optional) // if id is not present, will return the list of items in storage
Headers:
{
statusCode: 200,
message: 'Item fecthed Correctly',
data: {
id,
price,
name
}
}
400: Required fields missing or they were invalid
403: Unauthorized access
404: Item not Found
500: Insufficient Permissions
name* (Required)
price* (Required)
Headers:
{
statusCode: 200,
message: 'Item created',
data: {
id,
price,
name
}
}
400: Required fields missing or they were invalid
500: Insufficient Permissions
name* required
price* required
Headers:
{
statusCode: 200,
message: 'Item updated correctly',
data: {
email,
address,
name
}
}
400: Item already exists
400: Nothing to update
400: id in query is required
403: Unauthorized access
404: Item not found
421: id cannot be updated
500: Insufficient Permissions
Will remove the item and update all users cartItems that had this item and remove it
Headers:
{
statusCode: 200,
message: 'item removed correctly',
data: {}
}
400: Required fields missing or they were invalid
403: Unauthorized access
404: Item not found
500: Insufficient Permissions
Headers:
{
statusCode: 200,
message: 'Cart fecthed Correctly',
data: {
id,
price,
name
}
}
403: Unauthorized access
404: items not Found
500: Insufficient Permissions
Headers:
{
statusCode: 200,
message: 'item added to cart',
data: {
email,
address,
name,
cartItems,
lastItemAddedAt,
orders // may not be present
}
}
400: Required fields missing or they were invalid
500: Insufficient Permissions
Headers:
{
statusCode: 200,
message: 'item removed from cart',
data: {
email,
address,
name,
cartItems,
lastItemAddedAt,
orders // may not be present
}
}
400: Required fields missing or they were invalid
403: Unauthorized access
404: item not found on cart
404: User not found
500: Insufficient Permissions
Headers:
{
statusCode: 200,
message: 'Order fecthed Correctly',
data: {
id,
items,
iat,
price,
paymentProcessed
}
}
400: Required fields missing or they were invalid
403: Unauthorized access
404: Order not found
500: Insufficient Permissions
Will create the order with the items on the cart
Headers:
{
statusCode: 200,
message: 'order created',
data: {
id,
items,
iat,
price,
paymentProcessed
}
}
400: payment not processed
400: no items on cart to place an order
400: Order already exists
400: Required fields missing or they were invalid
500: Insufficient Permissions