amorvan/ebay-sell-inventory-php-client

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

dev-main 2024-03-10 22:14 UTC

This package is auto-updated.

Last update: 2024-09-10 23:34:36 UTC


README

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

安装与使用

要求

PHP 7.2及更高版本。

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github/zvps/ebay-sell-inventory-php-client.git"
    }
  ],
  "require": {
    "zvps/ebay-sell-inventory-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\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

try {
    $result = $apiInstance->bulkCreateOrReplaceInventoryItem($body);
    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

模型

授权

授权代码

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

关于此包

此PHP包由OpenAPI Generator项目自动生成

  • API版本: 1.14.0
    • 包版本: 5.0.0
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen