macropage / sdk-ebay-rest-catalog
目录API允许用户搜索并定位与要销售的产品直接匹配的eBay目录产品。针对eBay目录产品进行列表发布有助于确保所有列表(基于该目录产品)都有完整和准确的信息。此外
dev-master
2023-03-10 20:45 UTC
Requires
- php: ^7.4 || ^8.0 || ^8.1 || ^8.2
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-09-11 00:06:59 UTC
README
目录API允许用户搜索并定位与要销售的产品直接匹配的eBay目录产品。针对eBay目录产品进行列表发布有助于确保所有列表(基于该目录产品)都有完整和准确的信息。除了有助于创建高质量列表外,卖家使用目录信息创建列表的另一个好处是列表的大部分细节将自动填写,包括列表标题、列表描述、项目详情以及产品的库存图片(如果可用)。卖家无需自行输入项目详情,整个列表过程也更加快速和简单。
安装和用法
要求
PHP 7.4 及更高版本。也应与PHP 8.0 兼容。
Composer
要通过Composer安装绑定,请将以下内容添加到 composer.json
{ "repositories": [ { "type": "vcs", "url": "https://github.com/macropage/sdk-ebay-rest-catalog.git" } ], "require": { "macropage/sdk-ebay-rest-catalog": "*@dev" } }
然后运行 composer install
手动安装
下载文件并包含 autoload.php
<?php require_once('/path/to/sdk-ebay-rest-catalog/vendor/autoload.php');
入门
请按照 安装程序 操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: api_auth $config = macropage\SDKs\ebay\rest\catalog\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new macropage\SDKs\ebay\rest\catalog\Api\ProductApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $epid = 'epid_example'; // string | The ePID of the product being requested. This value can be discovered by issuing the <b>search</b> method and examining the value of the <b>productSummaries.epid</b> field for the desired returned product summary. $xEBAYCMARKETPLACEID = 'xEBAYCMARKETPLACEID_example'; // string | This method also uses the <code>X-EBAY-C-MARKETPLACE-ID</code> header to identify the seller's eBay marketplace. It is required for all marketplaces except EBAY_US, which is the default. <b>Note:</b> This method is limited to <code>EBAY_US</code>, <code>EBAY_AU</code>, <code>EBAY_CA</code>, and <code>EBAY_GB</code> values. try { $result = $apiInstance->getProduct($epid, $xEBAYCMARKETPLACEID); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProductApi->getProduct: ', $e->getMessage(), PHP_EOL; }
API端点
所有URI均相对于 https://api.ebay.com/commerce/catalog/v1_beta
模型
授权
api_auth
- 类型:
OAuth
- 流程:
accessCode
- 授权URL:
https://auth.ebay.com/oauth2/authorize
- 作用域:
- https://api.ebay.com/oauth/api_scope/commerce.catalog.readonly: 此作用域允许登录用户读取目录数据。
- https://api.ebay.com/oauth/api_scope/sell.inventory: 查看和管理您的库存和出价
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包是由OpenAPI Generator项目自动生成的
- API版本:
v1_beta.5.0
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen