This is a sample API for a fictional pizza delivery company called Modinos Pizza
When initializing the app, please create the following in the app's root directory to store the app data:
- /.data
- /.data/users
- /.data/tokens
- /.data/menuItems
- /.data/carts
- /.data/orders
- https (to store ssl cert & key files)
- .env.js (to store keys, etc.)
Sample Payload
{
"firstName" : "Ishan",
"lastName" : "Loya",
"email": "[email protected]",
"password": "xxxxxx",
"address": "Mumbai, India",
"tosAgreement": true
}
Sample query string parameter
{
"email": "[email protected]"
}
Sample payload
{
"email": "[email protected]",
"firstName" : "Ishan",
"lastName" : "Loya",
"password": "12345",
"address": "Paris"
}
Sample query string parameter.
Deleting user will delete all user orders and user cart
{
"email": "[email protected]"
}
Sample Payload
{
"email": "[email protected]",
"password": "xxxxxx"
}
Sample query string parameter
{
"id": "token_id_string"
}
Sample payload
{
"id": "token_id_string",
"extends" : true
}
Sample query string parameter
{
"id": "token_id_string"
}
Menu items should be created with the following format
001.json
{
"id": "001",
"title": "Vegan Cheese Pizza",
"price": 10.5
}
User should be authenticated, no query string parameters required. Will return list of all menu items
Will be created automatically when a user is created
Sample query string parameter
{
"email": "[email protected]"
}
Sample payload (menuItem ids and quantities required)
{
"items": {
"001": 2,
"002": 3,
"005": 2
}
}
Will be deleted automatically when a user is deleted
Deleting user will delete all user orders.
Sample payload (will automatically use current cart data to create new order)
New order ID will be added to user object.
{
"email": "[email protected]"
}