2025-04-24 update(refactor) the code to accomodate version 2 of SHOPEE open API, and document the code better.
- getauthUrl_example.php added example how to use the shopee shop API.
- getshop_example.php added example how to use the shopee get shop API to return your shop information.
p/s: you may contact me if you need me to troubleshoot the code jeep1188@gmail.com / whatsapp me
2024-08-24 update the code to accomodate version 2 of SHOPEE open API.
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.