macropage/sdk-ebay-rest-fulfillment

使用 Fulfillment API 根据结账时指定的支付方式和时间,代表卖家完成包装、地址、处理和发货的每个订单过程。

dev-master 2020-03-17 09:34 UTC

This package is auto-updated.

Last update: 2024-08-29 05:24:46 UTC


README

使用 Fulfillment API 根据结账时指定的支付方式和时间,代表卖家完成包装、地址、处理和发货的每个订单过程。

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

  • API 版本:1.11.1
  • 包版本:2.3.2
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen

要求

PHP 5.5 及以上

安装与使用

Composer

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

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

然后运行 composer install

手动安装

下载文件并包含 autoload.php

    require_once('/path/to/sdk-ebay-rest-fulfillment/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门

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

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

// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\fulfillment\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new macropage\SDKs\ebay\rest\fulfillment\Api\OrderApi(
    // 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
);
$orderId = 'orderId_example'; // string | The unique identifier of the order. Order ID values are shown in My eBay/Seller Hub, and are also returned by the getOrders method in the orders.orderId field. Note: A new order ID format was introduced to all eBay APIs (legacy and REST) in June 2019. In REST APIs that return Order IDs, including the Fulfillment API, all order IDs are returned in the new format, but the getOrder method will accept both the legacy and new format order ID. The new format is a non-parsable string, globally unique across all eBay marketplaces, and consistent for both single line item and multiple line item orders. These order identifiers will be automatically generated after buyer payment, and unlike in the past, instead of just being known and exposed to the seller, these unique order identifiers will also be known and used/referenced by the buyer and eBay customer support.

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

?>

API 端点文档

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

模型文档

授权文档

api_auth

作者