Skip to content

Commit

Permalink
Add more item functions
Browse files Browse the repository at this point in the history
  • Loading branch information
minchao committed Jan 22, 2020
1 parent a676a14 commit e79eded
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Latest Unstable Version](https://poser.pugx.org/minchao/shopee-php/v/unstable)](https://packagist.org/packages/minchao/shopee-php)
[![composer.lock](https://poser.pugx.org/minchao/shopee-php/composerlock)](https://packagist.org/packages/minchao/shopee-php)

This is a [Shopee Partner API](https://partner.shopeemobile.com/docs/) Client for PHP.
This is a [Shopee Partner API](https://open.shopee.com/documents) Client for PHP.

## Requirements

Expand Down Expand Up @@ -33,7 +33,7 @@ require_once __DIR__ . '/vendor/autoload.php';
$client = new \Shopee\Client([
'secret' => SHOPEE_SECRET,
'partner_id' => SHOPEE_PARTNER_ID,
'shopid' => SHOPEE_SHOP_ID,
'shopid' => SHOPEE_SHOP_ID,
]);
```

Expand Down
121 changes: 121 additions & 0 deletions src/Nodes/Item/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ public function addVariations($parameters = []): ResponseData
return $this->post('/api/v1/item/add_variations', $parameters);
}

/**
* Use this api to boost multiple items at once.
*
* @param array $parameters
* @return ResponseData
*/
public function boostItem($parameters = []): ResponseData
{
return $this->post('/api/v1/items/boost', $parameters);
}

/**
* Use this call to delete a product item.
*
Expand Down Expand Up @@ -84,6 +95,17 @@ public function getAttributes($parameters = []): ResponseData
return $this->post('/api/v1/item/attributes/get', $parameters);
}

/**
* Use this api to get all boosted items.
*
* @param array $parameters
* @return ResponseData
*/
public function getBoostedItems($parameters = []): ResponseData
{
return $this->post('/api/v1/items/get_boosted', $parameters);
}

/**
* Use this call to get categories of product item.
*
Expand All @@ -95,6 +117,17 @@ public function getCategories($parameters = []): ResponseData
return $this->post('/api/v1/item/categories/get', $parameters);
}

/**
* Use this api to get comment by shopid/itemid/comment_id
*
* @param array $parameters
* @return ResponseData
*/
public function getComment($parameters = []): ResponseData
{
return $this->post('/api/v1/items/comments/get', $parameters);
}

/**
* Use this call to get detail of item.
*
Expand All @@ -117,6 +150,28 @@ public function getItemsList($parameters = []): ResponseData
return $this->post('/api/v1/items/get', $parameters);
}

/**
* Use this api to get ongoing and upcoming promotions.
*
* @param array $parameters
* @return ResponseData
*/
public function getPromotionInfo($parameters = []): ResponseData
{
return $this->post('/api/v1/item/promotion/get', $parameters);
}

/**
* Use this API to get recommended category ids according to item name.
*
* @param array $parameters
* @return ResponseData
*/
public function getRecommendCats($parameters = []): ResponseData
{
return $this->post('/api/v1/item/categories/get_recommend', $parameters);
}

/**
* Use this call to add one item image in assigned position.
*
Expand All @@ -128,6 +183,28 @@ public function insertItemImg($parameters = []): ResponseData
return $this->post('/api/v1/item/img/insert', $parameters);
}

/**
* Use this api to reply comments from buyers in batch.
*
* @param array $parameters
* @return ResponseData
*/
public function replyComments($parameters = []): ResponseData
{
return $this->post('/api/v1/items/comments/reply', $parameters);
}

/**
* Only for TW whitelisted shop. Use this API to set the installment tenures of items.
*
* @param array $parameters
* @return ResponseData
*/
public function setItemInstallmentTenures($parameters = []): ResponseData
{
return $this->post('/api/v1/item/installment/set', $parameters);
}

/**
* Use this call to update a product item.
*
Expand Down Expand Up @@ -161,6 +238,17 @@ public function updatePrice($parameters = []): ResponseData
return $this->post('/api/v1/items/update_price', $parameters);
}

/**
* Update items price in batch.
*
* @param array $parameters
* @return ResponseData
*/
public function updatePriceBatch($parameters = []): ResponseData
{
return $this->post('/api/v1/items/update/items_price', $parameters);
}

/**
* Use this call to update item stock.
*
Expand All @@ -172,6 +260,17 @@ public function updateStock($parameters = []): ResponseData
return $this->post('/api/v1/items/update_stock', $parameters);
}

/**
* Update items stock in batch.
*
* @param array $parameters
* @return ResponseData
*/
public function updateStockBatch($parameters = []): ResponseData
{
return $this->post('/api/v1/items/update/items_stock', $parameters);
}

/**
* Use this call to update item variation price.
*
Expand All @@ -183,6 +282,17 @@ public function updateVariationPrice($parameters = []): ResponseData
return $this->post('/api/v1/items/update_variation_price', $parameters);
}

/**
* Update variations price in batch.
*
* @param array $parameters
* @return ResponseData
*/
public function updateVariationPriceBatch($parameters = []): ResponseData
{
return $this->post('/api/v1/items/update/vars_price', $parameters);
}

/**
* Use this call to update item variation stock.
*
Expand All @@ -194,6 +304,17 @@ public function updateVariationStock($parameters = []): ResponseData
return $this->post('/api/v1/items/update_variation_stock', $parameters);
}

/**
* Update variations stock in batch.
*
* @param array $parameters
* @return ResponseData
*/
public function updateVariationStockBatch($parameters = []): ResponseData
{
return $this->post('/api/v1/items/update/vars_stock', $parameters);
}

/**
* Use this call to unlist or list items in batch.
*
Expand Down

0 comments on commit e79eded

Please sign in to comment.