Skip to content

Latest commit

 

History

History
129 lines (84 loc) · 5.71 KB

ShippingQuoteApi.md

File metadata and controls

129 lines (84 loc) · 5.71 KB

eBay\Sell\Logistics\ShippingQuoteApi

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

Method HTTP request Description
createShippingQuote() POST /shipping_quote
getShippingQuote() GET /shipping_quote/{shippingQuoteId}

createShippingQuote()

createShippingQuote($shipping_quote_request): \eBay\Sell\Logistics\Model\ShippingQuote

The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package.

Example

<?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\ShippingQuoteApi(
    // 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
);
$shipping_quote_request = new \eBay\Sell\Logistics\Model\ShippingQuoteRequest(); // \eBay\Sell\Logistics\Model\ShippingQuoteRequest | The request object for createShippingQuote.

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

Parameters

Name Type Description Notes
shipping_quote_request \eBay\Sell\Logistics\Model\ShippingQuoteRequest The request object for createShippingQuote.

Return type

\eBay\Sell\Logistics\Model\ShippingQuote

Authorization

api_auth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getShippingQuote()

getShippingQuote($shipping_quote_id): \eBay\Sell\Logistics\Model\ShippingQuote

This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId.

Example

<?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\ShippingQuoteApi(
    // 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
);
$shipping_quote_id = 'shipping_quote_id_example'; // string | This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote.

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

Parameters

Name Type Description Notes
shipping_quote_id string This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote.

Return type

\eBay\Sell\Logistics\Model\ShippingQuote

Authorization

api_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]