zvps/ebay-sell-listing-php-client

注意:这是一个(有限发布)API,仅对业务单元批准的开发者开放。允许卖家在其合作伙伴网站上添加广告或物品时,自动使用合作伙伴网站上物品的详细信息创建eBay列表草稿。

dev-main 2021-07-30 16:33 UTC

This package is auto-updated.

Last update: 2024-09-29 06:20:04 UTC


README

注意:这是一个(有限发布)API,仅对业务单元批准的开发者开放。允许卖家在其合作伙伴网站上添加广告或物品时,自动使用合作伙伴网站上物品的详细信息创建eBay列表草稿。

安装与使用

需求

PHP 7.2及以后版本。

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github/zvps/ebay-sell-listing-php-client.git"
    }
  ],
  "require": {
    "zvps/ebay-sell-listing-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\Listing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Ebay\Sell\Listing\Api\ItemDraftApi(
    // 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
);
$x_ebay_c_marketplace_id = 'x_ebay_c_marketplace_id_example'; // string | Use this header to specify an eBay marketplace ID. For a list of supported sites, see API Restrictions in the Listing API overview.
$content_language = 'content_language_example'; // string | Use this header to specify the natural language of the seller. For details, see Content-Language in HTTP request headers. Required: For EBAY_CA in French. (Content-Language = fr-CA)
$body = new \Ebay\Sell\Listing\Model\ItemDraft(); // \Ebay\Sell\Listing\Model\ItemDraft

try {
    $result = $apiInstance->createItemDraft($x_ebay_c_marketplace_id, $content_language, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ItemDraftApi->createItemDraft: ', $e->getMessage(), PHP_EOL;
}

API端点

所有URI均相对于https://api.ebay.com/sell/listing/v1_beta

模型

授权

授权码

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

关于此包

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

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