CompleteSale
Use this call to do various tasks after the creation of a single line item or multiple line item order.
Usage Details
Typically, this call is used after the order has been paid by the buyer, but it can be called by the seller beforehand. Typical post-payment tasks available in this call include marking the order as paid, marking the order as shipped, providing shipment tracking details, and leaving feedback for the buyer. Use GetOrders to retrieve a list of active and completed orders.
Testing CompleteSale
To test CompleteSale in the Sandbox, you must have at least two test users: one to act in the capacity of an item seller and the other as a buyer. To fully test leaving feedback from a seller's perspective, use a multi-item listing with a minimum of two winning bidders (this requires multiple buyers).
For auction listings, a buyer must have placed a bid on the item and the listing must have ended
with a purchase. Use AddItem in the Sandbox to list an item, then use a separate
user to place bids on the item. The seller can end the listing early using EndItem. If you set EndingReason to SellToHighBidder,
the call does not cancel existing bids and the listing ends as a successfully concluded auction. One
order line item is created for each winning bidder, and the seller can leave feedback for each.
For fixed-price listings, the order line item needed for feedback is created shortly after the buyer purchases the item(s) from the listing. One order line item is created for each purchase, even if purchases are made by the same buyer.
You can verify the feedback you left using GetFeedback to retrieve the feedback data for the targeted user. The feedback retrieved should contain the same scores and comments as those that you left with CompleteSale.
Input
See also Samples.
The box below lists all fields that could be included in the call request. To learn more about an individual field or its type, click its name in the box (or scroll down to find it in the table below the box).
See also the Deprecated Objects link above. Fields presented in this color are deprecated, and fields presented in this color are (or soon will be) non-operational.
The XML prototype does not include requester credentials. This is a documentation limitation only (see Standard Requester Credentials for Making Calls).
<?xml version="1.0" encoding="utf-8"?> <CompleteSaleRequest xmlns="urn:ebay:apis:eBLBaseComponents"> <!-- Call-specific Input Fields --> <FeedbackInfo> FeedbackInfoType <CommentText> string </CommentText> <CommentType> CommentTypeCodeType </CommentType> <TargetUser> UserIDType (string) </TargetUser> </FeedbackInfo> <ItemID> ItemIDType (string) </ItemID> <OrderID> string </OrderID> <OrderLineItemID> string </OrderLineItemID> <Paid> boolean </Paid> <Shipment> ShipmentType <ShipmentTrackingDetails> ShipmentTrackingDetailsType <ShipmentLineItem> ShipmentLineItemType <LineItem> LineItemType <CountryOfOrigin> string </CountryOfOrigin> <Description> string </Description> <ItemID> ItemIDType (string) </ItemID> <Quantity> int </Quantity> <TransactionID> string </TransactionID> </LineItem> <!-- ... more LineItem nodes allowed here ... --> </ShipmentLineItem> <ShipmentTrackingNumber> string </ShipmentTrackingNumber> <ShippingCarrierUsed> string </ShippingCarrierUsed> </ShipmentTrackingDetails> <!-- ... more ShipmentTrackingDetails nodes allowed here ... --> <ShippedTime> dateTime </ShippedTime> </Shipment> <Shipped> boolean </Shipped> <TransactionID> string </TransactionID> <!-- Standard Input Fields --> <ErrorHandling> ErrorHandlingCodeType </ErrorHandling> <ErrorLanguage> string </ErrorLanguage> <MessageID> string </MessageID> <Version> string </Version> <WarningLevel> WarningLevelCodeType </WarningLevel> </CompleteSaleRequest>
| Argument | Type | Occurrence | Meaning |
|---|
To determine if Feedback has already been left for an order line item, you can call GetFeedback, passing in the OrderLineItemID value in the call request.
Note: Feedback entries are submitted at the order line item level, so either an OrderLineItemID value or an ItemID/TransactionID pair should be specified to identify the order line item (and not an OrderLineItemID value). To leave Feedback for all line items in a multiple line item order, the seller would need a separate CompleteSale request for each order line item.
This comment will still be displayed even if submitted Feedback is withdrawn.
Max length: 500.
A Positive rating increases the user's Feedback score, a Negative rating decreases the user's Feedback score, and a Neutral rating does not affect the user's Feedback score. eBay users also have the right to withdraw feedback for whatever reason.
Sellers cannot leave Neutral or Negative ratings for buyers.
Applicable values:
(Not all values in CommentTypeCodeType apply to this field.)
Note: Effective September 26, 2025, both usernames and public user IDs will be accepted in this field. For more information, please refer to Data Handling Compliance.
Unless an OrderLineItemID value is used to identify a single order line item, or the OrderID value is used to identify a single or multiple line item order, the ItemID/TransactionID pair must be specified. To perform an action on an entire multiple line item order, the OrderID field must be used. If an OrderID or OrderLineItemID value is specified, an ItemID/TransactionID pair will be ignored (if present in the same request).
OrderID overrides an OrderLineItemID or ItemID/TransactionID pair if these fields are also specified in the same request.
Note: Note that the unique identifier of a 'non-immediate payment' order will change as it goes from an unpaid order to a paid order. Due to this scenario, all calls that accept Order ID values as request filters/parameters, including the CompleteSale call, will support the identifiers for both unpaid and paid orders.
Max length: 40.
Unless an ItemID/TransactionID pair is used to identify an order line item, or an OrderID value is used to identify an order, the OrderLineItemID must be specified. If OrderLineItemID is specified, the ItemID/TransactionID pair are ignored if present in the same request.
true to mark an unpaid order as paid. If the call is successful, the order line item(s) are marked as 'Paid' in eBay's system. Note: The seller is not allowed to set this field to
false.
If you supply ShipmentTrackingNumber, you must also supply ShippingCarrierUsed; otherwise you will get an error.
To modify the shipping tracking number and/or shipping carrier, supply the new number in the ShipmentTrackingNumber field or supply the value for ShippingCarrierUsed, or both. The old number and carrier are deleted and the new ones are added.
To simply delete the current tracking details altogether, supply empty Shipment tags.
Note: Top-Rated sellers must have a record of uploading shipment tracking information (through site or through API) for at least 95 percent of their order line items (purchased by U.S. buyers) to keep their status as Top-Rated sellers. For more information on the requirements to becoming a Top-Rated Seller, see the Becoming a Top-Rated Seller and qualifying for Top-Rated Plus customer support page.
.ShipmentTrackingDetails ShipmentTrackingDetailsType Optional,
repeatable: [0..*] Container consisting of the tracking number and shipping carrier associated with the shipment of one item (package).
Because an order can have multiple line items and/or packages, there can be multiple ShipmentTrackingDetails containers under the Shipment container.
.ShipmentTrackingDetails
.ShipmentLineItem ShipmentLineItemType Optional Contains information about one or more order line items in a Global Shipping Program package. Required or returned if the value of ShippingCarrierUsed is
PBI.
.ShipmentTrackingDetails
.ShipmentLineItem.LineItem LineItemType Optional,
repeatable: [1..*] Contains information about one order line item in a package. The package can contain multiple units of a given order line item, and multiple order line items.
.ShipmentTrackingDetails
.ShipmentLineItem.LineItem
.CountryOfOrigin string Optional The Country of Manufacture for the order line item; this is required for customs. This should identify the country in which more than 50% of the value of the item was created.
This value must conform to the ISO 3166 two-letter country code standard. To see the list of currently supported codes, and the English names associated with each code (e.g., KY="Cayman Islands"), call GeteBayDetails with DetailName set to CountryDetails.
.ShipmentTrackingDetails
.ShipmentLineItem.LineItem
.Description string Optional The item description of the order line item, based on its ItemID.
.ShipmentTrackingDetails
.ShipmentLineItem.LineItem
.ItemID ItemIDType (string) Optional Unique identifier for the eBay listing associated with the order line item. A multiple-quantity listing can have multiple order line items, but only one ItemID value. Unless an OrderLineItemID or SKU value is specified in the same node, this field is required for each ItemTransactionID node included in the request.
.ShipmentTrackingDetails
.ShipmentLineItem.LineItem
.Quantity int Conditional The number of units of the order line item in this package; this is required for customs. The seller must ensure that this matches the quantity of the order line item enclosed in the package.
This value must be a positive integer, and it can't be greater than the quantity of this item specified in the original transaction. This field is a required field in CompleteSale if the order type is a Global Shipping Program (GSP) order.
.ShipmentTrackingDetails
.ShipmentLineItem.LineItem
.TransactionID string Optional Unique identifier for an eBay order line item (transaction). The TransactionID should match the ItemID specified in each ItemTransactionID node included in the request. Optionally, an OrderLineItemID value can substitute for the ItemID/TransactionID pair.
The TransactionID value for auction listings is always
0 since there can be only one winning bidder/one sale for an auction listing. Note: Historically, TransactionID values have been '0' for auction listings, and some developers may have built logic around this. However, non-zero TransactionID values for auction listings started being used for some eBay marketplaces beginning in July 2024, and all eBay marketplaces are expected to start using non-zero TransactionID values for auction listings in the near future. If necessary, developers should update code to handle non-zero transaction IDs for auction transactions.
.ShipmentTrackingDetails
.ShipmentTrackingNumber string Conditional The tracking number assigned by the shipping carrier to the item shipment. This field and the ShippingCarrierUsed field are mutually dependent. When you submit ShipmentTrackingNumber, you must also supply a value for ShippingCarrierUsed. When you submit ShippingCarrierUsed, you must also supply a value for ShipmentTrackingNumber.
The seller is responsible for the accuracy of the shipment tracking number, as eBay only verifies that the tracking number is consistent with the numbering scheme used by the specified shipping carrier, but cannot verify the accuracy of the tracking number. For order management calls,
For GetOrders, GetSellerTransactions, and GetItemTransactions only: This field is only returned if a valid tracking number is set. With the exception of the GetSellerTransactions (where it is only returned to the seller and not buyer), the tracking number will only be returned to the seller or buyer. If a user is using a Trading WSDL Version 1019 or above, this field will only be returned to the buyer or seller, and no longer returned at all to third parties. If using a Trading WSDL older than Version 1019, this field is returned to third parties, but the string value returned in the field will be
Unavailable. Note: The Trading API only supports alphanumeric characters for shipment tracking numbers, and any other characters are not supported, including spaces, hyphens, and all other special characters. Users should not enter spaces even if spaces are shown for the tracking number on the shipping label.
.ShipmentTrackingDetails
.ShippingCarrierUsed string Conditional The name of the shipping carrier used to ship the item. This field and the ShipmentTrackingNumber field are mutually dependent. When you submit ShippingCarrierUsed, you must also supply a value for ShipmentTrackingNumber. When you submit ShipmentTrackingNumber, you must also supply a value for ShippingCarrierUsed.
When the site ID is Austria, Poland, or UK, ShippingCarrierUsed can be any value, because it is not checked by eBay. For all other sites, only the following characters are allowed: letters (
a-z, A-Z), numbers (0-9), space, and dash (-). The site ID is specified in the CompleteSale request header. Note: Commonly used shipping carriers can be found by calling GeteBayDetails with DetailName set to
ShippingCarrierDetails and examining the returned ShippingCarrierDetails.ShippingCarrier field. ShippingCarrierCodeType also has a list of valid shipping carriers, but eBay cannot guarantee that this enumerated type contains a full, updated list of shipping carriers. For the CompleteSale call: - This field is not case sensitive in the CompleteSale request.
- When using UPS Mail Innovations, supply the value
UPS-MI. Buyers will subsequently be sent to the UPS Mail Innovations website for tracking status. - When using FedEx SmartPost, supply the value
FedEx. Buyers will subsequently be sent to the FedEx web site for tracking status.
PBI.Applicable values: See ShippingCarrierCodeType
If the seller includes and sets this field to false, the order or order line item are marked (or remain) as 'Not Shipped' in eBay's system.
If this field is not included, the shipped status of the order or order line item remain unchanged in My eBay.
If shipment tracking information is provided for an order or order line item through the Shipment container in the same request, the Shipped status is set to
true automatically, and the Shipped field is not necessary.
Unless an OrderLineItemID value is used to identify a single order line item, or the OrderID value is used to identify a single or multiple line item order, the ItemID/TransactionID pair must be specified. To perform an action on an entire multiple line item order, the OrderID field must be used. If an OrderID or OrderLineItemID value is specified, an ItemID/TransactionID pair will be ignored (if present in the same request).
The TransactionID value for auction listings is always
0 since there can be only one winning bidder/one sale for an auction listing. Note: Historically, TransactionID values have been '0' for auction listings, and some developers may have built logic around this. However, non-zero TransactionID values for auction listings started being used for some eBay marketplaces beginning in July 2024, and all eBay marketplaces are expected to start using non-zero TransactionID values for auction listings in the near future. If necessary, developers should update code to handle non-zero transaction IDs for auction transactions.
| ErrorHandling | ErrorHandlingCodeType | Optional |
Error tolerance level for the call. This is a preference that specifies how eBay should handle requests that contain invalid data or that could partially fail. This gives you some control over whether eBay returns warnings or blocking errors and how eBay processes the invalid data. This field is only applicable to AddItem and related calls, and only when the listing includes ProductListingDetails. Default: FailOnError. Applicable values: If BestEffort is specified for CompleteSale, the Ack field in the response could return PartialFailure if one change fails but another succeeds. For example, if the seller attempts to leave feedback twice for the same order line item, the feedback changes would fail but any paid or shipped status changes would succeed. (Not all values in ErrorHandlingCodeType apply to this field.) |
||||||||||||||||||||||||||||||||||||||||
| ErrorLanguage | string | Optional |
Use ErrorLanguage to return error strings for the call in a different language from the language commonly associated with the site that the requesting user is registered with. Below are some examples from different countries.
|
||||||||||||||||||||||||||||||||||||||||
| MessageID | string | Optional |
Most Trading API calls support a MessageID element in the request and a CorrelationID element in the response. If you pass in a MessageID in a request, the same value will be returned in the CorrelationID field in the response. Pairing these values can help you track and confirm that a response is returned for every request and to match specific responses to specific requests. If you do not pass a MessageID value in the request, CorrelationID is not returned. Note: GetCategories is designed to retrieve very large sets of metadata that change once a day or less often. To improve performance, these calls return cached responses when you request all available data (with no filters). When this occurs, the MessageID and CorrelationID fields aren't applicable. However, if you specify an input filter to reduce the amount of data returned, the calls retrieve the latest data (not cached). When this occurs, MessageID and CorrelationID are applicable. |
||||||||||||||||||||||||||||||||||||||||
| Version | string | Conditional |
The version number of the API code that you are programming against (e.g., 1149). The version you specify for a call has these basic effects:
For the SOAP API: If you are using the SOAP API, this field is required. Specify the version of the WSDL your application is using. For the XML API: If you are using the XML API, this field has no effect. Instead, specify the version in the X-EBAY-API-COMPATIBILITY-LEVEL HTTP header. (If you specify Version in the body of an XML API request and it is different from the value in the HTTP header, eBay returns an informational warning that the value in the HTTP header was used instead.) See:
|
||||||||||||||||||||||||||||||||||||||||
| WarningLevel | WarningLevelCodeType | Optional |
Controls whether or not to return warnings when the application passes unrecognized or deprecated elements in a request. An unrecognized element is one that is not defined in any supported version of the schema. Schema element names are case-sensitive, so using WarningLevel can also help you remove any potential hidden bugs within your application due to incorrect case or spelling in field names before you put your application into the Production environment. WarningLevel only validates elements; it doesn't validate XML attributes. It also doesn't control warnings related to user-entered strings or numbers, or warnings for logical errors. We recommend that you only use this during development and debugging. Do not use this in requests performed in the Production environment. Applicable values: High if the user wishes to receive warnings when the application passes unrecognized or deprecated elements in an API call request. Setting the WarningLevel value to High is not recommended in a production environment. Instead, it should only be used during the development/debugging stage.Low if the user does not wish to receive warnings when the application passes unrecognized or deprecated elements in an API call request. This is the default value if WarningLevel is not specified in the call request.See Warning Level. |
Output
See also Samples.
The box below lists all fields that might be returned in the response. To learn more about an individual field or its type, click its name in the box (or scroll down to find it in the table below the box).
See also the Deprecated Objects link above. Fields presented in this color are deprecated, and fields presented in this color are not returned (or soon will not be returned) or are not operational (or soon will be non-operational).
<?xml version="1.0" encoding="utf-8"?> <CompleteSaleResponse xmlns="urn:ebay:apis:eBLBaseComponents"> <!-- (No call-specific Output fields) --> <!-- Standard Output Fields --> <Ack> AckCodeType </Ack> <Build> string </Build> <CorrelationID> string </CorrelationID> <Errors> ErrorType <ErrorClassification> ErrorClassificationCodeType </ErrorClassification> <ErrorCode> token </ErrorCode> <ErrorParameters ParamID="string"> ErrorParameterType <Value> string </Value> </ErrorParameters> <!-- ... more ErrorParameters nodes allowed here ... --> <LongMessage> string </LongMessage> <SeverityCode> SeverityCodeType </SeverityCode> <ShortMessage> string </ShortMessage> </Errors> <!-- ... more Errors nodes allowed here ... --> <HardExpirationWarning> string </HardExpirationWarning> <Timestamp> dateTime </Timestamp> <Version> string </Version> </CompleteSaleResponse>
| Return Value | Type | Occurrence | Meaning |
|---|
Applicable values:
Code so that your app gracefully handles any future changes to this list.
Note: GetCategories is designed to retrieve very large sets of metadata that change once a day or less often. To improve performance, these calls return cached responses when you request all available data (with no filters). When this occurs, the MessageID and CorrelationID fields aren't applicable. However, if you specify an input filter to reduce the amount of data returned, the calls retrieve the latest data (not cached). When this occurs, MessageID and CorrelationID are applicable.
repeatable: [0..*] A list of application-level errors (if any) that occurred when eBay processed the request.
Applicable values:
Code so that your app gracefully handles any future changes to this list.
See Errors By Number.
repeatable: [0..*] This optional element carries a list of context-specific error variables that indicate details about the error condition. These are useful when multiple instances of ErrorType are returned.
[ attribute ParamID ] string Conditionally This optional element carries a list of context-specific error variables that indicate details about the error condition. These are useful when multiple instances of ErrorType are returned.
Applicable values:
If the source of the problem is within the application (such as a missing required element), change the application before you retry the request.
- If the problem is due to end-user input data, please alert the end-user to the problem and provide the means for them to correct the data. Once the problem in the application or data is resolved, you can attempt to re-send the request to eBay.
- If the source of the problem is on eBay's side, An application can retry the request as-is a reasonable number of times (eBay recommends twice). If the error persists, contact Developer Technical Support. Once the problem has been resolved, the request may be resent in its original form.
See the Error handling section of the Making a Trading API call guide for more information.
When a warning occurs, the error is returned in addition to the business data. In this case, you do not need to retry the request (as the original request was successful). However, depending on the cause or nature of the warning, you might need to contact either the end user or eBay to effect a long term solution to the problem to prevent it from reoccurring in the future.
Code so that your app gracefully handles any future changes to this list.
Note: GetCategories and other Trading API calls are designed to retrieve very large sets of metadata that change once a day or less often. To improve performance, these calls return cached responses when you request all available data (with no filters). When this occurs, this time value reflects the time the cached response was created. Thus, this value is not necessarily when the request was processed. However, if you specify an input filter to reduce the amount of data returned, the calls retrieve the latest data (not cached). When this occurs, this time value does reflect when the request was processed.
Detail Controls
DetailLevel
This call does not support varying Detail Levels. You do not need to pass DetailLevel in the request.
Samples
New to making API calls? Please see Making a Call.
Note: Some item IDs, user IDs, or other data in these samples might no longer be active on eBay. If necessary, you can substitute current eBay data in your requests.
Leaves feedback for a buyer.
Description
Seller m***************r has sold a Harry Potter book and b***********r quickly paid for the book. Seller m***************r wants to provide positive feedback to b***********r.
Input
Because of the smooth order, m***************r gives feedback for b***********r. In addition, the CompleteSale call requires ItemID and TransactionID values. Optionally, M*****l B********r could have replaced the ItemID and TransactionID pair with the OrderLineItemID
XML format.
<?xml version="1.0" encoding="utf-8"?>
<CompleteSaleRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>A*******3</eBayAuthToken>
</RequesterCredentials>
<WarningLevel>High</WarningLevel>
<FeedbackInfo>
<CommentText>Wonderful buyer!</CommentText>
<CommentType>Positive</CommentType>
<TargetUser>b***********r</TargetUser>
</FeedbackInfo>
<ItemID>1**********0</ItemID>
<TransactionID>0</TransactionID>
</CompleteSaleRequest>
Output
The call returns a simple Success.
XML format.
<CompleteSaleResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2018年10月29日T20:19:15.502Z</Timestamp>
<Ack>Success</Ack>
<Version>1083</Version>
<Build>E1083_CORE_APIXO_18856776_R1</Build>
</CompleteSaleResponse>
Change History
| Change Date | Description |
|---|---|
| 1399 2025年02月05日 |
|
| 1145 2020年03月13日 |
|
| 1113 2019年06月21日 |
|
| 1107 2019年05月10日 |
|
| 1027 2017年08月04日 |
|
| 0959 2016年03月11日 |
|
| 0925 2015年05月29日 |
|
| 0911 2015年02月20日 |
|
| 0777 2012年06月06日 |
|
| 0705 2011年01月19日 |
|
| 0691 2010年10月14日 |
|
| 0635 2009年09月16日 |
|
| 0627 2009年07月22日 |
|
| 0615 2009年04月29日 |
|
| 0583 2008年09月17日 |
|
| 0577 2008年08月06日 |
|
| 0543 2007年12月14日 |
|
| 0491 2006年12月13日 |
|