macropage / sdk-ebay-rest-negotiation
协商API允许卖家向已对其商品表示“兴趣”的买家主动发送折扣优惠。<br><br>通过向买家发送他们感兴趣的商品的折扣优惠,卖家可以增加其销售速度。<br><br>有关
dev-master
2023-06-27 14:59 UTC
Requires
- php: ^7.4 || ^8.0
- 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-27 17:46:46 UTC
README
协商API允许卖家向已对其商品表示“兴趣”的买家主动发送折扣优惠。
通过向买家发送他们感兴趣的商品的折扣优惠,卖家可以增加其销售速度。
买家表示对商品感兴趣的方式有很多。例如,如果买家将商品添加到他们的关注列表中,或者如果他们把商品添加到购物车后又将其遗弃,都被认为是对该商品表示了兴趣。
在卖家发送的优惠中,他们可以通过折扣列表价格的一定百分比来折扣他们的商品,或者他们可以设置一个低于原始列表价格的新折扣价格。
有关卖家优惠如何工作的详细信息,请参阅 <a href="/api-docs/sell/static/marketing/offers-to-buyers.html" title="Selling Integration Guide">向买家发送优惠。
通过
docker run --rm -v ${PWD}:/app -w /app openapitools/openapi-generator-cli:v6.6.0 generate -i /app/sell_negotiation_v1_oas3.yaml -g php -o /app --config /app/openapi-config.php.ebay.negotiation.json
安装与使用
要求
PHP 7.4及更高版本。也应与PHP 8.0兼容。
Composer
要通过Composer安装绑定,请将以下内容添加到composer.json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/macropage/sdk-ebay-rest-negotiation.git"
}
],
"require": {
"macropage/sdk-ebay-rest-negotiation": "*@dev"
}
}
然后运行composer install
手动安装
下载文件并包含autoload.php
<?php require_once('/path/to/sdk-ebay-rest-negotiation/vendor/autoload.php');
入门
请按照安装程序进行操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: api_auth $config = macropage\SDKs\ebay\rest\negotiation\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new macropage\SDKs\ebay\rest\negotiation\Api\OfferApi( // 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 ); $xEBAYCMARKETPLACEID = 'xEBAYCMARKETPLACEID_example'; // string | The eBay marketplace on which you want to search for eligible listings. <br><br>For a complete list of supported marketplaces, see <a href=\"/api-docs/sell/negotiation/overview.html#requirements\" title=\"Negotiation API Overview\">Negotiation API requirements and restrictions</a>. $limit = 'limit_example'; // string | This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. <p><b>Minimum:</b> 1 <b>Maximum:</b> 200 <br><b>Default: </b>10</p> $offset = 'offset_example'; // string | This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. <br><br>Combine <b>offset</b> with the <b>limit</b> query parameter to control the items returned in the response. For example, if you supply an <b>offset</b> of <code>0</code> and a <b>limit</b> of <code>10</code>, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If <b>offset</b> is <code>10</code> and <b>limit</b> is <code>20</code>, the first page of the response contains items 11-30 from the complete result set. <br><br><b>Default:</b> 0 try { $result = $apiInstance->findEligibleItems($xEBAYCMARKETPLACEID, $limit, $offset); print_r($result); } catch (Exception $e) { echo 'Exception when calling OfferApi->findEligibleItems: ', $e->getMessage(), PHP_EOL; }
API端点
所有URI均相对于https://api.ebay.com/sell/negotiation/v1
模型
- 金额
- CreateOffersRequest
- EligibleItem
- Error
- ErrorParameter
- Offer
- OfferedItem
- PagedEligibleItemCollection
- SendOfferToInterestedBuyersCollectionResponse
- TimeDuration
- User
授权
API定义的认证方案
api_auth
- 类型:
OAuth - 流程:
accessCode - 授权URL:
https://auth.ebay.com/oauth2/authorize - 作用域:
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包由OpenAPI Generator项目自动生成
- API版本:
v1.1.0- 包版本:
1.9.0
- 包版本:
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen