zvps / ebay-sell-negotiation-php-client
谈判API允许卖家主动向对其商品列表表示“兴趣”的买家发送折扣优惠。通过向表示兴趣的买家发送商品列表的折扣优惠,卖家可以增加其销售的速率。买家表示对列表感兴趣的方式有很多种。例如,如果买家将列表添加到他们的关注列表中,或者如果他们将列表添加到购物车中但后来放弃购物车,那么他们被认为对该列表表示了兴趣。在卖家发送的优惠中,他们可以通过从列表价格中减去一定比例来折扣他们的列表,或者他们可以设置一个低于原始列表价格的新折扣价格。有关卖家优惠如何工作的详细信息,请参阅向买家发送优惠。
Requires
- php: >=5.6
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-09-29 05:56:49 UTC
README
谈判API允许卖家主动向对其商品列表表示“兴趣”的买家发送折扣优惠。通过向表示兴趣的买家发送商品列表的折扣优惠,卖家可以增加其销售的速率。买家表示对列表感兴趣的方式有很多种。例如,如果买家将列表添加到他们的关注列表中,或者如果他们将列表添加到购物车中但后来放弃购物车,那么他们被认为对该列表表示了兴趣。在卖家发送的优惠中,他们可以通过从列表价格中减去一定比例来折扣他们的列表,或者他们可以设置一个低于原始列表价格的新折扣价格。有关卖家优惠如何工作的详细信息,请参阅向买家发送优惠。
安装与使用
需求
PHP 7.2 及以上。
Composer
要通过 Composer 安装绑定,请在 composer.json 中添加以下内容
{
"repositories": [
{
"type": "vcs",
"url": "https://github/zvps/ebay-sell-negotiation-php-client.git"
}
],
"require": {
"zvps/ebay-sell-negotiation-php-client": "*@dev"
}
}
然后运行 composer install
手动安装
下载文件并包含 autoload.php
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
入门
请按照安装程序进行操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: Authorization Code $config = Ebay\Sell\Negotiation\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Ebay\Sell\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 ); $x_ebay_c_marketplace_id = 'x_ebay_c_marketplace_id_example'; // string | The eBay marketplace on which you want to search for eligible listings. For a complete list of supported marketplaces, see Negotiation API requirements and restrictions. $limit = 56; // int | This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1 Maximum: 200 Default: 10 $offset = 56; // int | This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 try { $result = $apiInstance->findEligibleItems($x_ebay_c_marketplace_id, $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
- Offer
- OfferedItem
- PagedEligibleItemCollection
- SendOfferToInterestedBuyersCollectionResponse
- 时间持续时间
- 用户
授权
授权码
- 类型:
OAuth - 流程:
accessCode - 授权 URL:
https://auth.ebay.com/oauth2/authorize - 作用域:
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此 PHP 包是由 OpenAPI Generator 项目自动生成的
- API 版本:
v1.1.0- 包版本:
5.0.0
- 包版本:
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen