Orders - API Documentation

Why do you want to go out when you can get it home delivered !

List My Orders

GET
/me/orders

Parameters
access_token String A valid access token.
Response
[{
	"_id": ID,
	"store_id": ID,
	"restaurant_id": ID,
	"item": {
	    "item_id": ID,
	    "item_title": String,
	    "item_quantity": Number,
	    "item_price": Number
	    },
	"status": {
	    "received": DateTime,
	    "processed": DateTime,
	    "dispatched": DateTime,
	    "delivered": DateTime
	    },
	"cancellation": {
	    "reason": String,
	    "done_at": DateTime
	    },
	"address": {
	    "addressLine1": String,
	    "addressLine2": String,
	    "landmark": String,
	    "state": String,
	    "city": String,
	    "district": String,
	    "country": String,
	    "geo": {
	            "latitude": Number,
	            "longitude": Number
	        }
	    },
	"user": {
	    "user_id": ID,
	    "user_avatar": String,
	    "user_username": String,
	    "user_first_name": String,
	    "user_rating": Number,
	    "payment_method": String
	    },
	"contact": {
	    "user_email": String,
	    "user_phone": String
	    }
}]

List Store Orders

GET
/stores/:store_id/orders

Parameters
access_token String A valid access token.
Response
[{
	"_id": ID,
	"store_id": ID,
	"item": {
	    "item_id": ID,
	    "item_title": String,
	    "item_quantity": Number,
	    "item_price": Number
	    },
	"status": {
	    "received": DateTime,
	    "processed": DateTime,
	    "dispatched": DateTime,
	    "delivered": DateTime
	    },
	"cancellation": {
	    "reason": String,
	    "done_at": DateTime
	    },
	"address": {
	    "addressLine1": String,
	    "addressLine2": String,
	    "landmark": String,
	    "state": String,
	    "city": String,
	    "district": String,
	    "country": String,
	    "geo": {
	            "latitude": Number,
	            "longitude": Number
	        }
	    },
	"user": {
	    "user_id": ID,
	    "user_avatar": String,
	    "user_username": String,
	    "user_first_name": String,
	    "user_rating": Number,
	    "payment_method": String
	    },
	"contact": {
	    "user_email": String,
	    "user_phone": String
	    }
}]

List Restaurant Orders

GET
/restaurants/:restaurant_id/orders

Parameters
access_token String A valid access token.
Response
[{
	"_id": ID,
	"restaurant_id": ID,
	"item": {
	    "item_id": ID,
	    "item_title": String,
	    "item_quantity": Number,
	    "item_price": Number
	    },
	"status": {
	    "received": DateTime,
	    "processed": DateTime,
	    "dispatched": DateTime,
	    "delivered": DateTime
	    },
	"cancellation": {
	    "reason": String,
	    "done_at": DateTime
	    },
	"address": {
	    "addressLine1": String,
	    "addressLine2": String,
	    "landmark": String,
	    "state": String,
	    "city": String,
	    "district": String,
	    "country": String,
	    "geo": {
	            "latitude": Number,
	            "longitude": Number
	        }
	    },
	"user": {
	    "user_id": ID,
	    "user_avatar": String,
	    "user_username": String,
	    "user_first_name": String,
	    "user_rating": Number,
	    "payment_method": String
	    },
	"contact": {
	    "user_email": String,
	    "user_phone": String
	    }
}]

Get Order

GET
/orders/:order_id

Parameters
access_token String A valid access token.
Response
{
	"_id": ID,
	"restaurant_id": ID,
	"item": {
	    "item_id": ID,
	    "item_title": String,
	    "item_quantity": Number,
	    "item_price": Number
	    },
	"status": {
	    "received": DateTime,
	    "processed": DateTime,
	    "dispatched": DateTime,
	    "delivered": DateTime
	    },
	"cancellation": {
	    "reason": String,
	    "done_at": DateTime
	    },
	"address": {
	    "addressLine1": String,
	    "addressLine2": String,
	    "landmark": String,
	    "state": String,
	    "city": String,
	    "district": String,
	    "country": String,
	    "geo": {
	            "latitude": Number,
	            "longitude": Number
	        }
	    },
	"user": {
	    "user_id": ID,
	    "user_avatar": String,
	    "user_username": String,
	    "user_first_name": String,
	    "user_rating": Number,
	    "payment_method": String
	    },
	"contact": {
	    "user_email": String,
	    "user_phone": String
	    }
}

Delete Order

DELETE
/orders/:order_id

Parameters
access_token String A valid access token.
Response
Status: 204