/shopeeAPI

wrote the code for shopeeAPI using PHP and hope somebody might find it useful.

Primary LanguagePHP

shopeeAPI

wrote the code for shopeeAPI using PHP and hope somebody might find it useful.

//1. example of getting items Detail
$item_id = 123; #{some id of the shopee porudcts}
$shopee = new shopeeAPI($shopeeShopId, $shopeePartnerId, $shopeeSecretKey, $shopeeUrl);
$product = $shopee->retrieveItemDetail($item_id);
var_dump($product); #output the product in JSON format

//2. example of update product quantity
$item_id = 123; #{some id of the shopee porudcts}
$qty = 100; #{quantity of the shopee porudcts}
$shopee = new shopeeAPI($shopeeShopId, $shopeePartnerId, $shopeeSecretKey, $shopeeUrl);
$shopee->updateItemStock($item_id, $qty);
//when successfully updated it will show u modified time and item_id in JSON format

//3. retrieve order list
$shopee = new shopeeAPIOrder($shopeeShopId, $shopeePartnerId, $shopeeSecretKey, $shopeeUrl);
$ordersList = $shopee->getOrderList(null);
$ordersListJSON = json_decode($ordersList, true);
//returns orderList in JSON with attributes "ordersn", "order_status", "order_datetime"

//4. retrieve order Details
$shopee = new shopeeAPIOrder($shopeeShopId, $shopeePartnerId, $shopeeSecretKey, $shopeeUrl);
$ordersn[] = array(123, 456, 789);
$ordersList = $shopee->getOrderDetail($ordersn);
$ordersListJON = json_decode($ordersList, true);
//returns to you order Detail like recipient info., items ordered, status of order, etc.