Skip to content

Instantly share code, notes, and snippets.

@memphys
Created November 28, 2013 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save memphys/7688607 to your computer and use it in GitHub Desktop.
Save memphys/7688607 to your computer and use it in GitHub Desktop.

Добавление эталона товара в вишлист

Запрос:

    {
        "jsonrpc": "2.0",
        "method": "wishlist.add",
        "params": {
            "product_id": 1
        },
        "id":1
    }

Ответ:

    {
        "jsonrpc": "2.0",
        "result": {
            "wish_id": 1
        },
        "id": 1
    }

Добавление товаров из магазина в вишлист

Запрос:

    {
        "jsonrpc": "2.0",
        "method": "wishlist.add",
        "params": {
            "shop_product_id": 1
        },
        "id":1
    }

Ответ:

    {
        "jsonrpc": "2.0",
        "result": {
            "wish_id": 1
        },
        "id": 1
    }

Удаление товара из вишлиста

Запрос:

    {
        "jsonrpc": "2.0",
        "method": "wishlist.delete",
        "params": {
            "product_id": 1
        },
        "id":1
    }

Ответ:

    {
        "jsonrpc": "2.0",
        "result": {
            "product_id": 1
        },
        "id": 1
    }

Получение вишлиста пользователя

Запрос:

    {
        "jsonrpc": "2.0",
        "method": "wishlist.get",
        "params": {
            "user_id": 1,
            "order": "price",
            "order_direction": "asc",
            "offset": 0,
            "count": 10
        },
        "id":1
    }

Ответ:

    {
        "jsonrpc": "2.0",
        "result": {
            "user_id": 1,
            "total_count": 1,
            "order": "price",
            "order_direction": "asc",
            "wishes": [
                {
                    "id": 1,
                    "created_at": 1373614078,
                    "bought": false,
                    "marked_to_gift": false,
                    "product": {
                        "created_at": 1374757450,
                        "is_deleted": false,
                        "product_id": 1,
                        "name": "shop-shoes",
                        "brand": "shoes",
                        "photo_url": null,
                        "price": null,
                        "description": null,
                        "shop_id": null,
                        "shop_photos": null,
                        "shops": [
                            {
                                "user_id": null,
                                "rating": 0,
                                "shop_id": 1,
                                "name": "shop",
                                "price": 9.99,
                                "count": 1
                            }
                        ],
                        "sale": null,
                        "category": {
                            "type": "top",
                            "category_id": 1,
                            "name": "shoes",
                            "description": "bla bla",
                            "thumbnail_web": null,
                            "thumbnail_mobile": null,
                            "parent": null,
                            "subcategories_count": 0,
                            "products_count": 1,
                            "yandex_id": null,
                            "mailru_id": null
                        },
                        "properties": null,
                        "min_price": 9.99,
                        "max_price": 9.99,
                        "photos": [],
                        "count": null,
                        "yandex_id": null,
                        "mailru_id": null
                    }
                }
            ]
        },
        "id": 1
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment