Create Products
Endpoint used for creating new products.
Path
post
/v3/products/fs/:fs_id/create
Request Parameters
Parameter | Type | Required | Location | Description |
---|---|---|---|---|
fs_id | Integer | Required | path | Fulfillment service unique identifier |
shop_id | Integer | Required | path | Shop unique identifier |
products | Object Array | Required | body | Product object array |
Where products
object contain
Parameter | Type | Required | Location | Description |
---|---|---|---|---|
name | String | Required | body | Name of the product with length less than or equals 70 characters |
category_id | Integer | Required | body | Unique identifier for the product’s category. To get available categories, please check Get All Categories Please input the deepest category child ID |
price_currency | String | Required | body | Currency code for stated price ( IDR or USD ) |
price | Integer | Required | body | The possible value between 100 to 100.000.000. If the product variant is added, the price parameter is automatically set to the lowest price among the variant products |
status | String | Required | body | Status for the product with LIMITED value |
min_order | Integer | Required | body | Minimum order required to purchase the product. Can only be a positive integ |
weight | Float | Required | body | Weight of the product |
weight_unit | String | Required | body | The unit of the weight with the following available value GR (gram) |
condition | String | Required | body | The condition of the product with the following available values NEW and USED |
dimension | Object | Optional | body | Dimension of the product. The object contains height , width , and length . If want to use dimensions then three of this object must be filled |
custom_product_logistics | Integer Array | Optional | body | Custom product logistics of the product. To get the id, please check Get Active Courier. Required field to input just ShippingProductID value responses from Get Active Courier |
annotations | String Array | Optional | body | Product Specification (anotations) By Category ID. The value is array of annotations id that can be retrieve by hit endpoint Get Product Annotation by Category ID. The location of id is at values.id |
etalase | Object | Optional | body | Etalase or Showcase of the product. The object contains id and name . To get available Showcase, please check Get Showcase. Required field to input just id with etalase_id responses from Get Showcase |
description | String | Optional | body | Description of the product. Maximum characters allowed is 2000 |
is_must_insurance | Boolean | Required | body | Determine if the product must be insured ( true ) or not (false ) |
sku | String | Optional | body | The stock keeping unit for the product. Maximum characters allowed is 50 |
stock | Integer | Required | body | The stock of the product. 0 indicates always available. Other than that, the possible values are from 1 to 1000 . Stock should be 1 if want to add variant product. |
wholesale | Object Array | Optional | body | Wholesale price and quantity of the product. The object keys includes: min_qty and price |
preorder | Object | Optional | body | Preorder information. The object keys includes: is_active , duration , and time_unit |
pictures | Object Array | Required | body | Images information of the product. The object keys includes: Image URL |
videos | Object Array | Optional | body | Video link of the product. The object keys includes: url and source . url should only contain the YouTube video id e.g. dQw4w9WgXcQ. Where the type type should be youtube |
variant | Object | Optional | body | Variant of the product. The object keys includes: variant and product_variant |
Example Request
- Curl
curl -X POST \
'https://fs.tokopedia.net/v3/products/fs/13004/create?shop_id=479573' \
-H 'Authorization: Bearer C-UMqWWXRqaJugr7w5U0zQ' \
-H 'Content-Type: application/json' \
-d '{
"products":[
{
"Name":"Product Testing V3 1.36",
"condition":"NEW",
"Description":"Product Testing Descr V2",
"sku":"TST21",
"price":10000,
"status":"LIMITED",
"stock":900,
"min_order":1,
"category_id":562,
"dimension":{
"height":2,
"width":3,
"length":4
},
"custom_product_logistics":[24,4,64],
"annotations":["1"],
"price_currency":"IDR",
"weight":200,
"weight_unit":"GR",
"is_must_insurance":false,
"etalase":{
"id":1402922
},
"pictures":[
{
"file_path":"https://ecs7.tokopedia.net/img/cache/700/product-1/2017/9/27/5510391/5510391_9968635e-a6f4-446a-84d0-ff3a98a5d4a2.jpg"
}
],
"wholesale":[
{
"min_qty":2,
"price":9500
},
{
"min_qty":3,
"price":9000
}
]
}
]
}'
Response Parameters
Name | Type | Demo Value | Description |
---|---|---|---|
Integer | 1 | Total Data Count | |
Integer | 1 | Success Data Count | |
Integer | 0 | Fail Data Count | |
success_rows_data | Object Array | ||
failed_rows_data | Object Array |
Success Response Examples
{
"header": {
"process_time": 1.054341405,
"messages": "Your request has been processed successfully"
},
"data": {
"total_data": 1,
"success_data": 1,
"fail_data": 0,
"success_rows_data": [
{
"product_id": 2147732129
}
]
}
}
Error Response Examples
{
"header": {
"process_time": 0.702986751,
"messages": "Your request has been processed successfully"
},
"data": {
"total_data": 1,
"success_data": 0,
"fail_data": 1,
"failed_rows_data": [
{
"product_name": "Product Testing V3 1.39",
"product_price": 10000,
"sku": "TST21",
"error": [
"Value [Product Testing V3 1.39] of field [name] is already used, please use different value"
]
}
]
}
}
Error Codes
Error Code | Error Message | Description |
---|---|---|
PRD_API_003 | Failed To Fetching Request | Failed fetching request from upstream |
PRD_API_006 | There Are Error From Ext Service | There is error from external service |
PRD_USC_001 | fs_id Is Not Associated With Shop ID or Warehouse ID | fs_id not assosiated please check again |
PRD_DLV_038 | Value %s of field %s is not allowed, the allowed fields are %s | There is something wrong with the request body |
PRD_DLV_042 | Invalid field %s format, value %v should be %s | There is something wrong with the request body |
PRD_DLV_043 | Invalid request body, please check again | There is something wrong with the request body |
SHP_GRPC_001 | Failed Send GRPC Request | Failed sending request to upstream |
SHP_GRPC_003 | Data Not Found | Failed finding data from upstream |
Notes
Create Products V2 and V3 Comparison
Description | V2 | V3 |
---|---|---|
Execution Flow | Asynchronous. Need to hit endpoint Check Upload Status to get result | Synchronous. Create product result will show at this endpoint, no need to hit additional endpoint Check Upload Status |
Payload Request | Same as V2 but user can create product with additional information for product dimension, specification (annotations), and custom product logistics | |
Maximun Bulk Payload | 25 | 1 |
JSON Response | Provide upload_id information. | Provide information total data, total success, and total fail. It also provide detail information of success data if succeeded or fail data if failed |
Product Variant Request Explanaiton
Explanation :
products
field below contains the information such as stock and price of each variant:is_primary
field selects a product and marks it as the primary product.price
field, stock, and sku defines each product’s attribute.combination
field selects the index of field options in selection object.- Field
pictures
is for product variant image with maximum number of image is 5 (7 for Official Store shops).
- selection fielddefines variant selection.
id
field isvariant_id
which is retrieved from Get Variant By Category endpoint.unit_id
field is retrieved from Get Variant By Category endpoint.hex_code
field andunit_value_id
is also retrieved from Get Variant By Category endpoint.unit_value_id
fill withvalue_id
's response from get variant by category- Create a custom variant simply by fill
value
field with desired value
sizecharts
field contains singlefile_path
field which contains image url to be uploaded.