logistics APIv1_beta.0.0

createShippingQuote

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.

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.

Input

Resource URI (production)

POST https://api.ebay.com/sell/logistics/v1_beta/shipping_quote

URI parameters

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

OAuth scope

This request requires an access token created with the authorization code grant flow, using one scope from the following list:

https://api.ebay.com/oauth/api_scope/sell.logistics

See OAuth access tokens for more information.

Input container/fieldTypeDescription
ordersarray of OrderA seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information.

A package can contain any number of line items from one or more orders, providing they all ship in the same package.

Maximum list size: 10

Occurrence: Optional

orders.channelstringThe e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders.

Occurrence: Optional

orders.orderIdstringThe unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId.

Occurrence: Optional

packageSpecificationPackageSpecificationDeclares the weight and dimensions of the package.

Occurrence: Required

packageSpecification.dimensionsDimensionsDeclares the height, length, width, and unit of measure for the package to be shipped.

Occurrence: Optional

packageSpecification.dimensions.heightstringThe numeric value of the height of the package.

Occurrence: Optional

packageSpecification.dimensions.lengthstringThe numeric value of the length of the package.

Occurrence: Optional

packageSpecification.dimensions.unitLengthUnitOfMeasureEnumThe unit of measure used to express the height, length, and width of the package.

Occurrence: Optional

packageSpecification.dimensions.widthstringThe numeric value of the width of the package.

Occurrence: Optional

packageSpecification.weightWeightDeclares the weight of the package.

Occurrence: Optional

packageSpecification.weight.unitWeightUnitOfMeasureEnumThe unit of measure used to express the weight of the package.

Occurrence: Optional

packageSpecification.weight.valuestringThe numeric value of the weight of the package, as measured by the value of unit.

Occurrence: Optional

shipFromContactThe address and contact details pertaining to the origin of the shipment.

Occurrence: Required

shipFrom.companyNamestringThe company name with which the contact is associated.

Occurrence: Optional

shipFrom.contactAddressContactAddressThe details of the contact's geographical address.

Occurrence: Required

shipFrom.contactAddress.addressLine1stringThe first line of the street address.

Occurrence: Required

shipFrom.contactAddress.addressLine2stringThe second line of the street address. Use this field for additional address information, such as a suite or apartment number.

Occurrence: Optional

shipFrom.contactAddress.citystringThe city in which the address is located.

Occurrence: Optional

shipFrom.contactAddress.countryCodeCountryCodeEnumThe country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany.

Occurrence: Required

shipFrom.contactAddress.countystringThe county (not country) in which the address is located. Counties typically contain multiple cities or towns.

Occurrence: Required

shipFrom.contactAddress.postalCodestringThe postal code of the address.

Occurrence: Required

shipFrom.contactAddress.stateOrProvincestringThe state or province in which the address is located. States and provinces often contain multiple counties.

Occurrence: Optional

shipFrom.fullNamestringThe contact's full name.

Occurrence: Required

shipFrom.primaryPhonePhoneNumberThe contact's primary telephone number.

Occurrence: Optional

shipFrom.primaryPhone.phoneNumberstringA telephone number.

Occurrence: Required

shipToContactThe address and contact details pertaining to the shipment's destination.

Occurrence: Required

shipTo.companyNamestringThe company name with which the contact is associated.

Occurrence: Optional

shipTo.contactAddressContactAddressThe details of the contact's geographical address.

Occurrence: Required

shipTo.contactAddress.addressLine1stringThe first line of the street address.

Occurrence: Required

shipTo.contactAddress.addressLine2stringThe second line of the street address. Use this field for additional address information, such as a suite or apartment number.

Occurrence: Optional

shipTo.contactAddress.citystringThe city in which the address is located.

Occurrence: Optional

shipTo.contactAddress.countryCodeCountryCodeEnumThe country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany.

Occurrence: Required

shipTo.contactAddress.countystringThe county (not country) in which the address is located. Counties typically contain multiple cities or towns.

Occurrence: Required

shipTo.contactAddress.postalCodestringThe postal code of the address.

Occurrence: Required

shipTo.contactAddress.stateOrProvincestringThe state or province in which the address is located. States and provinces often contain multiple counties.

Occurrence: Optional

shipTo.fullNamestringThe contact's full name.

Occurrence: Required

shipTo.primaryPhonePhoneNumberThe contact's primary telephone number.

Occurrence: Optional

shipTo.primaryPhone.phoneNumberstringA telephone number.

Occurrence: Required

Output

HTTP response headers

{ /* ShippingQuote */
"orders" : [
{ /* Order */ }
],
}
Output container/fieldTypeDescription
creationDatestringThe date and time this quote was created, expressed as an ISO 8601 UTC string.

Occurrence: Conditional

expirationDatestringThe last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased.

Occurrence: Conditional

ordersarray of OrderThis list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders.

Occurrence: Conditional

orders.channelstringThe e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders.

Occurrence: Conditional

