leibbrand-development/sdk-ebay-inventory

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

dev-main 2021-12-09 23:01 UTC

This package is not auto-updated.

Last update: 2024-09-28 10:34:46 UTC


README

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

安装与使用

要求

PHP 7.3及更高版本。理论上也适用于PHP 8.0,但尚未测试。

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GuidoLeibbrand/sdk-ebay-inventory.git"
    }
  ],
  "require": {
    "GuidoLeibbrand/sdk-ebay-inventory": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

<?php
require_once('/path/to/sdk-ebay-inventory/vendor/autoload.php');

入门

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

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



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


$apiInstance = new ld\php\sdkEbayInventory\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
);
$bulkInventoryItem = new \ld\php\sdkEbayInventory\Model\BulkInventoryItem(); // \ld\php\sdkEbayInventory\Model\BulkInventoryItem | Details of the inventories with sku and locale

try {
    $result = $apiInstance->bulkCreateOrReplaceInventoryItem($bulkInventoryItem);
    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.14.0
    • 包版本:1.14
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen