Get Product
This method will retrieve single product information either by product id as parameter (choose one of those two parameters to use) from related fs_id
.
Path
get
/inventory/v1/fs/:fs_id/product/info?product={{product_id}}
Request Parameters
Parameter | Type | Required | Location | Description |
---|---|---|---|---|
fs_id | Integer | Required | path | Fulfillment service unique identifier |
product_id | Integer | Required | query | Can input more than one product_id |
Example Request
- Curl
- Go
- Java
- Node.js
curl -X GET \
'https://fs.tokopedia.net/inventory/v1/fs/13004/product/info?product_id=15341594' \
-H 'Authorization: Bearer HB8GNgfdRXS9c_sksTdTBw'
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://fs.tokopedia.net/inventory/v1/fs/13004/product/info?product_id=15341594"
client := &http.Client {}
req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
// handle err
}
req.Header.Add("Authorization", "Bearer HB8GNgfdRXS9c_sksTdTBw")
res, err := client.Do(req)
if err != nil {
// handle err
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
// handle err
}
fmt.Println(string(body))
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://fs.tokopedia.net/inventory/v1/fs/13004/product/info?product_id=15341594")
.method("GET", null)
.addHeader("Authorization", "Bearer HB8GNgfdRXS9c_sksTdTBw")
.build();
Response response = client.newCall(request).execute();
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'https://fs.tokopedia.net',
'path': '/inventory/v1/fs/13004/product/info?product_id=15341594',
'headers': {
'Authorization': 'Bearer HB8GNgfdRXS9c_sksTdTBw'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
Response Parameters
Name | Type | Demo Value | Description |
---|---|---|---|
basic | Object | ||
price | Object | ||
weight | Object | ||
stock | Object | ||
Integer | 7 | Product Stock (Not Reserved) | |
Integer | 3 | Product Stock that Reserved (ex: FlashSale) | |
variant | Object | ||
menu | Object | ||
preorder | Object | ||
extraAttribute | Object | ||
wholesale | Object Array | ||
categoryTree | Object Array | ||
pictures | Object Array | ||
GMStats | Object | ||
stats | Object | ||
other | Object | ||
campaign | Object | ||
volume | Object | ||
warehouses | Object Array |
Success Response Examples
{
"header": {
"process_time": 5.871520385,
"messages": "Your request has been processed successfully"
},
"data": [
{
"basic": {
"productID": 15245228,
"shopID": 480829,
"status": 1,
"Name": "hxh wallpaper best la zzzz",
"condition": 1,
"childCategoryID": 1828,
"shortDesc": "Best wallpaper for hxh"
},
"price": {
"value": 3000,
"currency": 1,
"LastUpdateUnix": 1557981264,
"idr": 3000
},
"weight": {
"value": 5,
"unit": 1
},
"stock": {
"value": 10,
"stockWording": "<b>Stok hampir habis!</b> Tersisa <20"
},
"main_stock": 7,
"reserve_stock": 3,
"variant": {
"isParent": true,
"isVariant": true,
"childrenID": [
15245978,
15245979
]
},
"menu": {
"id": 1405065,
"Name": "Wallpapers"
},
"preorder": {},
"extraAttribute": {
"minOrder": 1,
"lastUpdateCategory": 1554708202,
"isEligibleCOD": true
},
"categoryTree": [
{
"id": 1759,
"Name": "Fashion Pria",
"title": "Fashion Pria",
"breadcrumbURL": "https://staging.tokopedia.com/p/fashion-pria"
},
{
"id": 1787,
"Name": "Celana",
"title": "Celana",
"breadcrumbURL": "https://staging.tokopedia.com/p/fashion-pria/celana"
},
{
"id": 1828,
"Name": "Celana Jeans",
"title": "Celana Jeans",
"breadcrumbURL": "https://staging.tokopedia.com/p/fashion-pria/celana/celana-jeans"
}
],
"pictures": [
{
"picID": 21189631,
"fileName": "5510908_a4b5f7a2-2451-45f2-8a83-979808fe28d3_1920_1080.jpg",
"filePath": "product-1/2019/3/12/5510908",
"status": 2,
"OriginalURL": "https://ecs7.tokopedia.net/img/cache/700/product-1/2019/3/12/5510908/5510908_a4b5f7a2-2451-45f2-8a83-979808fe28d3_1920_1080.jpg",
"ThumbnailURL": "https://ecs7.tokopedia.net/img/cache/200-square/product-1/2019/3/12/5510908/5510908_a4b5f7a2-2451-45f2-8a83-979808fe28d3_1920_1080.jpg",
"width": 1920,
"height": 1080,
"URL300": "https://ecs7.tokopedia.net/img/cache/300/product-1/2019/3/12/5510908/5510908_a4b5f7a2-2451-45f2-8a83-979808fe28d3_1920_1080.jpg"
},
{
"picID": 21191044,
"fileName": "5510908_a99b769d-5e7a-44da-9a04-2ed1cc6efa32_441_441",
"filePath": "product-1/2019/4/8/5510908",
"status": 1,
"OriginalURL": "https://ecs7.tokopedia.net/img/cache/700/product-1/2019/4/8/5510908/5510908_a99b769d-5e7a-44da-9a04-2ed1cc6efa32_441_441",
"ThumbnailURL": "https://ecs7.tokopedia.net/img/cache/200-square/product-1/2019/4/8/5510908/5510908_a99b769d-5e7a-44da-9a04-2ed1cc6efa32_441_441",
"width": 441,
"height": 441,
"URL300": "https://ecs7.tokopedia.net/img/cache/300/product-1/2019/4/8/5510908/5510908_a99b769d-5e7a-44da-9a04-2ed1cc6efa32_441_441"
}
],
"GMStats": {
"transactionSuccess": 3,
"transactionReject": 69,
"countSold": 3
},
"stats": {
"countView": 163
},
"other": {
"sku": "12345",
"url": "https://staging.tokopedia.com/mattleeshoppe/hxh-wallpaper-best-la-zzzz",
"mobileURL": "https://m-staging.tokopedia.com/mattleeshoppe/hxh-wallpaper-best-la-zzzz"
},
"campaign": {
"StartDate": "0001-01-01T00:00:00Z",
"EndDate": "0001-01-01T00:00:00Z"
},
"warehouses": [
{
"productID": 15245228,
"warehouseID": 5,
"price": {
"value": 3000,
"currency": 1,
"LastUpdateUnix": 1558006464,
"idr": 3000
},
"stock": {
"useStock": true,
"value": 10
}
},
{
"productID": 15245228,
"warehouseID": 84,
"price": {
"value": 3000,
"currency": 1,
"LastUpdateUnix": 1558006464,
"idr": 3000
},
"stock": {
"useStock": true,
"value": 1
}
},
{
"productID": 15245228,
"warehouseID": 96,
"price": {
"value": 3000,
"currency": 1,
"LastUpdateUnix": 1558006464,
"idr": 3000
},
"stock": {
"useStock": true,
"value": 1000
}
}
]
}
]
}
Error Response Examples
{
"header": {
"process_time": 0.000166507,
"messages": "Our server encounters an error, please try again later",
"reason": "Error Convert number format into string",
"error_code": "PRD_USC_024"
},
"data": null
}
Error Codes
Error Code | Error Message | Description |
---|---|---|
PRD_GRPC_001 | Failed Send GRPC Request | Failed sending request to upstream |
PRD_GRPC_002 | There Are Error From Ext Service | Failed getting response from upstream |
PRD_USC_024 | Error Convert number format into string | Failed getting response from upstream |
Notes
Product Status
Value | Description |
---|---|
-2 | Banned |
-1 | Pending |
0 | Deleted |
1 | Active |
3 | Inactive (Warehouse) |