Skip to main content

POST/package

Important! This method is only available for Greater-China based sellers with an active eDIS account.


This method can be used to create a package for an order.

To create a package, the package's shipping information, such as the dimensions, weight, ship from, and ship to address, as well as information about the item(s) it contains must be specified in the request.

If the call is successful, the packageId and tracking number for the newly created package will be returned.

Note: Sellers should keep track of the returned packageId, as there is no programmatic way to retrieve this value at this time.

Input

Resource URI

POST https://api.ebay.com/sell/edelivery_international_shipping/v1/package

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.

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/scope/sell.edelivery

See OAuth access tokens for more information.

Request payload

Copy complete valid JSON to clipboard
{ /* AddPackageRequest */
"packageInfo" :
{ /* PackageInfoRequest */ }
}

Request fields

Input container/fieldTypeDescription
packageInfoPackageInfoRequest

This container is used to specify the information needed to create a package.

Occurrence: Required

packageInfo.agentInfoRequestAgentInfoData

This container specifies the EU AR agent information associated with the package.

This information can be retrieved using the getAgents method.

Occurrence: Optional

packageInfo.agentInfoRequest.agentAddressstring

The address of the EU AR agent.

Occurrence: Optional

packageInfo.agentInfoRequest.agentNamestring

The name of the EU AR agent.

Occurrence: Optional

packageInfo.agentInfoRequest.agentPhonestring

The phone number of the EU AR agent.

Occurrence: Optional

packageInfo.consignPreferenceIdstring

The unique identifier of the consign address to be associated with the package.

This ID can be retrieved using the getConsignPreferences method.

Occurrence: Required

packageInfo.incotermIncotermEnum

The incoterm information associated with the package.

Supported values:

  • DDP
  • DDU

Occurrence: Optional

packageInfo.itemsarray of ItemRequest

This array is used to specify applicable information about the eBay line item(s) that will be included in the package.

Occurrence: Required

packageInfo.items.buyerIdstring

The buyer's eBay user ID.

Occurrence: Optional

packageInfo.items.buyerTaxIdstring

The tax ID for the buyer. The type of Tax ID is specified in the buyerTaxIdType field.

Occurrence: Optional

packageInfo.items.buyerTaxTypestring

The type of tax ID that was supplied by the buyer during the checkout process.

Occurrence: Optional

packageInfo.items.ebayCollectAndRemitTaxboolean

This boolean indicates if the corresponding line item is subject to a 'Collect and Remit' tax that eBay will collect and remit to the proper taxing authority on the buyer's behalf.

Occurrence: Optional

packageInfo.items.ebayCollectAndRemitTaxesValuestring

The value of the 'Collect and Remit' tax for the order that the line item belongs to.

Occurrence: Optional

packageInfo.items.emailstring

The buyer's email address.

Occurrence: Optional

packageInfo.items.itemTitlestring

The title of the listing.

Occurrence: Optional

packageInfo.items.listingIdstring

The unique identifier of the eBay listing.

Note: Either a listingId and transactionId pair, or an orderLineItem field is required to identify an order line item.

Occurrence: Conditional

packageInfo.items.messagestring

A message from the seller to the buyer.

Occurrence: Optional

packageInfo.items.orderIdstring

The unique identifier of the eBay order that the line item belongs to.

Occurrence: Required

packageInfo.items.orderLineItemstring

The unique identifier of the line item.

Note: Either a listingId and transactionId pair, or an orderLineItem field is required to identify an order line item.

Occurrence: Conditional

packageInfo.items.paymentDatestring

The date and time the buyer pays for the order.

Format: YYYY-MM-DDTHH:MM:SS.SSSZ

Occurrence: Optional

packageInfo.items.payPalEmailstring

The buyer's PayPal email address.

Occurrence: Optional

packageInfo.items.payPalMessagestring

The buyer's PayPal message.

Occurrence: Optional

packageInfo.items.postedQuantityinteger

The quantity of the line item that will be shipped with the package. This value can differ from the order quantity in the case of a combined or split shipment.

Min: 1

Max: 999

Occurrence: Required

packageInfo.items.siteIdinteger

The unique identifier of the eBay site in which the order occurred.

Occurrence: Optional

packageInfo.items.skuSkuRequest

This container specifies information relating to the item being shipped in the package.

Occurrence: Optional

packageInfo.items.sku.elecQualificationIdstring

The unique identifier of the battery's electric qualification, which indicates that the battery has a certificate of approval for global shipping.

This value is returned in the getBatteryQualifications method.

Occurrence: Optional

packageInfo.items.sku.fdcSkusarray of FDCSkuRequest

This array lists the FDC SKUs associated with the item. An FDC SKU is the SKU label in a forward deployment center.

Important! Please contact customer service before using these fields.

Occurrence: Optional

packageInfo.items.sku.fdcSkus.quantityinteger

The quantity of the FDC SKU.

Occurrence: Optional

packageInfo.items.sku.fdcSkus.skuIdstring

The unique identifier of the FDC SKU.

Occurrence: Optional

packageInfo.items.sku.heightnumber

The height of the item in centimeters.

Occurrence: Optional

packageInfo.items.sku.isLiBatteryboolean

This boolean indicates if the item contains a battery.

Occurrence: Optional

packageInfo.items.sku.lengthnumber

The length of the item in centimeters.

Occurrence: Optional

packageInfo.items.sku.liBatteryTypeLiBatteryTypeEnum

If the item contains a battery, this field indicates the type of battery the item contains.

Occurrence: Required

packageInfo.items.sku.nameEnstring

The English name of the item.

Occurrence: Required

packageInfo.items.sku.nameZhstring

The Chinese name of the item.

Occurrence: Required

packageInfo.items.sku.originstring

The country of origin of the item.

Occurrence: Optional

packageInfo.items.sku.priceAmount

The declared price of the item.

Occurrence: Optional

packageInfo.items.sku.price.currencyCurrencyCodeEnum

This enum value represents the type of currency being used. Both the value and currency fields are required/always returned when expressing cost.

See the CurrencyCodeEnum type for the full list of supported values.

Both the value and currency fields are required/always returned when expressing cost.

Occurrence: Optional

packageInfo.items.sku.price.valuestring

The monetary amount, in the currency specified by the currency field.

Both the value and currency fields are required/always returned when expressing cost.

Occurrence: Optional

packageInfo.items.sku.remarkstring

A remark to the seller themselves.

Occurrence: Optional

packageInfo.items.sku.skuNumberstring

The stock keeping unit (SKU) identifier of the item.

Occurrence: Optional

packageInfo.items.sku.tariffCodestring

The Harmonized System code for custom declaration. This value declares the category of the item..

Occurrence: Optional

packageInfo.items.sku.weightnumber

The weight of the item in grams.

Occurrence: Required

packageInfo.items.sku.widthnumber

The width of the item in centimeters.

Occurrence: Optional

packageInfo.items.soldDatestring

The date the item was sold.

Format: YYYY-MM-DDTHH:MM:SS.SSSZ

Occurrence: Required

packageInfo.items.soldPriceAmount

The price for which the item was sold.

Occurrence: Required

packageInfo.items.soldPrice.currencyCurrencyCodeEnum

This enum value represents the type of currency being used. Both the value and currency fields are required/always returned when expressing cost.

See the CurrencyCodeEnum type for the full list of supported values.

Both the value and currency fields are required/always returned when expressing cost.

Occurrence: Optional

packageInfo.items.soldPrice.valuestring

The monetary amount, in the currency specified by the currency field.

Both the value and currency fields are required/always returned when expressing cost.

Occurrence: Optional

packageInfo.items.soldQuantityinteger

The quantity of the line item that was sold.

Occurrence: Required

packageInfo.items.transactionIdstring

The unique identifier of the monetary transaction.

Note: Either a listingId and transactionId pair, or an orderLineItem field is required to identify an order line item.

Occurrence: Conditional

packageInfo.maxQuantityLimitinteger

This field is used to limit the maximum number of parcels used in a single order. If the order has more than one parcel, revise this value to increase the limit.

Occurrence: Optional

packageInfo.packageCommentstring

A seller-defined comment about the package.

Occurrence: Optional

packageInfo.packageHeightnumber

The height of the package in centimeters.

Occurrence: Required

packageInfo.packageLengthnumber

The length of the package in centimeters.

Occurrence: Required

packageInfo.packageWeightnumber

The weight of the package in grams.

Occurrence: Required

packageInfo.packageWidthnumber

The width of the package in centimeters.

Occurrence: Required

packageInfo.shipFromAddressIdstring

The unique identifier of the ship-from address used for the package.

Use the getAddressPreferences method to retrieve valid ship-from addressId values associated with your account.

Occurrence: Required

packageInfo.shippingServiceIdstring

The unique identifier of the shipping service being used for the package.

This value can be retrieved using the getServices method.

Occurrence: Required

packageInfo.shipToAddressShipToAddressRequestData

This container specifies the address details of the address ship-to address.

Occurrence: Required

packageInfo.shipToAddress.citystring

The city code of the ship-to address.

See 商户API地址编码主数据 for valid city codes.

Occurrence: Conditional

packageInfo.shipToAddress.companystring

The name of the company associated with the ship-to address.

Occurrence: Conditional

packageInfo.shipToAddress.contactstring

The name of the contact person associated with the the ship-to address.

Occurrence: Conditional

packageInfo.shipToAddress.countryCodestring

The two-letter country code of the ship-to address.

Occurrence: Conditional

packageInfo.shipToAddress.countryNamestring

The country name of the ship-to address.

Occurrence: Conditional

packageInfo.shipToAddress.districtstring

The district code of the ship-to address.

See 商户API地址编码主数据 for valid district codes.

Occurrence: Conditional

packageInfo.shipToAddress.phonestring

The phone number associated with the ship-to address.

Occurrence: Conditional

packageInfo.shipToAddress.postcodestring

The postal code of the ship-to address.

Occurrence: Conditional

packageInfo.shipToAddress.provincestring

The province code of the ship-to address.

See 商户API地址编码主数据 for valid province codes.

Occurrence: Conditional

packageInfo.shipToAddress.street1string

The first line of the street address of the ship-to address.

Max length: 50 characters

Occurrence: Conditional

packageInfo.shipToAddress.street2string

The second line, if applicable, of the street address of the ship-to address.

Max length: 50 characters

Occurrence: Optional

packageInfo.shipToAddress.street3string

The third line, if applicable, of the street address of the ship-to address.

Max length: 50 characters

Occurrence: Optional

packageInfo.specialServiceDetailSpecialServiceDetail

This container specifies any special service details about the package, such as any insurance fee, required signatures, or delivery exceptions.

Occurrence: Optional

packageInfo.specialServiceDetail.insuranceFeestring

The insurance fee, if applicable, on the package.

The insurance amount and currency are consistent with the currency of the destination country

Occurrence: Optional

packageInfo.specialServiceDetail.packagingTypestring

The package type.

Valid values:

  • PAK (limited weight ≤ 2.5KG)
  • PACKAGE (limited weight 68KG)

Occurrence: Optional

packageInfo.specialServiceDetail.signatureTypestring

The signature type, if applicable, for the package.

Valid values:

  • ISR (Indirect Signature Required)
  • DSR (Direct Signature Required)
  • ASR (Adult Signature Required)

Occurrence: Optional

packageInfo.specialServiceDetail.specialServiceTypesarray of string

Any special service types supported for the package.

For example, SATURDAY_DELIVERY indicates that the item is eligible for Saturday delivery.

Occurrence: Optional

packageInfo.valueForCarriagestring

The declared value of a large carriage (a combination of several orders together).

Occurrence: Optional

Output

HTTP response headers

This call has no response headers.

Response payload

Response fields

Output container/fieldTypeDescription
createPackageResultAddPackageResponsesData

This container returns information about the newly created package, including its tracking number and packageId value.

Occurrence: Always

createPackageResult.estimateCostAmount

The estimated shipping cost of the package.

Occurrence: Always

createPackageResult.estimateCost.currencyCurrencyCodeEnum

This enum value represents the type of currency being used. Both the value and currency fields are required/always returned when expressing cost.

See the CurrencyCodeEnum type for the full list of supported values.

Both the value and currency fields are required/always returned when expressing cost.

Occurrence: Conditional

createPackageResult.estimateCost.valuestring

The monetary amount, in the currency specified by the currency field.

Both the value and currency fields are required/always returned when expressing cost.

Occurrence: Conditional