orders.orderIdstringThe unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId.

Occurrence: Conditional

packageSpecificationPackageSpecificationThe weight and dimensions of the package covered by this shipping quote.

Occurrence: Conditional

packageSpecification.dimensionsDimensionsDeclares the height, length, width, and unit of measure for the package to be shipped.

Occurrence: Conditional

packageSpecification.dimensions.heightstringThe numeric value of the height of the package.

Occurrence: Conditional

packageSpecification.dimensions.lengthstringThe numeric value of the length of the package.

Occurrence: Conditional

packageSpecification.dimensions.unitLengthUnitOfMeasureEnumThe unit of measure used to express the height, length, and width of the package.

Occurrence: Conditional

packageSpecification.dimensions.widthstringThe numeric value of the width of the package.

Occurrence: Conditional

packageSpecification.weightWeightDeclares the weight of the package.

Occurrence: Conditional

packageSpecification.weight.unitWeightUnitOfMeasureEnumThe unit of measure used to express the weight of the package.

Occurrence: Conditional

packageSpecification.weight.valuestringThe numeric value of the weight of the package, as measured by the value of unit.

Occurrence: Conditional

ratesarray of RateA list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options.

Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote.

Occurrence: Conditional

rates.additionalOptionsarray of AdditionalOptionContains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE.

Occurrence: Conditional

rates.additionalOptions.additionalCostAmountThe monetary cost of the additional shipping option identified by the optionType field.

Occurrence: Conditional

rates.additionalOptions.additionalCost.currencyCurrencyCodeEnumThe base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD.

Occurrence: Conditional

rates.additionalOptions.additionalCost.valuestringThe value of the monetary amount in the specified currency.

Occurrence: Conditional

rates.additionalOptions.optionTypestringThe name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate.

Occurrence: Conditional

rates.baseShippingCostAmountA live quote for the cost that the carrier (identified by shippingCarrierCode) is charging for the shipping service being offered (identified by shippingServiceCode), excluding any additional shipping options.

Occurrence: Conditional

rates.baseShippingCost.currencyCurrencyCodeEnumThe base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD.

Occurrence: Conditional

rates.baseShippingCost.valuestringThe value of the monetary amount in the specified currency.

Occurrence: Conditional

rates.destinationTimeZonestringThe name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped.

Delivery dates are calculated relative to this time zone.

Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn.

Occurrence: Conditional

rates.maxEstimatedDeliveryDatestringThe latest stated date and time the shipment will be delivered at this rate.

The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock.

Format: YYYY-MM-DDTHH:MM:SS.SSSZ
Example: 2018-08-04T07:09:00.000Z

Occurrence: Conditional

rates.minEstimatedDeliveryDatestringThe estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string.

Format: YYYY-MM-DDTHH:MM:SS.SSSZ
Example: 2018-08-06T01:00:00.000Z

Occurrence: Conditional

rates.pickupNetworksarray of stringA list of pickup networks compatible with the shipping service.

Occurrence: Conditional

rates.pickupSlotsarray of PickupSlotA list of available pickup slots for the package.

Occurrence: Conditional

rates.pickupSlots.pickupSlotEndTimestringThe date and time the pickup slot ends, formatted as an ISO 8601 UTC string.

Occurrence: Conditional

rates.pickupSlots.pickupSlotIdstringSeller-defined name for the pickup slot.

Occurrence: Conditional

rates.pickupSlots.pickupSlotStartTimestringThe date and time the pickup slot begins, formatted as an ISO 8601 UTC string.

Occurrence: Conditional

rates.pickupSlots.pickupSlotTimeZonestringThe time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID).

Occurrence: Conditional

rates.pickupTypePickupTypeEnumThe type of pickup or drop-off service associated with the pickupSlots time frames.

Occurrence: Conditional

rates.rateIdstringThe unique eBay-assigned ID for this shipping rate.

Occurrence: Conditional

rates.rateRecommendationarray of RateRecommendationEnumA list of reasons this rate is recommended. Available values are:
  • BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option.
  • CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment.
  • EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program.
  • FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment.
  • GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program.

Occurrence: Conditional

rates.shippingCarrierCodestringThe code name of the shipping carrier who will provide the service identified by shippingServiceCode.

Occurrence: Conditional

rates.shippingCarrierNamestringThe common name of the shipping carrier.

Occurrence: Conditional

rates.shippingServiceCodestringThe code name of the shipping service to be provided by the carrier identified by shippingCarrierCode.

Occurrence: Conditional

rates.shippingServiceNamestringThe common name of the shipping service.

Occurrence: Conditional

shipFromContactThe address and contact details for the origin of the shipment.

Occurrence: Conditional

shipFrom.companyNamestringThe company name with which the contact is associated.

Occurrence: Conditional

shipFrom.contactAddressContactAddressThe details of the contact's geographical address.

Occurrence: Conditional

shipFrom.contactAddress.addressLine1stringThe first line of the street address.

