POST {API_URL}/users
{
'Content-Type': 'application/json'
}
{
email: string, // required
password: string, // required. (min length is 6)
address: string, // required
name: string, // required
}
204 No Content
GET {API_URL}/users
{
'Content-Type': 'application/json',
token: string // required
}
{
email: string // required
}
200 OK
{
name: string,
email: string,
address: string,
}
PUT {API_URL}/users
{
'Content-Type': 'application/json',
token: string // required
}
{
email: string // required
}
{
address: string,
name: string,
}
204 No Content
DELETE {API_URL}/users
{
'Content-Type': 'application/json',
token: string // required
}
{
email: string // required
}
204 No Content
POST {API_URL}/login
{
'Content-Type': 'application/json'
}
{
email: string, // required
password: string, // required. (min length is 6)
}
200 OK
{
token: string,
}
POST {API_URL}/logout
{
'Content-Type': 'application/json',
token: string // required
}
204 No Content
GET {API_URL}/menu
{
'Content-Type': 'application/json',
token: string // required
}
200 OK
[
{
id: number,
name: string,
price: number,
size: number,
},
...
]
POST {API_URL}/cart
{
'Content-Type': 'application/json',
token: string // required
}
{
itemId: number, // required. Id of pizza
count: number, // required. How many this kind of pizza add to cart
}
204 No Content
GET {API_URL}/cart
{
'Content-Type': 'application/json',
token: string // required
}
200 OK
[
{
itemId: number,
count: number
},
...
]
PUT {API_URL}/cart
{
'Content-Type': 'application/json',
token: string // required
}
{
itemId: number
}
{
count: number
}
204 No Content
DELETE {API_URL}/cart
{
'Content-Type': 'application/json',
token: string // required
}
{
itemId: number
}
204 No Content
POST {API_URL}/orders
{
'Content-Type': 'application/json',
token: string // required
}
{
cardNumber: string, // required
expirationMonth: number, // required (1-12)
expirationYear: number // required. More than current year
cvs: number // required (100-999)
}
200 OK
{
message: string
}
GET {API_URL}/profile
{
'Content-Type': 'application/json',
token: string // required
}
200 OK
{
name: string,
email: string,
address: string,
}
Do not delete pizza data in /.data/menu/pizzaList.json