createPackageResult.lastMileTrackingNumberstring

The last-mile tracking number of the package.

This field is only returned if the last-mile tracking number is provided by the carrier.

Occurrence: Conditional

createPackageResult.packageIdstring

The unique identifier of the created package.

Note: Sellers should keep track of the returned packageId, as there is no programmatic way to retrieve this value at this time.

Occurrence: Always

createPackageResult.paymentCostAmount

The actual payment cost of the package.

Occurrence: Conditional

createPackageResult.paymentCost.currencyCurrencyCodeEnum

This enum value represents the type of currency being used. Both the value and currency fields are required/always returned when expressing cost.

See the CurrencyCodeEnum type for the full list of supported values.

Both the value and currency fields are required/always returned when expressing cost.

Occurrence: Conditional

createPackageResult.paymentCost.valuestring

The monetary amount, in the currency specified by the currency field.

Both the value and currency fields are required/always returned when expressing cost.

Occurrence: Conditional

createPackageResult.trackingNumberstring

The tracking number of the created package.

Occurrence: Always

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
401Unauthorized
500Internal Server Error

Error codes

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

CodeDomainCategoryMeaning
355000API_EDISAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay developer support for assistance.
355003API_EDISREQUESTOur current system setting is not allowing you to add packages via API. Please change your settings to ‘ship via API’ and try again.
355005API_EDISREQUESTOrderLineItem {orderLineItemId} has already been assigned to another package, so cannot be added to this one.
355008API_EDISREQUESTOrderLineItem is not matched to your ebayID. Please check.
355009API_EDISREQUESTOrder not synced to system yet. Please wait and retry.
355011API_EDISREQUESTOrder has not been paid. Please check.
355012API_EDISREQUESTServiceId does not exist. Please check the document.
355013API_EDISREQUESTThe fdcSkus array cannot be empty. Please include this array and add at least one sku and associated quantity for that sku.
355014API_EDISREQUESTYou have exceeded the maximum amount of skus allowed under the fdcSkus array.
355015API_EDISREQUESTEach sku under fdcSkus array requires skuId and quantity. Please revise them.
355016API_EDISREQUESTThe skus array has one or more duplicate skuId values. Please remove duplicate skus.
355017API_EDISREQUESTLength of skuId can not be greater than 50. Please revise it.
355018API_EDISREQUESTThe SPECIAL_GOODS_WITH_NO_BATTERY enum value is only allowed when miniPackage is specified as the packagingType value.
355019API_EDISREQUESTUser T&C update. Please sign the updated version of the Letter of Commitment for Lithium Battery items.
355020API_EDISREQUESTYour elecQualificationId does not exist. Please check your qualification list.
355021API_EDISREQUESTThe status of elecQualificationId is not avaliable. Please check.
355022API_EDISREQUESTYour elecQualificationId is expired. Please update a new one.
355023API_EDISREQUESTLiBatteryType is not matched to battery qualification.
355024API_EDISREQUESTNo available shipping service found. Please revise package information and retry.
355025API_EDISREQUESTServiceId not available. Please revise it and retry.
355026API_EDISREQUESTPackage is now under processing. Please retry later.
355030API_EDISREQUESTThe seller's balance could not be accessed to to pay for the package. Please contact logistics customer service for help.
355031API_EDISREQUESTAccount balance is not enough to pay for the package. Please add sufficient funds to balance and try again.
355063API_EDISREQUESTAgentName or agentAddress is missing. Please revise them.
355066API_EDISAPPLICATIONConcurrent actions on same orderLineItem. Please wait and retry.
355400API_EDISREQUESTThe access token provided in the Authorization header is not for an eBay user account that is currently allowed to call this API. Please go to account settings to add to your account list.

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: Create a package

This method can be used to create a package for an order. Once a package has been created, the tracking number and package ID value will be returned in the response.

Input

To use this method, the following information must be provided in the request payload: agent information (agentInfoRequest), the consignPreferenceId, the shipFromAddressID, the shipToAddress, information about the items in the package (items),and package dimensions.

POSThttps://api.ebay.com/sell/edelivery_international_shipping/v1/package

Output

If the call is successful, HTTPS result code 201 Created will be returned, along with the tracking number and packageId value for the newly created package.