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.
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.
PHP 7.2 and later.
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
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: 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;
}
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
- InlineResponse400
- 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
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen