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.
PHP 7.2 and later.
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
Download the files and include autoload.php
:
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
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;
}
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} |
- AdditionalOption
- Amount
- Contact
- ContactAddress
- CreateShipmentFromQuoteRequest
- Dimensions
- Error
- ErrorParameter
- Order
- PackageSpecification
- PhoneNumber
- PickupSlot
- PurchasedRate
- Rate
- Shipment
- ShipmentCancellation
- ShippingQuote
- ShippingQuoteRequest
- Weight
- Type:
OAuth
- Flow:
accessCode
- Authorization URL:
https://auth.ebay.com/oauth2/authorize
- Scopes:
- https://api.ebay.com/oauth/api_scope/sell.logistics: This scope would allow signed in user to access Logistics information.
To run the tests, use:
composer install
vendor/bin/phpunit
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
v1_beta.0.0
- Package version:
5.0.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen