Skip to main content

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 shipment
  • A list of selected shipping options, if any
  • The shipment tracking number
  • The 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! 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 agreement

Prior 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.

Input

Resource URI

POST https://api.ebay.com/sell/logistics/v1_beta/shipment/create_from_shipping_quote

This method is supported in Sandbox environment. To access the endpoint, just replace the api.ebay.com root URI with api.sandbox.ebay.com

URI parameters

This method has no URI parameters.

HTTP request headers

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

The table below shows additional HTTP request headers that are either required, conditionally required, or strongly recommended for this method. Other standard HTTP request headers- opens rest request components page (not in this table) can also be used, but they are optional.

HeaderTypeDescription
Content-TypestringThis header indicates the format of the request body provided by the client. Its value should be set to application/json.

For more information, refer to HTTP request headers.

Occurrence: Required

OAuth scope

This request requires an access token created with the authorization code grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):

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

See OAuth access tokens for more information.

Request payload

Copy complete valid JSON to clipboard

Request fields

Input container/fieldTypeDescription
additionalOptionsarray of AdditionalOption

Supply a list of one or more shipping options that the seller wants to purchase for this shipment.

The baseShippingCost field that's associated with the selected shipping rate is the cost of the base service offered in the rate. In addition to the base service, sellers can add additional shipping services to the base service. Shipping options include things such as shipping insurance or a recipient's signature upon delivery. The cost of any added services is summed with the base shipping cost to determine the final cost for the shipment. All options added to the shipment must be chosen from the set of shipping options offered with the selected rate.

Occurrence: Optional

additionalOptions.additionalCostAmount

The monetary cost of the additional shipping option identified by the optionType field.

Occurrence: Optional

additionalOptions.additionalCost.currencyCurrencyCodeEnum

The base currency applied to the value field to establish a monetary amount.

The currency is represented as a 3-letter ISO 4217 currency code. For example, the code for the Canadian Dollar is CAD.

Default: The default currency of the eBay marketplace that hosts the listing.

Occurrence: Optional

additionalOptions.additionalCost.valuestring

The monetary amount in the specified currency.

Required in the amount type.

Occurrence: Conditional

additionalOptions.optionTypestring

The 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: Optional

labelCustomMessagestring

Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels.

Occurrence: Optional

labelSizestring

The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used.

Currently, the only valid value is: 4"x6"

Occurrence: Optional

rateIdstring

The unique eBay-assigned identifier of the shipping rate that the seller selected for the shipment. This value is generated by using the createShippingQuote method and is returned in the rates.rateId field.

Occurrence: Required

returnToContact

The optional return address and contact details for the shipment. The return address is printed on the shipping label. If not specified, the return address defaults to the shipFrom address returned in shipping quote.

Occurrence: Optional

returnTo.companyNamestring

The company name with which the contact is associated.

Occurrence: Optional

returnTo.contactAddressContactAddress

The details of the contact's geographical address.

Occurrence: Required

returnTo.contactAddress.addressLine1string

The first line of the street address.

Occurrence: Required

returnTo.contactAddress.addressLine2string

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

Occurrence: Optional

returnTo.contactAddress.citystring

The city in which the address is located.

Occurrence: Optional

returnTo.contactAddress.countryCodeCountryCodeEnum

The country of the address, represented as two-letter ISO 3166 country code. For example, US represents the United States and DE represents Germany.

Occurrence: Required

returnTo.contactAddress.countystring

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

Occurrence: Required

returnTo.contactAddress.postalCodestring

The postal code of the address.

Occurrence: Required

returnTo.contactAddress.stateOrProvincestring

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

Occurrence: Optional

returnTo.fullNamestring

The contact's full name.

Occurrence: Required

returnTo.primaryPhonePhoneNumber

The contact's primary telephone number.

Occurrence: Optional

returnTo.primaryPhone.phoneNumberstring

A telephone number.

Occurrence: Required

shippingQuoteIdstring

The unique eBay-assigned identifier of the shipping quote that was generated by the createShippingQuote method.

Occurrence: Required

Output

HTTP response headers

This call has no response headers.

Response payload

{ /* Shipment */
"orders" : [
{ /* Order */ }
],
}

Response fields

Output container/fieldTypeDescription
cancellationShipmentCancellation

Cancellation status for the package, if one exists.

Occurrence: Conditional

cancellation.cancellationRequestedDatestring

The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string.

Occurrence: Conditional

cancellation.cancellationStatusShipmentCancellationStatusEnum

This enum specifies the current cancellation status of a shipment, if a cancellation request has been made.

Occurrence: Conditional

creationDatestring

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

Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z
Example: 2018-08-20T07:09:00.000Z

Occurrence: Conditional

labelCustomMessagestring

If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label.

Occurrence: Conditional

labelDownloadUrlstring

The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats.

Occurrence: Conditional

labelSizestring

The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment.

Currently, the only valid value is: 4"x6"

Occurrence: Conditional

ordersarray of Order

A list of one or more orders that will be shipped in the shipping package.

Occurrence: Always

orders.channelstring

The marketplace where the order was created.

Use the value EBAY to get the rates available for eBay orders.

Occurrence: Always

orders.orderIdstring

The unique identifier of the order. The getOrders method of the Fulfillment API can be used to retrieve order IDs.

Occurrence: Always

packageSpecificationPackageSpecification

The weight and dimensions of the package.

Occurrence: Conditional

packageSpecification.dimensionsDimensions

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

Occurrence: Conditional

packageSpecification.dimensions.heightstring

The numeric value of the height of the package.

Occurrence: Conditional

packageSpecification.dimensions.lengthstring

The numeric value of the length of the package.

Occurrence: Conditional

packageSpecification.dimensions.unitLengthUnitOfMeasureEnum

The unit of measure used to express the height, length, and width of the package.

Occurrence: Conditional

packageSpecification.dimensions.widthstring

The numeric value of the width of the package.

Occurrence: Conditional

packageSpecification.weightWeight

Declares the weight of the package.

Occurrence: Conditional

packageSpecification.weight.unitWeightUnitOfMeasureEnum

The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US.

Occurrence: Conditional

packageSpecification.weight.valuestring

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

Occurrence: Conditional

ratePurchasedRate

The shipping rate that the seller has chosen to purchase for this shipment. Each rate, identified by a rateId, contains the offered base service, options, and shipping parameters that were selected for the package shipment.

Occurrence: Conditional

rate.additionalOptionsarray of AdditionalOption

An list of additional, optional features that have been purchased for the shipment.

Occurrence: Conditional

rate.additionalOptions.additionalCostAmount

The monetary cost of the additional shipping option identified by the optionType field.

Occurrence: Conditional

rate.additionalOptions.additionalCost.currencyCurrencyCodeEnum

The base currency applied to the value field to establish a monetary amount.

The currency is represented as a 3-letter ISO 4217 currency code. For example, the code for the Canadian Dollar is CAD.

Default: The default currency of the eBay marketplace that hosts the listing.

Occurrence: Conditional

rate.additionalOptions.additionalCost.valuestring

The monetary amount in the specified currency.

Required in the amount type.

Occurrence: Conditional

rate.additionalOptions.optionTypestring

The 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

rate.baseShippingCostAmount

The amount of the "base cost" for the shipment as set by the given carrier for the specified service. This cost excludes any addition costs accrued from the addition of any optional shipping options.

Occurrence: Conditional

rate.baseShippingCost.currencyCurrencyCodeEnum

The base currency applied to the value field to establish a monetary amount.

The currency is represented as a 3-letter ISO 4217 currency code. For example, the code for the Canadian Dollar is CAD.

Default: The default currency of the eBay marketplace that hosts the listing.

Occurrence: Conditional

rate.baseShippingCost.valuestring

The monetary amount in the specified currency.

Required in the amount type.

Occurrence: Conditional

rate.destinationTimeZonestring

The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles".

Occurrence: Conditional

rate.maxEstimatedDeliveryDatestring

A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock.

Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z
Example: 2018-08-20T07:09:00.000Z

Occurrence: Conditional

rate.minEstimatedDeliveryDatestring

A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601ISO 8601 UTC string.

Occurrence: Conditional

rate.pickupNetworksarray of string

A list of pickup networks compatible with the shipping service.

Occurrence: Conditional

rate.pickupSlotIdstring

This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup.

Occurrence: Conditional

rate.pickupTypePickupTypeEnum

The type of pickup or drop off configured for the shipment.

Occurrence: Conditional

rate.rateIdstring

The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment.

Occurrence: Conditional

rate.shippingCarrierCodestring

The ID code for the carrier that was selected for the package shipment.

Occurrence: Conditional

rate.shippingCarrierNamestring

The name of the shipping carrier.

Occurrence: Conditional

rate.shippingQuoteIdstring

The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId).

Occurrence: Conditional

rate.shippingServiceCodestring

String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies.

Occurrence: Conditional

rate.shippingServiceNamestring

The name of the shipping service.

Occurrence: Conditional

rate.totalShippingCostAmount

The total shipping cost, which is the sum cost of the base shipping cost and the cost of all the selected shipping options.

Occurrence: Conditional

rate.totalShippingCost.currencyCurrencyCodeEnum

The base currency applied to the value field to establish a monetary amount.

The currency is represented as a 3-letter ISO 4217 currency code. For example, the code for the Canadian Dollar is CAD.

Default: The default currency of the eBay marketplace that hosts the listing.

Occurrence: Conditional

rate.totalShippingCost.valuestring

The monetary amount in the specified currency.

Required in the amount type.

Occurrence: Conditional

returnToContact

The address and contact details that should be used for item returns. Sellers have the option to define a return address that is different from their shipFrom address. If not specified, the return address defaults to the shipFrom address in the shipping quote.

Occurrence: Conditional

returnTo.companyNamestring

The company name with which the contact is associated.

Occurrence: Conditional

returnTo.contactAddressContactAddress

The details of the contact's geographical address.

Occurrence: Conditional

returnTo.contactAddress.addressLine1string

The first line of the street address.

Occurrence: Always

returnTo.contactAddress.addressLine2string

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

Occurrence: Conditional

returnTo.contactAddress.citystring

The city in which the address is located.

Occurrence: Conditional

returnTo.contactAddress.countryCodeCountryCodeEnum

The country of the address, represented as two-letter ISO 3166 country code. For example, US represents the United States and DE represents Germany.

Occurrence: Conditional

returnTo.contactAddress.countystring

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

Occurrence: Conditional

returnTo.contactAddress.postalCodestring

The postal code of the address.

Occurrence: Always

returnTo.contactAddress.stateOrProvincestring

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

Occurrence: Conditional

returnTo.fullNamestring

The contact's full name.

Occurrence: Conditional

returnTo.primaryPhonePhoneNumber

The contact's primary telephone number.

Occurrence: Conditional

returnTo.primaryPhone.phoneNumberstring

A telephone number.

Occurrence: Conditional

shipFromContact

The address and contact details for the origin of the package shipment.

Occurrence: Conditional

shipFrom.companyNamestring

The company name with which the contact is associated.

Occurrence: Conditional

shipFrom.contactAddressContactAddress

The details of the contact's geographical address.

Occurrence: Conditional

shipFrom.contactAddress.addressLine1string

The first line of the street address.

Occurrence: Always

shipFrom.contactAddress.addressLine2string

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

Occurrence: Conditional

shipFrom.contactAddress.citystring

The city in which the address is located.

Occurrence: Conditional

shipFrom.contactAddress.countryCodeCountryCodeEnum

The country of the address, represented as two-letter ISO 3166 country code. For example, US represents the United States and DE represents Germany.

Occurrence: Conditional

shipFrom.contactAddress.countystring

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

Occurrence: Conditional

shipFrom.contactAddress.postalCodestring

The postal code of the address.

Occurrence: Always

shipFrom.contactAddress.stateOrProvincestring

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

Occurrence: Conditional

shipFrom.fullNamestring

The contact's full name.

Occurrence: Conditional

shipFrom.primaryPhonePhoneNumber

The contact's primary telephone number.

Occurrence: Conditional

shipFrom.primaryPhone.phoneNumberstring

A telephone number.

Occurrence: Conditional

shipmentIdstring

The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote.

Occurrence: Conditional

shipmentTrackingNumberstring

A unique carrier-assigned ID string that can be used to track the shipment.

Occurrence: Conditional

shipToContact

The address and contact details for the destination of the shipment.

Occurrence: Conditional

shipTo.companyNamestring

The company name with which the contact is associated.

Occurrence: Conditional

shipTo.contactAddressContactAddress

The details of the contact's geographical address.

Occurrence: Conditional

shipTo.contactAddress.addressLine1string

The first line of the street address.

Occurrence: Always

shipTo.contactAddress.addressLine2string

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

Occurrence: Conditional

shipTo.contactAddress.citystring

The city in which the address is located.

Occurrence: Conditional

shipTo.contactAddress.countryCodeCountryCodeEnum

The country of the address, represented as two-letter ISO 3166 country code. For example, US represents the United States and DE represents Germany.

Occurrence: Conditional

shipTo.contactAddress.countystring

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

Occurrence: Conditional

shipTo.contactAddress.postalCodestring

The postal code of the address.

Occurrence: Always

shipTo.contactAddress.stateOrProvincestring

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

Occurrence: Conditional

shipTo.fullNamestring

The contact's full name.

Occurrence: Conditional

shipTo.primaryPhonePhoneNumber

The contact's primary telephone number.

Occurrence: Conditional

shipTo.primaryPhone.phoneNumberstring

A telephone number.

Occurrence: Conditional

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}.
90030API_LOGISTICSREQUESTPayment could not be completed.
90200API_LOGISTICSREQUESTThe quote has expired. Please request a new quote.
90210API_LOGISTICSREQUESTThe quote has already been purchased. Please request a new quote.

Warnings

This call has no warnings.

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 shipment from a shipping quote

This sample creates a "shipment" from a shipping quote.

When you create a shipment, the base cost of the shipment, plus the cost any selected additional shipping options, is billed against your eBay account of billing agreement you have set up. The shipment includes a shipping label that you can download, print, and use to ship the package described in the original shipping quote.

Input

To create a shipment, specify the shippingQuoteId and the rateId of the rate you want to use, as returned in the original shipping quote you generated for your package. Each shipping quote has a time window within which the rates are valid, you must create a shipment for a rate within the valid time frame.

When creating a shipment, you can specify that you want to purchase additional shipping options, as they are available in the rate you are selecting. You can also specify a return address, if it is different from the "From:" address you specified in the original shipping quote.

POSThttps://api.ebay.com/sell/logistics/v1_beta/shipment/create_from_shipping_quote

Output

If the call is successful, the response contains the full details of the shipment you created, including the totalShippingCost, which is the base shipping cost listed in the selected rate, plus any added shipping options.