承接 james-and-james-fulfilment/amazon-sp-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

james-and-james-fulfilment/amazon-sp-api

最新稳定版本:v1.1.3

Composer 安装命令:

composer require james-and-james-fulfilment/amazon-sp-api

包简介

README 文档

README

The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the Listings Items API Use Case Guide.

This PHP package is automatically generated by the Swagger Codegen project:

Usage

public function getAccessToken($channel_account): string
{
    $refresh_token = $channel_account->getAuthDetail('refresh_token');

    if (!$refresh_token) {
        throw new AmazonSPAPIOAuthException('Invalid refresh_token');
    }

    return AmazonSPAPIOAuth::getAccessTokenFromRefreshToken(
        $refresh_token,
        $this->client_id,
        $this->client_secret
    );
}

public function prepareRequestConfig($channel_account, $token): array
{
    $auth_details = $channel_account->getAuthDetail();
    $region_key   = $auth_details['region'];
    $region       = AmazonSPAPIRegion::$$region_key;
    $endpoint     = AmazonSPAPIEndpoint::$$region_key;
    $assumedRole  = AssumeRole::assume(
        $region,
        $this->iam_user_access_key,
        $this->iam_user_secret_key,
        $this->iam_role_arn,
    );

    $config = Configuration::getDefaultConfiguration();
    $config->setAccessToken($token);
    $config->setAccessKey($assumedRole->getAccessKeyId());
    $config->setSecretKey($assumedRole->getSecretAccessKey());
    $config->setRegion($region);
    $config->setSecurityToken($assumedRole->getSessionToken());

    return $config;
}

统计信息

  • 总下载量: 14.21k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 5
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2022-03-03