From 4f7010157a5aab2184f08cf9066a0f2a6451cd0a Mon Sep 17 00:00:00 2001 From: marcum8er <119655028+marcum8er@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:40:14 -0800 Subject: [PATCH 1/2] Update AffiliatePartner.php --- src/Resources/AffiliatePartner.php | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/Resources/AffiliatePartner.php b/src/Resources/AffiliatePartner.php index d6eb9f7..30ffafb 100644 --- a/src/Resources/AffiliatePartner.php +++ b/src/Resources/AffiliatePartner.php @@ -32,4 +32,49 @@ public function getAffiliatePartnerCampaignProductList($campaign_id, $query) RequestOptions::QUERY => $query, ]); } + + public function getAffiliatePartnerCampaignDetail($campaign_id, $query) + { + return $this->call('GET', 'campaigns/'.$campaign_id, [ + RequestOptions::QUERY => $query, + ]); + } + + public function reviewAffiliatePartnerCampaignProduct($campaign_id, $product_id, $query, $body) + { + return $this->call('POST', 'campaigns/'.$campaign_id.'/products/'.$product_id.'/review', [ + RequestOptions::QUERY => $query, + RequestOptions::JSON => $body, + ]); + } + + public function editAffiliatePartnerCampaign($campaign_id, $query, $body) + { + return $this->call('POST', 'campaigns/'.$campaign_id.'/partial_edit', [ + RequestOptions::QUERY => $query, + RequestOptions::JSON => $body, + ]); + } + + public function getAffiliatePartnerCampaignList($query) + { + return $this->call('GET', 'campaigns', [ + RequestOptions::QUERY => $query, + ]); + } + + public function publishAffiliatePartnerCampaign($campaign_id, $query) + { + return $this->call('POST', 'campaigns/'.$campaign_id.'/publish', [ + RequestOptions::QUERY => $query, + ]); + } + + public function generateAffiliatePartnerCampaignProductLink($campaign_id, $product_id, $query, $body) + { + return $this->call('POST', 'campaigns/'.$campaign_id.'/products/'.$product_id.'/promotion_link/generate', [ + RequestOptions::QUERY => $query, + RequestOptions::JSON => $body, + ]); + } } From 8793b2fd1ceedca28747aec36b96f3faa7b66fef Mon Sep 17 00:00:00 2001 From: marcum8er <119655028+marcum8er@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:41:53 -0800 Subject: [PATCH 2/2] enable AffiliatePartner api --- src/Client.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Client.php b/src/Client.php index fe7d77f..ab2f7ea 100644 --- a/src/Client.php +++ b/src/Client.php @@ -12,6 +12,7 @@ use EcomPHP\TiktokShop\Errors\ResponseException; use EcomPHP\TiktokShop\Resources\AffiliateCreator; +use EcomPHP\TiktokShop\Resources\AffiliatePartner; use EcomPHP\TiktokShop\Resources\AffiliateSeller; use EcomPHP\TiktokShop\Resources\CustomerService; use GuzzleHttp\Exception\GuzzleException; @@ -50,6 +51,7 @@ * @property-read CustomerService $CustomerService * @property-read AffiliateSeller $AffiliateSeller * @property-read AffiliateCreator $AffiliateCreator + * @property-read AffiliatePartner $AffiliatePartner */ class Client { @@ -88,6 +90,7 @@ class Client CustomerService::class, AffiliateSeller::class, AffiliateCreator::class, + AffiliatePartner::class, ]; public function __construct($app_key, $app_secret, $options = [])