Skip to content

Instantly share code, notes, and snippets.

@absyah
Created August 30, 2017 09:22
Show Gist options
  • Save absyah/75d589d1f6dfbe281a1b475e733cb1f4 to your computer and use it in GitHub Desktop.
Save absyah/75d589d1f6dfbe281a1b475e733cb1f4 to your computer and use it in GitHub Desktop.
Shopee Export
# url https://partner.staging.shopeemobile.com/api/v1/item/add
# headers
# {
# :"Content-type"=>"application/json",
# :Authorization=>"27b2a692fbcd1b4b97824479389b900680b5abb18c5b8a0e20004a6c1158eb99",
# :"cache-control"=>"no-cache"
# }
#
#
# response
# {"item_id"=>1495890, "msg"=>"Add item success"}
#
#
# parameters:
{
category_id: 7063,
name: 'Test create',
description: 'Test create description',
price: 100000.00,
stock: 99,
item_sku: 'SKU01',
variations: [
{
name: 'Test create variant 1',
stock: 30,
price: 100000.00,
variation_sku: 'SKU01-V1',
},
{
name: 'Test create variant 2',
stock: 40,
price: 100000.00,
variation_sku: 'SKU01-V2',
}
],
images: [
{url: 'https://www.flooringvillage.co.uk/ekmps/shops/flooringvillage/images/request-a-sample--547-p.jpg'},
{url: 'https://www.flooringvillage.co.uk/ekmps/shops/flooringvillage/images/request-a-sample--547-p.jpg'}
],
attributes: [ # all mandatory should be filled
{attributes_id: 4381, value: 'Biru'},
{attributes_id: 4382, value: 'Kecil'},
{attributes_id: 4383, value: 'Apple'},
{attributes_id: 4384, value: 'X'},
{attributes_id: 4385, value: 'KG'},
],
logistics: [
{
logistic_id: 80003,
enabled: true,
# shipping_fee: nil, # Only needed when logistics fee_type = CUSTOM_PRICE
# size_id: nil, # If specify logistic fee_type is SIZE_SELECTION size_id is required
is_free: false
}
],
weight: 1.2, # the net weight of this item, the unit is KG, If contains logistic fee_type = SIZE_INPUT weight is required
package_length: 10.0, # cm
package_width: 10.0, # cm
package_height: 10.0, # cm
# days_to_ship: nil, # The days to ship. Only work for pre-order, it means this value should be bigger than 7
timestamp: 1504084092,
partner_id: 10002,
shopid: 204240
}
# url https://partner.staging.shopeemobile.com/api/v1/item/update
# headers
# {
# :"Content-type"=>"application/json",
# :Authorization=>"27b2a692fbcd1b4b97824479389b900680b5abb18c5b8a0e20004a6c1158eb99",
# :"cache-control"=>"no-cache"
# }
#
#
# response
# {"item_id"=>1495890, "msg"=>"Update item success"}
#
#
# parameters:
{
item_id: 1495890, # required
category_id: 7063,
name: 'Test create',
description: 'Test create description',
price: 100000.00,
stock: 99,
item_sku: 'SKU01',
variations: [
{
variation_id: 1329190, # required
name: 'Test create variant 1',
stock: 30,
price: 100000.00,
variation_sku: 'SKU01-V1',
},
{
variation_id: 1329191,
name: 'Test create variant 2',
stock: 40,
price: 100000.00,
variation_sku: 'SKU01-V2',
}
],
# does not work in update `type of images is invalid, should be string`
# images: [
# {url: 'https://www.flooringvillage.co.uk/ekmps/shops/flooringvillage/images/request-a-sample--547-p.jpg'},
# {url: 'https://www.flooringvillage.co.uk/ekmps/shops/flooringvillage/images/request-a-sample--547-p.jpg'}
# ],
attributes: [ # all mandatory should be filled
{attributes_id: 4381, value: 'Biru'},
{attributes_id: 4382, value: 'Kecil'},
{attributes_id: 4383, value: 'Apple'},
{attributes_id: 4384, value: 'X'},
{attributes_id: 4385, value: 'KG'},
],
logistics: [
{
logistic_id: 80003,
enabled: true,
# shipping_fee: nil, # Only needed when logistics fee_type = CUSTOM_PRICE
# size_id: nil, # If specify logistic fee_type is SIZE_SELECTION size_id is required
is_free: false
}
],
weight: 1.2, # the net weight of this item, the unit is KG, If contains logistic fee_type = SIZE_INPUT weight is required
package_length: 10.0, # cm
package_width: 10.0, # cm
package_height: 10.0, # cm
# days_to_ship: snil, # The days to ship. Only work for pre-order, it means this value should be bigger than 7
timestamp: 1504084092,
partner_id: 10002,
shopid: 204240
}
@namye007
Copy link

Please fix this error: "SIZE_SELECTION require size_id||error_param". There is no option for size ID.

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