minotaurlogistics/ebay-account-api

1.0 2020-11-24 08:22 UTC

This package is auto-updated.

Last update: 2024-09-24 17:04:29 UTC


README

Build Status

EBay账户API

账户API为卖家提供了配置其eBay卖家账户的能力,包括卖家的政策(履行政策、支付政策和退货政策)、选择加入或退出eBay卖家计划、配置销售税表以及获取账户信息。有关此API中方法可用性的详细信息,请参阅账户API的要求和限制。

此PHP软件包由Swagger Codegen项目自动生成

  • API版本:v1.6.0
  • 软件包版本:1.0
  • 构建软件包:io.swagger.codegen.languages.PhpClientCodegen

要求

PHP 5.5及以后版本

安装与使用

Composer

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

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/minotaurlogistics/ebay-account-api.git"
    }
  ],
  "require": {
    "minotaurlogistics/ebay-account-api": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

    require_once('/path/to/SwaggerClient-php/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

重新生成客户端

docker run --rm -v ${PWD}:/codegen/SwaggerClient-php swaggerapi/swagger-codegen-cli generate \
-i https://developer.ebay.com/api-docs/master/sell/account/openapi/2/sell_account_v1_oas2.json \ 
-o /codegen \
-l php \
--git-user-id minotaurlogistics --git-repo-id ebay-account-api \
--invoker-package 'Swagger\EbayAccountClient' \
--artifact-version 1.0 \
--api-package 'GeneratedApi'

入门

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

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

// Configure OAuth2 access token for authorization: Authorization Code
$config = Swagger\EbayAccountClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\EbayAccountClient\Api\FulfillmentPolicyApi(
    // 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 \Swagger\EbayAccountClient\Model\FulfillmentPolicyRequest(); // \Swagger\EbayAccountClient\Model\FulfillmentPolicyRequest | Request to create a seller account fulfillment policy.

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

?>

API端点文档

所有URI都是相对于https://api.ebay.com/sell/account/v1

模型文档

授权文档

授权码

作者