Groceries - API Documentation

Your favourite grocery stores came online !

Add grocery

Adds grocery to the system.

POST
/groceries

Parameters
access_token String A valid access token.
title String Title of grocery.
description String Brief description of grocery.
also_known_as String Alternate name of grocery.
cover file Image of grocery.
metric_units [String] Unit of grocery.
categories [String] Grocery categories.
Response
Status: 201

Search groceries

Search for groceries.

GET
/groceries

Parameters
access_token String A valid access token.
title String Title of the grocery.
categories String Catogory name to be searched.
Response
[
    {
        "_id": "afohre57njhsdgg6736123sd",
        "title": "Potato",
        "description": "Light brown color veg.",
        "also_known_as": "",
        "cover": "afohre57njhsdgg6736123sd-grocery-cover.jpg",
        "metric_units": [
            "kilogram",
            "gram"
        ],
        "categories": [
            "vegetables"
        ]
    }
]

Get grocery

Get the details of a grocery.

GET
groceries/:grocery_id/

Parameters
access_token String A valid access token.
Response
{
    "_id": "afohre57njhsdgg6736123sd",
    "title": "Potato",
    "description": "Light brown color veg.",
    "also_known_as": "",
    "cover": "afohre57njhsdgg6736123sd-grocery-cover.jpg",
    "metric_units": [
        "kilogram",
        "gram"
    ],
    "categories": [
        "vegetables"
    ]
}

Edit grocery

Update the grocery with new data.

PATCH
/groceries

Parameters
access_token String A valid access token.
title String Title of grocery.
description String Brief description of grocery.
also_known_as String Alternate name of grocery.
cover file Image of grocery.
metric_units [String] Unit of grocery.
categories [String] Grocery categories.
Response
Status: 201

Add grocery to shopping list

Brief Description

PUT
groceries/:grocery_id

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

Remove grocery from shopping list

Brief Description

DELETE
/groceries/:grocery_id/

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

Report grocery

Reports a grocery item.

PUT
/groceries/:grocery_id

Parameters
access_token String A valid access token.
reason_type String Type of the report reason.
reason_type String Body of the report reason.
Response
Status: 200

Remove grocery

Brief Description

DELETE
/groceries/:grocery_id/

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