eBay New Shipment Model
Purpose of this document is to outline the details which we need do in order to migrate eBay to work with the new shipment model.
Summary of changes:
Version | Date | Name | Applied changes |
---|---|---|---|
v1.0 | 31.12.2024 | Bogomil Pavlov | Initial scope |
All validations, triggers and standardizations which are not mentioned here are as per : Order management general requirements Order General Shipment
With the actual migration we also want to include the logic for partial shipments. Please note we wont migrate to the new SellAPI because with the current cron of Get Orders we are not receiving the new lineItemId which is required for the new Fullfilment SELL API. So we will be using again the Trading API CompleteSale request but we will extend this and include the additional fields for partial shipments.
CompleteSale
API Call: POST https://api.ebay.com/ws/api.dll
API Docs: https://developer.ebay.com/devzone/xml/docs/reference/ebay/CompleteSale.html#Input
Body:
<?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>
Sample Request:
URL: POST [https://api.ebay.com/ws/api.dll](https://api.ebay.com/ws/api.dll)
HEADERS:
Content-Type: application/xml
Accept: application/xml
X-EBAY-API-COMPATIBILITY-LEVEL: 1331
X-EBAY-API-CALL-NAME: CompleteSale
X-EBAY-API-DEV-NAME:
X-EBAY-API-APP-NAME:
X-EBAY-API-CERT-NAME:
X-EBAY-API-SITEID: 3
BODY:
<CompleteSale xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>
<![CDATA[ v^1.1#i^1#f^0#I^3#rtestU5XzBfMSNFXjI2MA== ]]>
</eBayAuthToken>
</RequesterCredentials>
<DetailLevel>
<![CDATA[ ReturnAll ]]>
</DetailLevel>
<WarningLevel>
<![CDATA[ High ]]>
</WarningLevel>
<ErrorLanguage>
<![CDATA[ en_US ]]>
</ErrorLanguage>
<OrderID>
<![CDATA[ 27-12498-19502 ]]>
</OrderID>
<Shipment>
<ShipmentTrackingDetails>
<ShipmentLineItem>
<LineItem>
<ItemID>387056075893-1585661143025</ItemID>
<Quantity>1</Quantity>
</LineItem>
</ShipmentLineItem>
<ShipmentTrackingNumber>
<![CDATA[ 15504488044583 ]]>
</ShipmentTrackingNumber>
<ShippingCarrierUsed>
<![CDATA[ DPD UK ]]>
</ShippingCarrierUsed>
</ShipmentTrackingDetails>
<ShipmentTrackingDetails>
<ShipmentLineItem>
<LineItem>
<ItemID>387056075893-1585661143024</ItemID>
<Quantity>2</Quantity>
</LineItem>
</ShipmentLineItem>
<ShipmentTrackingNumber>
<![CDATA[ 15504488044583 ]]>
</ShipmentTrackingNumber>
<ShippingCarrierUsed>
<![CDATA[ DPD UK ]]>
</ShippingCarrierUsed>
</ShipmentTrackingDetails>
<ShippedTime>2024-12-31T09:42:02+00:00</ShippedTime>
</Shipment>
<Shipped>
<![CDATA[ 1 ]]>
</Shipped>
</CompleteSale>
Mapping
eBay Field | Hemi Field | Required | Comment | ||||||
---|---|---|---|---|---|---|---|---|---|
CompleteSale |
|||||||||
RequesterCredentials |
|||||||||
eBayAuthToken |
Account > Ebay Token | Yes | |||||||
DetailLevel |
“ReturnAll” | No | |||||||
WarningLevel |
“High” | No | |||||||
ErrorLanguage |
“en_US” | No | |||||||
OrderID |
Orders > Marketplace Order ID | Yes | |||||||
Shipment |
Please note we will have always one Shipment Node | ||||||||
ShipmentTrackingDetails |
The ShipmentTrackingDetails will be our Order Shipment Records and if we have two order shipment we want to have two separate ShipmentTrackingDetails nodes | ||||||||
ShipmentLineItem |
|||||||||
LineItem |
The LineItem represents our Order Shipment Rows and for each separate row we want to have separet LineItem | ||||||||
ItemId |
Product In Order > Item Order Line ID | No | |||||||
Quantity |
Order Shipment Row > Quantity | No | |||||||
ShipmentTrackingNumber |
Order Shipment > Tracking Number | Yes | |||||||
ShippingCarrierUsed |
Order Shipment > Courier | Yes | |||||||
ShippedTime |
CURRENT_DATE | Yes | Format “2024-12-31T09:42:02+00:00” | ||||||
Shipped |
“1” | Yes | The seller includes and sets this field to true if the order or order line item has been shipped. If the call is successful, the order line item(s) are marked as Shipped in My eBay. |
Sample Success Response 200:
<CompleteSaleResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2024-12-31T09:42:04.151Z</Timestamp>
<Ack>Success</Ack>
<Version>1391</Version>
<Build>E1289_CORE_APIXO_19220561_R1</Build>
</CompleteSaleResponse>
Sample Warning Response 200:
<?xml version='1.0' encoding='UTF-8' ?>
<CompleteSaleResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2024-12-31T11:49:28.658Z</Timestamp>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>Invalid Order Ids.</ShortMessage>
<LongMessage>
OrderIds 27-12498-19502
are invalid.
</LongMessage>
<ErrorCode>2191641</ErrorCode>
<SeverityCode>Warning</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>1391</Version>
<Build>E1289_CORE_APIXO_19220561_R1</Build>
</CompleteSaleResponse>
Sample Error Response 200:
<?xml version='1.0' encoding='UTF-8' ?>
<CompleteSaleResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2024-12-31T12:02:47.072Z</Timestamp>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>Auth token is invalid.</ShortMessage>
<LongMessage>Validation of the authentication token in API request failed.</LongMessage>
<ErrorCode>931</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>This token has been revoked by app.</ShortMessage>
<LongMessage>This token has been revoked by app. The end user must complete the Auth &amp; Auth consent flow again to generate a valid token.</LongMessage>
<ErrorCode>21916013</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>1391</Version>
<Build>E999_CORE_APIXO__R1</Build>
</CompleteSaleResponse>
We want to store all warnings and errors in Order Error table with the relevant type and Severity.
If in a single response we receive both severity errors we want to store them as two separate Order Errors with different Severity.
As a Order Error > Message we want to store always the ErrorCode
+ LongMessage