Skip to content

Latest commit

 

History

History
446 lines (413 loc) · 13.7 KB

File metadata and controls

446 lines (413 loc) · 13.7 KB

Product API Documentation

🔒 GET Get Product Detail

Get detail product

Resource URL

/api/v2/product/get_product_detail

Parameters
  • id_product required ID of product.
Sample Request
curl -H "X-API-KEY: 4974328ce522a3eb86ecf73a193490314cf98c74" http://shoop.dev/api/v2/product/get_product_detail?id_product=1932
Sample Response
{
    "status": 1,
    "product": {
        "id_product": "1929",
        "prod_title": "tes",
        "prod_desc": "Tes",
        "prod_price": "123",
        "prod_curr": "IDR",
        "prod_order": "",
        "prod_status": "0",
        "prod_share": null,
        "prod_image": "1929.jpg",
        "prod_tag": "tes, tesx",
        "prod_stock": "1",
        "langitude": null,
        "longitude": null,
        "id_user": "667",
        "prod_time": "2014-01-13 16:12:11",
        "fb_post": null,
        "hubmeup_link": "http://www.hubmeup.com/tes-102/",
        "from_app": null,
        "id_supercat": "1",
        "id_buyercat": "1",
        "id_superloc": "11",
        "discount": "0",
        "view_count": "0",
        "is_nego": "0",
        "image_migrate": "0",
        "condition": "new",
        "shoop_count": "0",
        "comment_count": "0",
        "supercat": {
            "idsc": "1",
            "name": "Perlengkapan Olahraga"
        },
        "buyercat": {
            "idbc": "15",
            "name": "Alat & Perlengkapan Olahraga"
        },
        "superloc": {
            "idsl": "11",
            "name": "Jawa Tengah"
        },
        "comment_status": 0,
        "shoop_status": 0,
        "tag": [
            {
                "id_tag": "143",
                "tag": "tes"
            },
            {
                "id_tag": "178",
                "tag": "tesx"
            }
        ],
        "image": [
            {
                "id_image": "88",
                "product_image": "1929_1389604315.jpg"
            }
        ],
        "user": {
            "id_user": "667",
            "name": "afiev",
            "address": "yoyoyoyo",
            "email": "afiev@firzil.co.id",
            "phone": "1233232323",
            "city": null,
            "country": "heheheh",
            "avatar": "2014-01-1390193388912.jpg",
            "buyer_poin": "0",
            "seller_poin": "0",
            "id_location": "12",
            "follow": {
                "following": 15,
                "follower": 19
            },
            "product_count": {
                "all": 171,
                "active": 0
            }
        },
        "link": [
            {
                "store_name": "Blogger fir",
                "id_platform": "13",
                "platform_name": "Blogger",
                "status": "2",
                "link": null
            },
            {
                "store_name": "Facebook",
                "id_platform": "10",
                "platform_name": "Facebook",
                "status": "1",
                "link": "http://www.facebook.com/10201354019279997#,#http://www.facebook.com/10201354019640006"
            }
        ]
    }
}

🔒 GET Get Product User

Get product by user

Resource URL

/api/v2/product/get_product_user

Parameters
  • id_user required ID of user. If empty, will use default: active user
  • limit optional Limit for browse. Default 6
  • offset optional Limit for browse. Default 1
  • keyword optional Search key
  • id_supercat optional Category ID
  • id_buyercat optional Buyer Category ID
  • id_superloc optional Location ID
  • tag optional Tag filter
  • filter optional filter for browse, enum all or own. Default all
  • since_time optional Browse product from since_time
  • until_time optional Browse product up to until_time. ignored if since_time is not empty
  • sort optional Sort product, enum time popular comment price stock. Default time
  • direction optional Direction of sort. enum desc or asc. Default desc
Sample Request
curl -H "X-API-KEY: 4974328ce522a3eb86ecf73a193490314cf98c74" http://shoop.dev/api/v2/product/get_product_user?limit=2
Sample Response
{
    "status": 1,
    "limit": "2",
    "offset": 1,
    "count": 1191,
    "product": [
        {
            "id_product": "1931",
            "prod_title": "laptop compaq",
            "prod_price": "2500000",
            "prod_curr": "IDR",
            "discount": null,
            "view_count": null,
            "prod_stock": "1",
            "id_user": "461",
            "shoop_count": "0",
            "comment_count": "0",
            "comment_status": 0,
            "shoop_status": 0,
            "user": {
                "id_user": "461",
                "name": "Akuikialieeeeee",
                "address": "Surabaya",
                "email": "ali@firzil.co.id",
                "phone": "+6285730432092",
                "city": null,
                "country": "83",
                "avatar": "461.jpg",
                "buyer_poin": "0",
                "seller_poin": "0",
                "id_location": null
            },
            "tag": [
                {
                    "id_tag": "180",
                    "tag": "shoop"
                }
            ],
            "image": []
        },
        {
            "id_product": "1929",
            "prod_title": "tes",
            "prod_price": "123",
            "prod_curr": "IDR",
            "discount": null,
            "view_count": null,
            "prod_stock": "1",
            "id_user": "667",
            "shoop_count": "0",
            "comment_count": "0",
            "comment_status": 0,
            "shoop_status": 0,
            "user": {
                "id_user": "667",
                "name": "afiev",
                "address": "yoyoyoyo",
                "email": "afiev@firzil.co.id",
                "phone": "1233232323",
                "city": null,
                "country": "heheheh",
                "avatar": "2014-01-1390193388912.jpg",
                "buyer_poin": "0",
                "seller_poin": "0",
                "id_location": "12"
            },
            "tag": [
                {
                    "id_tag": "143",
                    "tag": "tes"
                },
                {
                    "id_tag": "178",
                    "tag": "tesx"
                }
            ],
            "image": [
                {
                    "id_image": "88",
                    "product_image": "1929_1389604315.jpg"
                }
            ]
        }
    ]
}

🔒 GET Get Product User

Get product by category

Resource URL

/api/v2/product/get_product_user

Parameters
  • id_supercat Category ID
  • id_buyercat Buyer Category ID (One of id_supercat & id_buyercat is required)
  • limit optional Limit for browse. Default 6
  • offset optional Limit for browse. Default 1
  • keyword optional Search key
  • id_superloc optional Location ID
  • tag optional Tag filter
  • filter optional filter for browse, enum all or own. Default all
  • since_time optional Browse product from since_time
  • until_time optional Browse product up to until_time. ignored if since_time is not empty
  • sort optional Sort product, enum time popular comment price stock. Default time
  • direction optional Direction of sort. enum desc or asc. Default desc
Sample Request
curl -H "X-API-KEY: 4974328ce522a3eb86ecf73a193490314cf98c74" http://shoop.dev/api/v2/product/get_product_category?id_supercat=2&limit=2
Sample Response
menyusul (jek pusing)

🔒 POST Add Product

Add Product

Resource URL

/api/v2/product/add_product

Parameters
  • id_user required ID User from user which request.
  • prod_name required
  • prod_price required
  • prod_curr required
  • prod_tag required pisah dengan ,
  • prod_desc required
  • id_supercat required
  • id_buyercat required
  • id_superloc required
  • condition optional
  • is_nego optional
  • discount optional
  • prod_image optional array Product Image.
  • from_app optional
Sample Request
curl -X POST --data "prod_title=Baju&prod_price=15000&prod_curr=IDR&prod_desc=just_test&id_supercat=1&id_superloc=1" -H "X-API-KEY: 4974328ce522a3eb86ecf73a193490314cf98c74" http://shoop.dev/api/v2/user/add_product
Sample Response
{
    "status": 1,
    "product": {
        "id_product": "1937",
        "prod_title": "Baju",
        "prod_desc": "just test",
        "prod_price": "150000",
        "prod_curr": "IDR",
        "prod_order": null,
        "prod_status": "0",
        "prod_share": null,
        "prod_image": null,
        "prod_tag": null,
        "prod_stock": "1",
        "langitude": null,
        "longitude": null,
        "id_user": "2",
        "prod_time": "2014-02-01 11:40:58",
        "fb_post": null,
        "hubmeup_link": null,
        "from_app": null,
        "id_supercat": "1",
        "id_superloc": "1",
        "discount": "0",
        "view_count": "0",
        "is_nego": "0",
        "image_migrate": "0",
        "condition": "new",
        "shoop_count": "0",
        "comment_count": "0",
        "supercat": {
            "idsc": "1",
            "name": "Perlengkapan Olahraga"
        },
        "buyercat": {
            "idsc": "15",
            "name": "Alat & Perlengkapan Olahraga"
        },
        "superloc": {
            "idsl": "1",
            "name": "Jawa Timur"
        }
    }
}

🔒 POST Edit User Not Finished Yet

Edit active user

Resource URL

/api/v2/user/edit_user

Parameters
  • name optional The name of the user.
  • gcm_id optional
  • address optional
  • id_location optional
  • phone optional
  • is_sundul optional
  • tw_token optional
  • tw_secret optional
  • avatar optional
  • fb_token optional
  • fb_uid optional
  • fb_token_expired optional
  • latitude optional
  • longitude optional
Sample Request
curl -X POST --data "name=hayashi" -H "X-API-KEY: 4974328ce522a3eb86ecf73a193490314cf98c74" http://shoop.dev/api/v2/user/edit_user
Sample Response
{
    "user": {
        "id_user": "2",
        "name": "hayashi",
        "email": "shcode@ymail.com",
        "phone": "+6283857723355",
        "birthdate": "1986-12-15",
        "username": "shcode",
        "address": "Jl. Merak No. 10 Surabaya",
        "city": "Surabaya",
        "country": "Indonesia",
        "bio": null,
        "avatar": "hohoho",
        "type": "2",
        "fb_token": "",
        "fb_token_expired": null,
        "tw_token": "218307206-cTmwJ7vAijoufjtbQzVvowImzP9jq2WUbADcFtnc",
        "tw_secret": "SHhfmg4jmiBEwO0EFBIMCaaI4V2hArJyI5vKnl4aq5Y",
        "album_id": "4222704171637",
        "show_phone": "1",
        "gcm_id": null,
        "updated": "1",
        "fb_uid": "null",
        "joined_date": "2013-04-01 11:00:00",
        "premium_end": "2013-10-15 00:47:55",
        "id_key": "2",
        "last_activity": null,
        "buyer_poin": "0",
        "seller_poin": "0",
        "is_trusted": "0",
        "is_premium": "1",
        "id_location": null
    },
    "product_count": {
        "all": 54,
        "active": 0
    },
    "follow": {
        "following": 0,
        "follower": 0
    },
    "status": 1
}