|
|
@@ -6,7 +6,7 @@ use Illuminate\Support\Facades\Http;
|
|
|
|
|
|
class CoupangLib
|
|
|
{
|
|
|
- const SUB_ID = 'AF0305179';
|
|
|
+ const SUB_ID = 'pick202303';
|
|
|
const BASE_URL = 'https://api-gateway.coupang.com';
|
|
|
const BASE_PATH = '/v2/providers/affiliate_open_api/apis/openapi';
|
|
|
|
|
|
@@ -25,7 +25,7 @@ class CoupangLib
|
|
|
*/
|
|
|
public function getBestCategories(int $categoryID): ?array
|
|
|
{
|
|
|
- $path = sprintf('/v1/products/bestcategories/%s?limit=%d', $categoryID, 100);
|
|
|
+ $path = sprintf('/v1/products/bestcategories/%s?limit=%d&subId=%s', $categoryID, 100, self::SUB_ID);
|
|
|
$auth = $this->getAuthorization($path);
|
|
|
|
|
|
$response = Http::withHeaders([
|
|
|
@@ -42,7 +42,7 @@ class CoupangLib
|
|
|
*/
|
|
|
public function getSearch(?string $keyword): ?array
|
|
|
{
|
|
|
- $path = sprintf('/products/search?keyword=%s&limit=%d&srpLinkOnly=false', urlencode($keyword), 10);
|
|
|
+ $path = sprintf('/products/search?keyword=%s&limit=%d&srpLinkOnly=false&subId=%s', urlencode($keyword), 10, self::SUB_ID);
|
|
|
$auth = $this->getAuthorization($path);
|
|
|
|
|
|
$response = Http::withHeaders([
|
|
|
@@ -59,7 +59,7 @@ class CoupangLib
|
|
|
*/
|
|
|
public function getAllCoupangPL(): ?array
|
|
|
{
|
|
|
- $path = '/v1/products/coupangPL?limit=100';
|
|
|
+ $path = sprintf('/v1/products/coupangPL?limit=100&subId=%s', self::SUB_ID);
|
|
|
$auth = $this->getAuthorization($path);
|
|
|
|
|
|
$response = Http::withHeaders([
|
|
|
@@ -76,7 +76,7 @@ class CoupangLib
|
|
|
*/
|
|
|
public function getCoupangPL(int $brandID): ?array
|
|
|
{
|
|
|
- $path = sprintf('/v1/products/coupangPL/%s?limit=%d', $brandID, 100);
|
|
|
+ $path = sprintf('/v1/products/coupangPL/%s?limit=%d&subId=%s', $brandID, 100, self::SUB_ID);
|
|
|
$auth = $this->getAuthorization($path);
|
|
|
|
|
|
$response = Http::withHeaders([
|
|
|
@@ -93,7 +93,7 @@ class CoupangLib
|
|
|
*/
|
|
|
public function getGoldBox(): ?array
|
|
|
{
|
|
|
- $path = '/v1/products/goldbox';
|
|
|
+ $path = sprintf('/v1/products/goldbox?subId=%s', self::SUB_ID);
|
|
|
$auth = $this->getAuthorization($path);
|
|
|
|
|
|
$response = Http::withHeaders([
|