eBay Create Order Fulfillments
Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)
Date | Version | Name | Applied changes |
---|---|---|---|
08/11/2023 | v1.0 | Bogomil | First Publish |
There is a predefined carriers which we can use and we have to introduce carrier mapping for eBay.
However we do not want them to be download via API and we need to prepare the enumerations in the database manually.
The full list of carrier codes is available:https://developer.ebay.com/devzone/xml/docs/reference/ebay/types/ShippingCarrierCodeType.html
Please note we want to send the Value and display the Value in the UI
All this should be introduced in a new table called “eBay Couriers Mapping“ which we want to be a dependent table of Courier. In “eBay Couriers Mapping“ we want to have all the available enumerations in a dropdown field. We are following the same pattern as standard and the mapping will be first we map the Order Shipment > Courier against Carrier > Name and get the eBay Couriers Mapping > eBay Courier. If NO Courier is provided on the order we want to introduce a default option in Account eBay. If there is no mapping for the provided Order Shipment > Courier in the order as well as default option we we want to set an error in Order Error table.
Create Fulfillments
We will be creating fulfillments only when we are shipping the orders from Hemi. Please note we are moving to the new shipping model and we want to use the Order Shipment Table. Create Fulfillments API is synchronous process and we receive the response right after the request. Also we will be shipping order per order.
eBay do support partial shipping updates so we want to implement the partial shipping logic. We want all triggers, status, error handling, etc. to be as per the standard shipping abstraction
API Call: POST https://api.ebay.com/sell/fulfillment/v1/order/{orderId}/shipping_fulfillment
Headers:
Authorization
- The bearer token
X-EBAY-C-MARKETPLACE-ID
- from the current mapping we already have
{orderId}
- Orders > Marketplace Order Id
Sample Request:
{
"trackingNumber": "H00HJA0058045180",
"shippingCarrierCode": "Other",
"lineItems": [
{
"lineItemId": "10060115025422",
"quantity" : 1
}
]
}
Mapping:
eBay Field | Hemi Field | Comment | |
---|---|---|---|
shipmentTrackingNumber |
Order Shipment > Tracking Number | ||
shippingCarrierCode |
Order Shipment > Courier | ||
lineItems |
|||
lineItemId |
Product Details > Item Order Line ID | We have to use the Order Shipment Row > Order Item Id in order to get the correct product and map the Product Details > Item Order Line ID | |
quantity |
Order Shipment Row > Quantity |
Sample Response: Status 201 OK
Sample Error Response: Status 401
{
"errors": [
{
"errorId": 1001,
"domain": "OAuth",
"category": "REQUEST",
"message": "Invalid access token",
"longMessage": "Invalid access token. Check the value of the Authorization HTTP request header."
}
]
}
We want to store the Error > Message as an error in Hemi in Order Error Table.