---
name: logistics-api
description: "Logistics API skill. Use when working with Logistics for shipment, shipping_quote. Covers 6 endpoints."
version: 1.0.0
generator: lapsh
---

# Logistics API
API version: v1_beta.0.0

## Auth
OAuth2

## Base URL
https://api.ebay.com/sell/logistics/v1_beta

## Setup
1. Configure auth: OAuth2
2. GET /shipment/{shipmentId}/download_label_file -- this method returns the shipping label file that was generated for the shipmentid value specified in the request. call createfromshippingquote to generate a shipment id.note: the logistics api only supports usps shipping rates and labels.use the accept http header to specify the format of the returned file. the default file format is a pdf file.
3. POST /shipment/{shipmentId}/cancel -- create first cancel

## Endpoints
6 endpoints across 2 groups. See references/api-spec.lap for full details.

### Shipment
| Method | Path | Description |
|--------|------|-------------|
| POST | /shipment/{shipmentId}/cancel | This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement.  Note that you cannot cancel a shipment if you have used the associated shipping label. |
| POST | /shipment/create_from_shipping_quote | This method creates a shipment based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates.Note: The Logistics API only supports USPS shipping rates and labels.When you create a shipment, eBay generates a shipping label that you can download and use to ship your package.In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the shipping quote.In addition to a configurable return-to location and other details about the shipment, the response to this method includes:The shipping carrier and service to be used for the package shipmentA list of selected shipping options, if anyThe shipment tracking numberThe total shipping cost (the sum cost of the base shipping service and any added options)When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadURL field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package.Important! ">Important! Sellers must set up their payment method before they can use this method to create a shipment and the associated shipping label.Set up a billing agreementPrior to using this method to create a shipment, sellers must first set up their billing agreement. Failure to do so will return Error 90030 Payment could not be completed.The preferred method for sellers to set up their billing agreement is to go to Set up billing agreement and follow the on-screen directions.Alternatively, sellers can do the following:Go to https://www.ebay.com/ship/single/{order_id}, where {order_id} is that of the order for which the label is being printed.When prompted, select PayPal.Verify that Save PayPal for future purchases is selected.Click Set up Payments which will open PayPal in a pop-up window.Log in using PayPal credentials, and then follow the on-screen prompts to set up the billing agreement.Once the agreement has been set up, sellers can leave this page as there is no need to actually print a label. |
| GET | /shipment/{shipmentId}/download_label_file | This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID.Note: The Logistics API only supports USPS shipping rates and labels.Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. |
| GET | /shipment/{shipmentId} | This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. |

### Shipping_quote
| Method | Path | Description |
|--------|------|-------------|
| POST | /shipping_quote | 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.Note: The Logistics API only supports USPS shipping rates and labels.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 createFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. |
| GET | /shipping_quote/{shippingQuoteId} | 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. |

## Common Questions
Match user requests to endpoints in references/api-spec.lap. Key patterns:
- "Create a cancel?" -> POST /shipment/{shipmentId}/cancel
- "Create a create_from_shipping_quote?" -> POST /shipment/create_from_shipping_quote
- "List all download_label_file?" -> GET /shipment/{shipmentId}/download_label_file
- "Get shipment details?" -> GET /shipment/{shipmentId}
- "Create a shipping_quote?" -> POST /shipping_quote
- "Get shipping_quote details?" -> GET /shipping_quote/{shippingQuoteId}
- "How to authenticate?" -> See Auth section above

## Response Tips
- Check response schemas in references/api-spec.lap for field details
- Create/update endpoints return the modified resource on success
- Error responses include status codes and descriptions in the spec

## References
- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas

> Generated from the official API spec by [LAP](https://lap.sh)
