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
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 clipboardRequest fields
Input container/field | Type | Description |
---|---|---|
packageInfo | PackageInfoRequest | This container is used to specify the information needed to create a package. Occurrence: Required |
packageInfo.agentInfoRequest | AgentInfoData | This container specifies the EU AR agent information associated with the package. Occurrence: Optional |
packageInfo.agentInfoRequest.agentAddress | string | The address of the EU AR agent. Occurrence: Optional |
packageInfo.agentInfoRequest.agentName | string | The name of the EU AR agent. Occurrence: Optional |
packageInfo.agentInfoRequest.agentPhone | string | The phone number of the EU AR agent. Occurrence: Optional |
packageInfo.consignPreferenceId | string | The unique identifier of the consign address to be associated with the package. Occurrence: Required |
packageInfo.incoterm | IncotermEnum | The incoterm information associated with the package.
Occurrence: Optional |
packageInfo.items | array 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.buyerId | string | The buyer's eBay user ID. Occurrence: Optional |
packageInfo.items.buyerTaxId | string | The tax ID for the buyer. The type of Tax ID is specified in the buyerTaxIdType field. Occurrence: Optional |
packageInfo.items.buyerTaxType | string | The type of tax ID that was supplied by the buyer during the checkout process. Occurrence: Optional |
packageInfo.items.ebayCollectAndRemitTax | boolean | 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.ebayCollectAndRemitTaxesValue | string | The value of the 'Collect and Remit' tax for the order that the line item belongs to. Occurrence: Optional |
packageInfo.items.email | string | The buyer's email address. Occurrence: Optional |
packageInfo.items.itemTitle | string | The title of the listing. Occurrence: Optional |
packageInfo.items.listingId | string | The unique identifier of the eBay listing. Occurrence: Conditional |
packageInfo.items.message | string | A message from the seller to the buyer. Occurrence: Optional |
packageInfo.items.orderId | string | The unique identifier of the eBay order that the line item belongs to. Occurrence: Required |
packageInfo.items.orderLineItem | string | The unique identifier of the line item. Occurrence: Conditional |
packageInfo.items.paymentDate | string | The date and time the buyer pays for the order. Occurrence: Optional |
packageInfo.items.payPalEmail | string | The buyer's PayPal email address. Occurrence: Optional |
packageInfo.items.payPalMessage | string | The buyer's PayPal message. Occurrence: Optional |
packageInfo.items.postedQuantity | integer | 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. Occurrence: Required |
packageInfo.items.siteId | integer | The unique identifier of the eBay site in which the order occurred. Occurrence: Optional |
packageInfo.items.sku | SkuRequest | This container specifies information relating to the item being shipped in the package. Occurrence: Optional |
packageInfo.items.sku.elecQualificationId | string | The unique identifier of the battery's electric qualification, which indicates that the battery has a certificate of approval for global shipping. Occurrence: Optional |
packageInfo.items.sku.fdcSkus | array 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.quantity | integer | The quantity of the FDC SKU. Occurrence: Optional |
packageInfo.items.sku.fdcSkus.skuId | string | The unique identifier of the FDC SKU. Occurrence: Optional |
packageInfo.items.sku.height | number | The height of the item in centimeters. Occurrence: Optional |
packageInfo.items.sku.isLiBattery | boolean | This boolean indicates if the item contains a battery. Occurrence: Optional |
packageInfo.items.sku.length | number | The length of the item in centimeters. Occurrence: Optional |
packageInfo.items.sku.liBatteryType | LiBatteryTypeEnum | If the item contains a battery, this field indicates the type of battery the item contains. Occurrence: Required |
packageInfo.items.sku.nameEn | string | The English name of the item. Occurrence: Required |
packageInfo.items.sku.nameZh | string | The Chinese name of the item. Occurrence: Required |
packageInfo.items.sku.origin | string | The country of origin of the item. Occurrence: Optional |
packageInfo.items.sku.price | Amount | The declared price of the item. Occurrence: Optional |
packageInfo.items.sku.price.currency | CurrencyCodeEnum | This enum value represents the type of currency being used. Both the value and currency fields are required/always returned when expressing cost. Occurrence: Optional |
packageInfo.items.sku.price.value | string | The monetary amount, in the currency specified by the currency field. Occurrence: Optional |
packageInfo.items.sku.remark | string | A remark to the seller themselves. Occurrence: Optional |
packageInfo.items.sku.skuNumber | string | The stock keeping unit (SKU) identifier of the item. Occurrence: Optional |
packageInfo.items.sku.tariffCode | string | The Harmonized System code for custom declaration. This value declares the category of the item.. Occurrence: Optional |
packageInfo.items.sku.weight | number | The weight of the item in grams. Occurrence: Required |
packageInfo.items.sku.width | number | The width of the item in centimeters. Occurrence: Optional |
packageInfo.items.soldDate | string | The date the item was sold. Occurrence: Required |
packageInfo.items.soldPrice | Amount | The price for which the item was sold. Occurrence: Required |
packageInfo.items.soldPrice.currency | CurrencyCodeEnum | This enum value represents the type of currency being used. Both the value and currency fields are required/always returned when expressing cost. Occurrence: Optional |
packageInfo.items.soldPrice.value | string | The monetary amount, in the currency specified by the currency field. Occurrence: Optional |
packageInfo.items.soldQuantity | integer | The quantity of the line item that was sold. Occurrence: Required |
packageInfo.items.transactionId | string | The unique identifier of the monetary transaction. Occurrence: Conditional |
packageInfo.maxQuantityLimit | integer | 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.packageComment | string | A seller-defined comment about the package. Occurrence: Optional |
packageInfo.packageHeight | number | The height of the package in centimeters. Occurrence: Required |
packageInfo.packageLength | number | The length of the package in centimeters. Occurrence: Required |
packageInfo.packageWeight | number | The weight of the package in grams. Occurrence: Required |
packageInfo.packageWidth | number | The width of the package in centimeters. Occurrence: Required |
packageInfo.shipFromAddressId | string | The unique identifier of the ship-from address used for the package. Occurrence: Required |
packageInfo.shippingServiceId | string | The unique identifier of the shipping service being used for the package. Occurrence: Required |
packageInfo.shipToAddress | ShipToAddressRequestData | This container specifies the address details of the address ship-to address. Occurrence: Required |
packageInfo.shipToAddress.city | string | The city code of the ship-to address. Occurrence: Conditional |
packageInfo.shipToAddress.company | string | The name of the company associated with the ship-to address. Occurrence: Conditional |
packageInfo.shipToAddress.contact | string | The name of the contact person associated with the the ship-to address. Occurrence: Conditional |
packageInfo.shipToAddress.countryCode | string | The two-letter country code of the ship-to address. Occurrence: Conditional |
packageInfo.shipToAddress.countryName | string | The country name of the ship-to address. Occurrence: Conditional |
packageInfo.shipToAddress.district | string | The district code of the ship-to address. Occurrence: Conditional |
packageInfo.shipToAddress.phone | string | The phone number associated with the ship-to address. Occurrence: Conditional |
packageInfo.shipToAddress.postcode | string | The postal code of the ship-to address. Occurrence: Conditional |
packageInfo.shipToAddress.province | string | The province code of the ship-to address. Occurrence: Conditional |
packageInfo.shipToAddress.street1 | string | The first line of the street address of the ship-to address. Occurrence: Conditional |
packageInfo.shipToAddress.street2 | string | The second line, if applicable, of the street address of the ship-to address. Occurrence: Optional |
packageInfo.shipToAddress.street3 | string | The third line, if applicable, of the street address of the ship-to address. Occurrence: Optional |
packageInfo.specialServiceDetail | SpecialServiceDetail | This container specifies any special service details about the package, such as any insurance fee, required signatures, or delivery exceptions. Occurrence: Optional |
packageInfo.specialServiceDetail.insuranceFee | string | The insurance fee, if applicable, on the package. Occurrence: Optional |
packageInfo.specialServiceDetail.packagingType | string | The package type.
Occurrence: Optional |
packageInfo.specialServiceDetail.signatureType | string | The signature type, if applicable, for the package.
Occurrence: Optional |
packageInfo.specialServiceDetail.specialServiceTypes | array of string | Any special service types supported for the package. Occurrence: Optional |
packageInfo.valueForCarriage | string | 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/field | Type | Description |
---|---|---|
createPackageResult | AddPackageResponsesData | This container returns information about the newly created package, including its tracking number and packageId value. Occurrence: Always |
createPackageResult.estimateCost | Amount | The estimated shipping cost of the package. Occurrence: Always |
createPackageResult.estimateCost.currency | CurrencyCodeEnum | This enum value represents the type of currency being used. Both the value and currency fields are required/always returned when expressing cost. Occurrence: Conditional |
createPackageResult.estimateCost.value | string | The monetary amount, in the currency specified by the currency field. Occurrence: Conditional |
createPackageResult.lastMileTrackingNumber | string | The last-mile tracking number of the package. Occurrence: Conditional |
createPackageResult.packageId | string | The unique identifier of the created package. Occurrence: Always |
createPackageResult.paymentCost | Amount | The actual payment cost of the package. Occurrence: Conditional |
createPackageResult.paymentCost.currency | CurrencyCodeEnum | This enum value represents the type of currency being used. Both the value and currency fields are required/always returned when expressing cost. Occurrence: Conditional |
createPackageResult.paymentCost.value | string | The monetary amount, in the currency specified by the currency field. Occurrence: Conditional |
createPackageResult.trackingNumber | string | 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.
Status | Meaning |
---|---|
201 | Created |
400 | Bad Request |
401 | Unauthorized |
500 | Internal Server Error |
Error codes
For more on errors, plus the codes of other common errors, see Handling errors.
Code | Domain | Category | Meaning |
---|---|---|---|
355000 | API_EDIS | APPLICATION | There was a problem with an eBay internal system or process. Contact eBay developer support for assistance. |
355003 | API_EDIS | REQUEST | Our current system setting is not allowing you to add packages via API. Please change your settings to ‘ship via API’ and try again. |
355005 | API_EDIS | REQUEST | OrderLineItem {orderLineItemId} has already been assigned to another package, so cannot be added to this one. |
355008 | API_EDIS | REQUEST | OrderLineItem is not matched to your ebayID. Please check. |
355009 | API_EDIS | REQUEST | Order not synced to system yet. Please wait and retry. |
355011 | API_EDIS | REQUEST | Order has not been paid. Please check. |
355012 | API_EDIS | REQUEST | ServiceId does not exist. Please check the document. |
355013 | API_EDIS | REQUEST | The fdcSkus array cannot be empty. Please include this array and add at least one sku and associated quantity for that sku. |
355014 | API_EDIS | REQUEST | You have exceeded the maximum amount of skus allowed under the fdcSkus array. |
355015 | API_EDIS | REQUEST | Each sku under fdcSkus array requires skuId and quantity. Please revise them. |
355016 | API_EDIS | REQUEST | The skus array has one or more duplicate skuId values. Please remove duplicate skus. |
355017 | API_EDIS | REQUEST | Length of skuId can not be greater than 50. Please revise it. |
355018 | API_EDIS | REQUEST | The SPECIAL_GOODS_WITH_NO_BATTERY enum value is only allowed when miniPackage is specified as the packagingType value. |
355019 | API_EDIS | REQUEST | User T&C update. Please sign the updated version of the Letter of Commitment for Lithium Battery items. |
355020 | API_EDIS | REQUEST | Your elecQualificationId does not exist. Please check your qualification list. |
355021 | API_EDIS | REQUEST | The status of elecQualificationId is not avaliable. Please check. |
355022 | API_EDIS | REQUEST | Your elecQualificationId is expired. Please update a new one. |
355023 | API_EDIS | REQUEST | LiBatteryType is not matched to battery qualification. |
355024 | API_EDIS | REQUEST | No available shipping service found. Please revise package information and retry. |
355025 | API_EDIS | REQUEST | ServiceId not available. Please revise it and retry. |
355026 | API_EDIS | REQUEST | Package is now under processing. Please retry later. |
355030 | API_EDIS | REQUEST | The seller's balance could not be accessed to to pay for the package. Please contact logistics customer service for help. |
355031 | API_EDIS | REQUEST | Account balance is not enough to pay for the package. Please add sufficient funds to balance and try again. |
355063 | API_EDIS | REQUEST | AgentName or agentAddress is missing. Please revise them. |
355066 | API_EDIS | APPLICATION | Concurrent actions on same orderLineItem. Please wait and retry. |
355400 | API_EDIS | REQUEST | The 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.