Skip to content

Ehaic/EbaySellLogistics

Repository files navigation

OpenAPIClient-php

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 base service and addition shipping options are totaled into the totalShippingCost. This action also generates a shipping label that you can use to ship the package.<p class="tablenote">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.com/AjohnsonCHC/EbaySellLogistics.git"
    }
  ],
  "require": {
    "AjohnsonCHC/EbaySellLogistics": "*@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: api_auth
$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

api_auth

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
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published