cdma-numiscorner/ebay-inventory-api

库存API用于创建和管理库存,然后在该eBay市场上发布和管理此库存。此API中还有将符合条件的、活跃的eBay商品列表转换为库存API模型的方法。

1.2 2023-01-24 13:42 UTC

This package is auto-updated.

Last update: 2024-09-26 19:39:29 UTC


README

库存API用于创建和管理库存,然后在该eBay市场上发布和管理此库存。此API中还有将符合条件的、活跃的eBay商品列表转换为库存API模型的方法。

安装与使用

要求

PHP 7.2 及更高版本。

Composer

要使用Composer安装绑定,请将以下内容添加到 composer.json

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/cdma-numiscorner/EbayInventoryApi.git"
    }
  ],
  "require": {
    "cdma-numiscorner/EbayInventoryApi": "*@dev"
  }
}

然后运行 composer install

重新生成客户端

docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v5.0.1 generate     -i https://developer.ebay.com/api-docs/master/sell/inventory/openapi/3/sell_inventory_v1_oas3.yaml     -g php  --git-user-id cdma-numiscorner --git-host github.com --git-repo-id ebay-inventory-api --invoker-package 'OpenAPI\EbayInventoryClient' --artifact-version 1.0 --release-note "Initial commit" -o /local ```


### Manual Installation

Download the files and include `autoload.php`:

```php
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

入门

请按照 安装过程 进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure OAuth2 access token for authorization: api_auth
$config = OpenAPI\EbayInventoryClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\EbayInventoryClient\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
);
$bulk_inventory_item = new \OpenAPI\EbayInventoryClient\Model\BulkInventoryItem(); // \OpenAPI\EbayInventoryClient\Model\BulkInventoryItem | Details of the inventories with sku and locale

try {
    $result = $apiInstance->bulkCreateOrReplaceInventoryItem($bulk_inventory_item);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InventoryItemApi->bulkCreateOrReplaceInventoryItem: ', $e->getMessage(), PHP_EOL;
}

API端点

所有URI均相对于 https://api.ebay.com/sell/inventory/v1

模型

授权

api_auth

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

关于此包的说明

本PHP包是由OpenAPI Generator项目自动生成的

  • API版本:1.16.1
    • 包版本:1.0
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen