Skip to content

Latest commit

 

History

History
136 lines (97 loc) · 5.29 KB

README.md

File metadata and controls

136 lines (97 loc) · 5.29 KB

OpenAPIClient-php

Note: This is a (Limited Release) API available only to select developers approved by business units. The Logistics API resources offer the following capabilities: shipping_quote – Consolidates into a list a set of live shipping rates, or quotes, from which you can select a rate to ship a package. shipment – Creates a "shipment" for the selected shipping rate. Call createShippingQuote to get a list of live shipping rates. The rates returned are all valid for a specific time window and all quoted prices are at eBay-negotiated rates. Select one of the live rates and using its associated rateId, create a "shipment" for the package by calling createFromShippingQuote. Creating a shipment completes an agreement, and the cost of the base service and any added shipping options are summed into the returned totalShippingCost value. This action also generates a shipping label that you can use to ship the package. The total cost of the shipment is incurred when the package is shipped using the supplied shipping label. Important! Sellers must set up a payment method via their eBay account before they can use the methods in this API to create a shipment and the associated shipping label.

Installation & Usage

Requirements

PHP 7.2 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github/zvps/ebay-sell-logistics-php-client.git"
    }
  ],
  "require": {
    "zvps/ebay-sell-logistics-php-client": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

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



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


$apiInstance = new Ebay\Sell\Logistics\Api\ShipmentApi(
    // 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
);
$shipment_id = 'shipment_id_example'; // string | This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote.

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

API Endpoints

All URIs are relative to https://api.ebay.com/sell/logistics/v1_beta

Class Method HTTP request Description
ShipmentApi cancelShipment POST /shipment/{shipmentId}/cancel
ShipmentApi createFromShippingQuote POST /shipment/create_from_shipping_quote
ShipmentApi downloadLabelFile GET /shipment/{shipmentId}/download_label_file
ShipmentApi getShipment GET /shipment/{shipmentId}
ShippingQuoteApi createShippingQuote POST /shipping_quote
ShippingQuoteApi getShippingQuote GET /shipping_quote/{shippingQuoteId}

Models

Authorization

Authorization Code

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: v1_beta.0.0
    • Package version: 5.0.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen