minotaurlogistics/ebay-inventory-api

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

1.2 2021-06-17 06:35 UTC

This package is auto-updated.

Last update: 2024-09-17 13:32:11 UTC


README

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

安装与使用

需求

PHP 7.2 及以上。

Composer

要通过Composer安装绑定,请在 composer.json 中添加以下内容

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/minotaurlogistics/ebay-inventory-api.git"
    }
  ],
  "require": {
    "minotaurlogistics/ebay-inventory-api": "*@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: api_auth
$config = Swagger\EbayInventoryClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Swagger\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 \Swagger\EbayInventoryClient\Model\BulkInventoryItem(); // \Swagger\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.13.0
    • 软件包版本:1.2
  • 构建软件包:org.openapitools.codegen.languages.PhpClientCodegen