Shoppinglists

A service which allows to manage user shoppinglists. All Shoppinglists endpoints have path prefix /shoppinglists-service.

Get shoppinglist

Get user shoppinglist list.

GET /shoppinglists-service/user/shoppinglist

After first request from user creates shoppinglist with required type.

Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
    "shoppinglists": {
        "required": [
            {
                "_id": "a51a9c37-0222-4e1d-904d-94ba6bbb3089",
                "_rev": "1-97d8bdb9ff63d96b029283e45c729116",
                "name": "This Week",
                "products": [],
                "is_required": true,
                "owner": {
                    "_id": "urn:authenticateit:user:email:a.lakiza.exceedteam@gmail.com",
                    "_rev": "4-c47c0c382157639e2ccbd69e085328cd",
                    "name": "First Name Last Name",
                    "image": "https://i.pinimg.com/564x/38/ec/64/38ec64ad67cdc3a885abdfa7349fc105.jpg"
                },
                "shared_with": [],
                "type": "shoppinglist",
                "created_at": "2020-08-03T09:41:27.522Z",
                "products_amount": 0
            }
        ],
        "custom": [
            {
                "_id": "f077908e-190a-4511-ac01-ebd0ecb6b174",
                "_rev": "1-92a2e7adf4f3898d888c53fb2f3e9dba",
                "name": "Test list №5",
                "products": [],
                "owner": {
                    "_id": "urn:authenticateit:user:email:a.lakiza.exceedteam@gmail.com",
                    "_rev": "4-c47c0c382157639e2ccbd69e085328cd",
                    "name": "First Name Last Name",
                    "image": "https://i.pinimg.com/564x/38/ec/64/38ec64ad67cdc3a885abdfa7349fc105.jpg"
                },
                "shared_with": [],
                "type": "shoppinglist",
                "created_at": "2020-08-03T11:11:46.143Z",
                "products_amount": 0
            },
            {
                "_id": "4264c477-fc3b-431a-a201-9f6d0495fd80",
                "_rev": "1-9c06d8b1f0cd84eb1431f5e64d592189",
                "name": "Test list №6",
                "products": [],
                "owner": {
                    "_id": "urn:authenticateit:user:email:a.lakiza.exceedteam@gmail.com",
                    "_rev": "4-c47c0c382157639e2ccbd69e085328cd",
                    "name": "First Name Last Name",
                    "image": "https://i.pinimg.com/564x/38/ec/64/38ec64ad67cdc3a885abdfa7349fc105.jpg"
                },
                "shared_with": [],
                "type": "shoppinglist",
                "created_at": "2020-08-03T11:11:53.683Z",
                "products_amount": 0
            }
        ],
        "shared": [
            {
                "_id": "8a674d4a-d1fc-4728-90de-f904eb96f6c7",
                "_rev": "5-1142480f1ea3dc506adfdf25459c77aa",
                "name": "This Week",
                "products": [
                    {
                        "addedBy": "urn:authenticateit:user:email:artem-lakiza@mail.ru",
                        "productId": "09780152021306"
                    }
                ],
                "is_required": true,
                "owner": {
                    "_id": "urn:authenticateit:user:email:artem-lakiza@mail.ru",
                    "_rev": "3-116bce74e725970d494de4b1d74a321e",
                    "name": "First Name Last Name",
                    "image": "https://memepedia.ru/wp-content/uploads/2018/09/orehus-stiker.png"
                },
                "shared_with": [
                    {
                        "_id": "urn:authenticateit:user:email:a.lakiza.exceedteam@gmail.com",
                        "_rev": "4-c47c0c382157639e2ccbd69e085328cd",
                        "name": "First Name Last Name",
                        "image": "https://i.pinimg.com/564x/38/ec/64/38ec64ad67cdc3a885abdfa7349fc105.jpg",
                        "role": "default"
                    }
                ],
                "type": "shoppinglist",
                "created_at": "2020-07-31T09:30:45.713Z",
                "products_amount": 1
            }
        ]
    }
}

Add new shoppinglist

Add new user shoppinglist.

POST /shoppinglists-service/user/shoppinglist
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
name string Required: shoppinglist name
Example body
{
    "name": "test name"
}
Example Response
{
    "id": "e2af5961-e74d-41ca-a998-a782a7a90807"
}

Delete shoppinglist

Delete user shoppinglist.

DELETE /shoppinglists-service/user/shoppinglist
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: user shoppinglist id (uuid)
Example body
{
    "id": "e2af5961-e74d-41ca-a998-a782a7a90807"
}
Example Response
{
    "result": "Shoppinglist with id dff5f8ce-d238-4b8b-97c0-fd5c9c9b6301 deleted."
}

Required shoppinglists can't be deleted. If shoppinglist with id in request body has field is_required it return error.

{
    "error": "Shoppinglist with id a51a9c37-0222-4e1d-904d-94ba6bbb3089 is required and can't be deleted",
    "error_data": null,
    "error_id": "receipts-del_receipt",
    "error_object": null
}

Copy shoppinglist

We can copy a shopping list to a new one (Custom lists), all products are copied, all permissions are copied

POST /shoppinglists-service/user/shoppinglist/copy
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: user shoppinglist id (uuid)
name string Optional: New shoppinglist name
Example body
{
    "id": "e2af5961-e74d-41ca-a998-a782a7a90807",
    "name": "New shoppinglist name"
}
Example Response
{
    "id": "dff5f8ce-d238-4b8b-97c0-fd5c9c9b6301"
}

Rename shoppinglist

Rename user shoppinglist.

Shoppinglists with required type can't be renamed.

PUT /shoppinglists-service/user/shoppinglist
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: user shoppinglist id (uuid)
name string Required: shoppinglist name
Example body
{
    "name": "test name",
    "id": "e2af5961-e74d-41ca-a998-a782a7a90807"
}
Example Response
{
    "result": "Shoppinglist with id dff5f8ce-d238-4b8b-97c0-fd5c9c9b6301 renamed."
}

Required shoppinglists can't be renamed. If shoppinglist with id in request body has field is_required it return error.

{
    "error": "Shoppinglist with id a51a9c37-0222-4e1d-904d-94ba6bbb3089 is required and can't be renamed",
    "error_data": null,
    "error_id": "shoppinglists-rename_shoppinglist",
    "error_object": null
}

Only owner or user with admin role can rename shoppinglist. If user has no permission to rename shoppinglist it returns error.

{
    "error": "You dont't have permission to rename this shoppinglist",
    "error_data": null,
    "error_id": "shoppinglists-rename_shoppinglist",
    "error_object": null
}

Share shoppinglist with buddy

Share user's shoppinglist with buddy.

POST /shoppinglists-service/user/shoppinglist/sharing
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
list_id string Required: user shoppinglist id (uuid)
buddy_id string Required: buddy id
Example body
{
    "buddy_id": "ikleeen@gmail.com",
    "list_id": "e2af5961-e74d-41ca-a998-a782a7a90807"
}
Example Response
{
    "result": "Shoppinglist with id 28e341a0-4d58-4b8c-8a4e-4dc716a12ddf shared."
}

If shoppinglist has been already shared to buddy it returns error.

{
    "error": "Shoppinglist with id 7041e11b-3de7-41e8-8377-cd62ad0cc300 has already been shared to this user.",
    "error_data": null,
    "error_id": "shoppinglists-shareShoppinglistWithBuddy",
    "error_object": null
}

Delete shoppinglist sharing with buddy

Delete buddy from list of users with whom shoppunglist is shared.

DELETE /shoppinglists-service/user/shoppinglist/sharing
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
list_id string Required: user shoppinglist id (uuid)
buddy_id string Required: buddy id
Example body
{
    "buddy_id": "ikleeen@gmail.com",
    "list_id": "e2af5961-e74d-41ca-a998-a782a7a90807"
}
Example Response
{
    "result": "Shoppinglist with id 7041e11b-3de7-41e8-8377-cd62ad0cc300 no more sharing to this user."
}

If shoppinglist has not been shared to buddy it returns error.

{
    "error": "Shoppinglist with id 7041e11b-3de7-41e8-8377-cd62ad0cc300 has not been shared to this user.",
    "error_data": null,
    "error_id": "shoppinglists-deleteSharing",
    "error_object": null
}

Create sharing url

Create sharing url for shoppinglist.

POST /shoppinglists-service/user/shoppinglist/sharing/link
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: user shoppinglist id (uuid)
{
    "id": "e2af5961-e74d-41ca-a998-a782a7a90807"
}
Example Response
{
    "url": "https://test-shping.app.link/7XUJjaLaV7"
}

Set user role for shoppinglist

Set user's role for shared shoppinglist.

PUT /shoppinglists-service/user/shoppinglist/role
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
list_id string Required: shoppinglist id (uuid)
user_id string Required: id of user to whom list is shared
role string Required: user's role (one of: guest, default, admin)
Example body
{
    "user_id": "ikleeen@gmail.com",
    "list_id": "e2af5961-e74d-41ca-a998-a782a7a90807",
    "role": "admin"
}
Example Response
{
    "result": "Role changed."
}

If shoppinglist has not been shared to user it returns error.

{
    "error": "Shoppinglist with id 7041e11b-3de7-41e8-8377-cd62ad0cc300 is not shared to this user.",
    "error_data": null,
    "error_id": "shoppinglists-changeRole",
    "error_object": null
}

Only owner of shoppinglist can manage user roles for it. If other user try to change role it returns error.

{
    "error": "You dont't have permission to manage this shoppinglist's roles",
    "error_data": null,
    "error_id": "shoppinglists-changeRole",
    "error_object": null
}

Add product

Add product to shoppinglist.

POST /shoppinglists-service/user/shoppinglist/product
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
list_id string Required: shoppinglist id (uuid)
product_id string Required: product id (uuid)
Example body
{
    "list_id": "8a674d4a-d1fc-4728-90de-f904eb96f6c7",
    "product_id": "00000772091930"
}
Example Response
{
    "result": [
        {
            "addedBy": "urn:authenticateit:user:email:artem-lakiza@mail.ru",
            "productId": "09780152021306"
        },
        {
            "addedBy": "urn:authenticateit:user:email:artem-lakiza@mail.ru",
            "productId": "00000772091931"
        }
    ]
}

Users with role "guest" can't add products to shoppinglist. If guest try to add product to shoppinglist it returns error.

{
    "error": "You dont't have permission to add products to this shoppinglist",
    "error_data": null,
    "error_id": "shoppinglists-addProducts",
    "error_object": null
}

Delete product

Delete product from shoppinglist.

DELETE /shoppinglists-service/user/shoppinglist/product
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
list_id string Required: shoppinglist id (uuid)
product_id string Required: product id (uuid)
Example body
{
    "list_id": "8a674d4a-d1fc-4728-90de-f904eb96f6c7",
    "product_id": "00000772091930"
}
Example Response
{
    "result": "Product deleted from shoppinglist"
}

Users with role "guest" can't delete products to shoppinglist. Users with role "defailt" can delete only products that were added by themselves. If user who has no rights try to delete product it returns error.

{
    "error": "You dont't have permission to delete this product from this shoppinglist",
    "error_data": null,
    "error_id": "shoppinglists-delProducts",
    "error_object": null
}

If there are no product_id in shoppinglist with list_id it returns error.

{
    "error": "There are no this product in this shoppinglist",
    "error_data": null,
    "error_id": "shoppinglists-delProducts",
    "error_object": null
}

Search products in entire database.

POST /shoppinglists-service/user/shoppinglist/search
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
search_string string Required: string for matching product names
Example body
{
    "search_string": "bloom"
}
Example Response
{
    "time": 1039,
    "highlited_products": [
        {
            "product_id": "00718813204514",
            "product_name": "American Crafts Bloom Phrases Print Multicoloured 12 x 12 in",
            "prices": [
                {
                    "currency": "AUD",
                    "currency_label": "$",
                    "value": 1,
                    "retailer": {
                        "id": "urn:authenticateit:participant:111111111111122",
                        "name": "Import participant Spotlight",
                        "logo": ""
                    },
                    "image": [
                        {
                            "url": "https://dev-cdn.shping.com/2019/6/23/64e56978-1807-4d67-b2f9-659acd7376bc"
                        }
                    ],
                    "type": "price"
                }
            ]
        },
        {
            "product_id": "00854196804283",
            "product_name": "American Crafts Crate Paper Maggie Holmes Bloom Paper Pad 36 Sheets Multicoloured 6 in",
            "prices": [
                {
                    "currency": "AUD",
                    "currency_label": "$",
                    "value": 14,
                    "retailer": {
                        "id": "urn:authenticateit:participant:111111111111122",
                        "name": "Import participant Spotlight",
                        "logo": ""
                    },
                    "image": [
                        {
                            "url": "https://dev-cdn.shping.com/2019/6/23/ea8b7d42-6f5a-4727-9074-b37d6a61cf44"
                        },
                        {
                            "url": "https://dev-cdn.shping.com/2019/6/23/b9391f70-2997-4810-abe2-02bb9dd6326a"
                        }
                    ],
                    "type": "price"
                }
            ]
        },
        {
            "product_id": "00854196804290",
            "product_name": "American Crafts Crate Paper Maggie Holmes Bloom Paper Pad 48 Sheets Multicoloured 12 in",
            "prices": [
                {
                    "currency": "AUD",
                    "currency_label": "$",
                    "value": 27,
                    "retailer": {
                        "id": "urn:authenticateit:participant:111111111111122",
                        "name": "Import participant Spotlight",
                        "logo": ""
                    },
                    "image": [
                        {
                            "url": "https://dev-cdn.shping.com/2019/6/23/c16f2e37-d006-4b4a-b37a-0941c391a7b5"
                        }
                    ],
                    "type": "price"
                }
            ]
        }
    ],
    "products": [
        {
            "product_id": "00854196804306",
            "product_name": "American Crafts Crate Paper Maggie Holmes Bloom Thickers Stickers Multicoloured",
            "prices": [
                {
                    "currency": "AUD",
                    "currency_label": "$",
                    "value": 9.5,
                    "retailer": {
                        "id": "urn:authenticateit:participant:111111111111122",
                        "name": "Import participant Spotlight",
                        "logo": ""
                    },
                    "image": [
                        {
                            "url": "https://dev-cdn.shping.com/2019/6/23/091c0748-b3cb-401e-ac44-d5d045f6bf0a"
                        }
                    ],
                    "type": "price"
                }
            ]
        },
        {
            "product_id": "00085715410689",
            "product_name": "Banana Republic Wildbloom Eau De Parfum Spray 100ml/3.4oz",
            "prices": [
                {
                    "currency": "AUD",
                    "currency_label": "$",
                    "value": 64.05,
                    "retailer": {
                        "id": "urn:authenticateit:participant:111111111111124",
                        "name": "Import participant Kogan",
                        "logo": ""
                    },
                    "image": [
                        {
                            "url": "https://dev-cdn.shping.com/2019/6/24/3c0e6867-43be-4ca3-8d2b-9b5b4b5f469c"
                        }
                    ],
                    "type": "price"
                }
            ]
        },
        {
            "product_id": "00767644775250",
            "product_name": "Blooms Vitamin D3 1000 IU 60c",
            "prices": [
                {
                    "currency": "AUD",
                    "currency_label": "$",
                    "value": 17.05,
                    "retailer": {
                        "id": "urn:authenticateit:participant:111111111111124",
                        "name": "Import participant Kogan",
                        "logo": ""
                    },
                    "image": [
                        {
                            "url": "https://dev-cdn.shping.com/2019/6/24/e9c6d786-814c-4f52-8fc4-942c1ee0390b"
                        }
                    ],
                    "type": "price"
                }
            ]
        },
        {
            "product_id": "00817579012811",
            "product_name": "Boba Serenity Baby Wrap Bloom",
            "prices": [
                {
                    "currency": "AUD",
                    "currency_label": "$",
                    "value": 79.9,
                    "retailer": {
                        "id": "urn:authenticateit:participant:111111111111130",
                        "name": "Import participant EAMART",
                        "logo": ""
                    },
                    "image": [
                        {
                            "url": "https://dev-cdn.shping.com/2019/6/27/114fd84a-3945-4dca-8e03-4e1fb8af775c"
                        }
                    ],
                    "type": "price"
                }
            ]
        },
    ]
}

results matching ""

    No results matching ""