Occurrence: Always

shipFrom.contactAddress.addressLine2stringThe second line of the street address. Use this field for additional address information, such as a suite or apartment number.

Occurrence: Conditional

shipFrom.contactAddress.citystringThe city in which the address is located.

Occurrence: Conditional

shipFrom.contactAddress.countryCodeCountryCodeEnumThe country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany.

Occurrence: Conditional

shipFrom.contactAddress.countystringThe county (not country) in which the address is located. Counties typically contain multiple cities or towns.

Occurrence: Conditional

shipFrom.contactAddress.postalCodestringThe postal code of the address.

Occurrence: Always

shipFrom.contactAddress.stateOrProvincestringThe state or province in which the address is located. States and provinces often contain multiple counties.

Occurrence: Conditional

shipFrom.fullNamestringThe contact's full name.

Occurrence: Conditional

shipFrom.primaryPhonePhoneNumberThe contact's primary telephone number.

Occurrence: Conditional

shipFrom.primaryPhone.phoneNumberstringA telephone number.

Occurrence: Conditional

shippingQuoteIdstringThe unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size.

Occurrence: Conditional

shipToContactThe address and contact details for the origin of the shipment.

Occurrence: Conditional

shipTo.companyNamestringThe company name with which the contact is associated.

Occurrence: Conditional

shipTo.contactAddressContactAddressThe details of the contact's geographical address.

Occurrence: Conditional

shipTo.contactAddress.addressLine1stringThe first line of the street address.

Occurrence: Always

shipTo.contactAddress.addressLine2stringThe second line of the street address. Use this field for additional address information, such as a suite or apartment number.

Occurrence: Conditional

shipTo.contactAddress.citystringThe city in which the address is located.

Occurrence: Conditional

shipTo.contactAddress.countryCodeCountryCodeEnumThe country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany.

Occurrence: Conditional

shipTo.contactAddress.countystringThe county (not country) in which the address is located. Counties typically contain multiple cities or towns.

Occurrence: Conditional

shipTo.contactAddress.postalCodestringThe postal code of the address.

Occurrence: Always

shipTo.contactAddress.stateOrProvincestringThe state or province in which the address is located. States and provinces often contain multiple counties.

Occurrence: Conditional

shipTo.fullNamestringThe contact's full name.

Occurrence: Conditional

shipTo.primaryPhonePhoneNumberThe contact's primary telephone number.

Occurrence: Conditional

shipTo.primaryPhone.phoneNumberstringA telephone number.

Occurrence: Conditional

warningsarray of ErrorDetailV3A list of any warnings triggered by the request.

Occurrence: Conditional

warnings.categorystringThe category type for this error or warning. It takes a string that can have one of three values:
  • Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency.
  • Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors.
  • Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on.

Occurrence: Conditional

warnings.domainstringName of the domain containing the service or application.

Occurrence: Conditional

warnings.errorIdintegerA positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms.

Occurrence: Conditional

warnings.inputRefIdsarray of stringIdentifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation.

Occurrence: Conditional

warnings.longMessagestringAn expanded version of message that should be around 100-200 characters long, but is not required to be such.

Occurrence: Conditional

warnings.messagestringAn end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale.

Occurrence: Conditional

warnings.outputRefIdsarray of stringIdentifies specific response elements associated with the error, if any. Path format is the same as inputRefId.

Occurrence: Conditional

warnings.parametersarray of ErrorParameterV3This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value.

Occurrence: Conditional

warnings.parameters.namestringName of the entity that threw the error.

Occurrence: Conditional

warnings.parameters.valuestringA description of the error.

Occurrence: Conditional

warnings.subdomainstringName of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain.

Occurrence: NA

HTTP status codes

This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.

StatusMeaning
201Created
400Bad Request
409Conflict
500Internal Server Error

Error codes

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
90000API_LOGISTICSAPPLICATIONA system error has occurred.
90010API_LOGISTICSREQUESTMissing field {fieldName}.
90020API_LOGISTICSREQUESTInvalid field {fieldName}.
90100API_LOGISTICSREQUESTNo shipping services available for the provided addresses.
90110API_LOGISTICSREQUESTThe order {orderId} was not found on the platform.
90120API_LOGISTICSREQUESTThe package specification is incompatible with the destination.
90130API_LOGISTICSREQUESTOrder {orderId} is incompatible with our services.
90133API_LOGISTICSREQUESTMaximum number of orders exceeded. Current limitation is 10.

Samples

New to making API calls? Please see Making a Call.

Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.

Sample 1: Creating a shipping quote

This sample creates a new shipping quote for an eBay package.

Input

In the request, define the "From:" address, the "To:" address, the package size (dimensions and weight), and the order information.
POST
https://api.ebay.com/sell/logistics/v1_beta/shipping_quote

Output

A successful request returns a complete shipping quote, along with a shipping quote ID that you can use to create a "shipment," or retrieve the quote at a later time.