christian71-stack / ebay-inventory-api
1.1
2023-12-30 14:45 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 not auto-updated.
Last update: 2024-09-21 18:29:13 UTC
README
库存API用于创建和管理库存,然后在eBay市场上发布和管理该库存。该API中还有将合格的、活跃的eBay列表转换为库存API模型的方法。
此PHP包是由Swagger Codegen项目自动生成的
- API版本:1.17.2
- 构建包:io.swagger.codegen.v3.generators.php.PhpClientCodegen
要求
PHP 5.5及更高版本
安装与使用
Composer
要使用Composer安装绑定,请将以下内容添加到composer.json
{
"repositories": [
{
"type": "git",
"url": "https://github.com/christian71-stack/ebay-sell-inventory-php-client.git"
}
],
"require": {
"christian71-stack/ebay-sell-inventory-php-client": "*@dev"
}
}
然后运行composer install
手动安装
下载文件并包含autoload.php
require_once('/path/to//vendor/autoload.php');
测试
要运行单元测试
composer install
./vendor/bin/phpunit
入门指南
请遵循安装过程,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: api_auth $config = Ebay\Sell\Inventory\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Ebay\Sell\Inventory\Api\InventoryItemApi( // 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 ); $body = new \Ebay\Sell\Inventory\Model\BulkInventoryItem(); // \Ebay\Sell\Inventory\Model\BulkInventoryItem | Details of the inventories with sku and locale $content_type = "content_type_example"; // string | This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>. $content_language = "content_language_example"; // string | This header sets the natural language that will be used in the field values of the request payload. For example, the value passed in this header should be <code>en-US</code> for English or <code>de-DE</code> for German.<br><br>For more information on the Content-Language header, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>. try { $result = $apiInstance->bulkCreateOrReplaceInventoryItem($body, $content_type, $content_language); print_r($result); } catch (Exception $e) { echo 'Exception when calling InventoryItemApi->bulkCreateOrReplaceInventoryItem: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: api_auth $config = Ebay\Sell\Inventory\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Ebay\Sell\Inventory\Api\InventoryItemApi( // 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 ); $body = new \Ebay\Sell\Inventory\Model\BulkGetInventoryItem(); // \Ebay\Sell\Inventory\Model\BulkGetInventoryItem | Details of the inventories with sku and locale $content_type = "content_type_example"; // string | This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>. try { $result = $apiInstance->bulkGetInventoryItem($body, $content_type); print_r($result); } catch (Exception $e) { echo 'Exception when calling InventoryItemApi->bulkGetInventoryItem: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: api_auth $config = Ebay\Sell\Inventory\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Ebay\Sell\Inventory\Api\InventoryItemApi( // 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 ); $body = new \Ebay\Sell\Inventory\Model\BulkPriceQuantity(); // \Ebay\Sell\Inventory\Model\BulkPriceQuantity | Price and allocation details for the given SKU and Marketplace $content_type = "content_type_example"; // string | This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>. try { $result = $apiInstance->bulkUpdatePriceQuantity($body, $content_type); print_r($result); } catch (Exception $e) { echo 'Exception when calling InventoryItemApi->bulkUpdatePriceQuantity: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: api_auth $config = Ebay\Sell\Inventory\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Ebay\Sell\Inventory\Api\InventoryItemApi( // 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 ); $body = new \Ebay\Sell\Inventory\Model\InventoryItem(); // \Ebay\Sell\Inventory\Model\InventoryItem | Details of the inventory item record. $content_language = "content_language_example"; // string | This header sets the natural language that will be used in the field values of the request payload. For example, the value passed in this header should be <code>en-US</code> for English or <code>de-DE</code> for German.<br><br>For more information on the Content-Language header, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>. $content_type = "content_type_example"; // string | This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>. $sku = "sku_example"; // string | This path parameter specifies the seller-defined SKU value for the inventory item being created or updated. SKU values must be unique across the seller's inventory. <br><br> <strong>Max length</strong>: 50 try { $result = $apiInstance->createOrReplaceInventoryItem($body, $content_language, $content_type, $sku); print_r($result); } catch (Exception $e) { echo 'Exception when calling InventoryItemApi->createOrReplaceInventoryItem: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: api_auth $config = Ebay\Sell\Inventory\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Ebay\Sell\Inventory\Api\InventoryItemApi( // 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 ); $sku = "sku_example"; // string | This path parameter specifies the seller-defined SKU value of the product whose inventory item record you wish to delete.<br><br>Use the <a href=\"/api-docs/sell/inventory/resources/inventory_item/methods/getInventoryItems\" target=\"_blank \">getInventoryItems</a> method to retrieve SKU values.<br><br><strong>Max length</strong>: 50 try { $apiInstance->deleteInventoryItem($sku); } catch (Exception $e) { echo 'Exception when calling InventoryItemApi->deleteInventoryItem: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: api_auth $config = Ebay\Sell\Inventory\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Ebay\Sell\Inventory\Api\InventoryItemApi( // 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 ); $sku = "sku_example"; // string | This path parameter specifies the seller-defined SKU value of the product whose inventory item record you wish to retrieve.<br><br>Use the <a href=\"/api-docs/sell/inventory/resources/inventory_item/methods/getInventoryItems\" target=\"_blank \">getInventoryItems</a> method to retrieve SKU values.<br><br><strong>Max length</strong>: 50 try { $result = $apiInstance->getInventoryItem($sku); print_r($result); } catch (Exception $e) { echo 'Exception when calling InventoryItemApi->getInventoryItem: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: api_auth $config = Ebay\Sell\Inventory\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Ebay\Sell\Inventory\Api\InventoryItemApi( // 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 ); $limit = "limit_example"; // string | The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from <code>1</code> to <code>100</code>. <br><br><strong>Min</strong>: 1<br><br><strong>Max</strong>: 100<br><br><b>Default</b>: 25 $offset = "offset_example"; // string | The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of <code>0</code>, the second page of records has a value of <code>1</code>, and so on. If this query parameter is not set, its value defaults to <code>0</code>, and the first page of records is returned. try { $result = $apiInstance->getInventoryItems($limit, $offset); print_r($result); } catch (Exception $e) { echo 'Exception when calling InventoryItemApi->getInventoryItems: ', $e->getMessage(), PHP_EOL; } ?>
API端点文档
所有URI均相对于https://api.ebay.com{basePath}
模型文档
- 地址
- 金额
- 可用性
- 可用性分布
- 全部可用性
- 基本响应
- 最佳出价
- 批量eBay出价详情
- 批量获取库存项目
- 批量获取库存项目响应
- 批量库存项目
- 批量库存项目响应
- 批量迁移列表
- 批量迁移列表响应
- 批量出价
- 批量出价响应
- 批量价格数量
- 批量价格数量响应
- 批量发布响应
- 慈善
- 兼容性
- 兼容产品
- 条件描述符
- 国家政策
- 尺寸
- eBay出价详情
- eBay出价详情
- eBay出价详情
- 能源效率标签
- 错误
- 错误参数
- 扩展生产者责任
- 费用
- 费用摘要
- 费用摘要响应
- 格式分配
- 地理坐标
- 获取库存项目
- 获取库存项目响应
- 危险品
- 间隔
- 库存项目
- 库存项目组
- 库存项目列表
- 库存项目响应
- 库存项目
- 库存项目组键
- 库存项目组ID
- 库存项目
- 库存位置
- 库存位置
- 库存位置响应
- 列表详情
- 列表政策
- 位置
- 位置详情
- 位置响应
- 迁移列表
- 迁移列表响应
- 名称值列表
- 出价键
- 出价键
- 出价价格数量
- 出价响应
- 出价响应
- 出价SKU响应
- 出价
- 营业时间
- 包装重量和尺寸
- 门店自提可用性
- 价格数量
- 价格数量响应
- 定价摘要
- 产品
- 产品家族属性
- 产品标识符
- 通过库存项目组请求发布
- 发布响应
- 区域产品合规政策
- 区域回收政策
- 法规
- 发货位置可用性
- 发货位置可用性
- 覆盖运费
- 特殊营业时间
- 规格
- 税收
- 时间持续时间
- 变化
- 版本
- 重量
- 通过库存项目组请求撤回
- 撤回响应
授权文档
api_auth
- 类型:OAuth
- 流程:授权码
- 授权URL:https://auth.ebay.com/oauth2/authorize
- 作用域:
- https://api.ebay.com/oauth/api_scope/sell.inventory:查看和管理您的库存和报价
- https://api.ebay.com/oauth/api_scope/sell.inventory.readonly:查看您的库存和报价