Marketplaces / eBay / eBay Feed API Technical Scope

eBay Feed API Technical Scope

The purpose of this document is to give good understanding how to migrate from LMS to the new Feed API which is the same feature but based on REST API.

The LMS is Large Merchant Services which allow us to send very large amounts of inventory to the eBay site, more specifically for product updates and product create. With the standard API we are able to send 120 product per request while with the LMS we can push up to 80k products for update at a time.

In terms of logs we will change the way we store the lms files. We will have a folder for each date containing each started lms for the day in a separate folder with the actual xml and response. For Example - 16_01_2022 > 563149 > request.xml / response.xml

Also we will need to change the way LMS and trading API updates are working and incorporate them into a single cron. If we have more than 1000 products for create or update on pending per eBay account we use the LMs to push the products to eBay and mark them as sent. With less than 1000 products we use our standard Trading API cron. Basically we will have a flow where we are checking each active eBay account in Hemi and depend on the number of products on pending we will either pick them with the LMS or the Trading API. If we have a LMS in progress we will have to wait to be completed before the next one of the same type can start again. Meanwhile if we have less than 1000 products the trading API will be picking them.

The Feed API LMS flow will look like:

Basically the first step is to create a task with the relevant feed type which returns an ID. The task ID is used to upload the file which are with the same structure as we currently have for the LMS. Then we have to periodically check the task status until we have COMPLETED or COMPLETED_WITH_ERROR. If there are any error we need to get the report which will specify which products are with error.

Authorization

The Feed API accepts OAuth tokens. See Using eBay RESTful APIs for more information on working with eBay REST APIs.

Create Tasks

API Call: POST https://api.ebay.com/sell/feed/v1/task

API Docs: https://developer.ebay.com/api-docs/sell/feed/resources/task/methods/createTask

This method creates an upload task. When using this method, specify the feedType and the feed file schemaVersion. The feed type specified sets the task as a download or an upload task. We need to check which is our current Schema Version and hardcode it.

Example Call:

{
    "schemaVersion": "1149",
    "feedType": "LMS_ADD_FIXED_PRICE_ITEM"
}

The feed Types which we will be using are:

Feed API feedType Job Description Flow Scope Job Detail Comment
LMS_ADD_FIXED_PRICE_ITEM AddFixedPriceItem Upload Inventory$^{1}$ Defines new fixed-price item(s) and lists them on a specified eBay site. Used for listing new products on eBay
LMS_REVISE_INVENTORY_STATUS ReviseInventoryStatus Upload Inventory$^{1}$ You can use SKU as input only for fixed-price listings that are managed by SKU (in other words, when InventoryTrackingMethod is set to SKU). ItemID can be used in either case. Used for stock and price updates

Once we make a successful create task request we need to create a new record in eBay LMS Job table.

Call Mapping:

Integration Field Integration Notes Integration required Hemi Mapping Hemi Notes
Task Id Ebay LMS Job > Job ID The format of the Task ID is - task-12-1125906786
N/A Ebay LMS Job > Job Type Based on the LMS type the corresponding value is populated.
LMS_ADD_FIXED_PRICE_ITEM, LMS_REVISE_INVENTORY_STATUS
N/A Ebay LMS Job > Ebay ID Account > Ebay ID
N/A Ebay LMS Job > Account Account > Name
N/A Ebay LMS Job > Account IDs ??
N/A Ebay LMS Job > Ebay Marketplace Account > Ebay Marketplace
N/A Ebay LMS Job > Job Progress Hardcoded as “CREATED“
N/A Ebay LMS Job > Last Operation Time If we update on the statuses we update the last operation time as well with NOW()
N/A Ebay LMS Job > Listings Count Additional Field which will indicate how many products we have submitted with the file. Populated at Upload File Step
N/A Ebay LMS Job > Listings Success Count Additional field which indicated how many listings were successfully updated/created populated at Get Status Step
N/A Ebay LMS Job > In Progress Set as true

Example Response:

The output is an HTTP status. If the call is successful, the task ID is returned in the Location response header. This method has no response payload.

If we receive any errors at this step we will need to return them in the log file because only if we have success response we will create a new record in eBay LMS Job.


Upload File

API Call: POST https://api.ebay.com/sell/feed/v1/task/{task_id}/upload_file

API Docs: https://developer.ebay.com/api-docs/sell/feed/resources/task/methods/uploadFile

This method associates the specified file with the specified task ID and uploads the input file. After the file has been uploaded, the processing of the file begins. Note: You must use a Content-Type header with its value set to "multipart/form-data".

Example Call:

This call does not have a Request payload.

Form data
{
/* FormDataContentDisposition */
"creationDate" : "string",
"fileName" : "string",
"modificationDate" : "string",
"name" : "string",
"parameters" : "object",
"readDate" : "string",
"size" : "integer",
"type" : "string"
}

Call Mapping:

Integration Field Integration Notes Integration required Hemi Mapping Hemi Notes
creationDate No N/A The file creation date. Format: UTC yyyy-MM-ddThh:mm:ss.SSSZ
For example: Created on September 8, 2019 2019-09-08T00:00:00.000Z
fileName Yes N/A The name of the file including its extension (for example, xml or csv) to be uploaded.
modificationDate No N/A he file modified date. Format: UTC yyyy-MM-ddThh:mm:ss.SSSZ
For example: Created on September 9, 2019 2019-09-09T00:00:00.000Z
name Yes N/A A content identifier. The only presently supported name is file.
parameters No N/A The parameters you want associated with the file.
readDate No N/A The date you read the file. Format: UTC yyyy-MM-ddThh:mm:ss.SSSZ
For example: Created on September 10, 2019 2019-09-10T00:00:00.000Z
size No N/A The size of the file.
type Yes N/A The file type. The only presently supported type is form-data.
file Yes N/A The actual file

Example Response:

A successful call returns an HTTP status code of 200 OK. This method has no response payload.

If we successfully (200) upload we need to set:

Hemi Field Value
Ebay LMS Job > File Reference ID {name of the file}
Ebay LMS Job >Job Progress IN_PROCESS
Ebay LMS Job > Listings Count The total number of products added in the file

Also we need to store all items from the file as LMS Job objects with its ID.

The file formats are the same as with the current LMS integration so we just change the flows.

If we receive any errors at this step we will need to set

Hemi Field Value
Ebay LMS Job >Job Progress Error
Ebay LMS Job > Error {{Error Message}}

Also we will need to set all products on Error included in the file.

Task Status

API Call: GET https://api.ebay.com/sell/feed/v1/task/{task_id}

API Docs: https://developer.ebay.com/api-docs/sell/feed/resources/task/methods/getTask

This method retrieves the details and status of the specified task. The input is task_id.

Example Call:

This call has no payload.

Example Response:

{
    "taskId": "task-10-3********1",
    "status": "COMPLETED",
    "feedType": "LMS_ORDER_ACK",
    "creationDate": "2020-07-06T03:00:23.000Z",
    "completionDate": "2020-07-06T03:00:34.000Z",
    "schemaVersion": "1.0",
    "detailHref": "https://api.qa.ebay.com/sell/feed/v1/task/task-10-3********1"
}
Integration Field Integration Notes Integration required Hemi Mapping Hemi Notes
completionDate N/A
creationDate N/A
feedType N/A
status Ebay LMS Job > Job Progress
taskId N/A
uploadSummary N/A
uploadSummary.failureCount N/A
uploadSummary.successCount Ebay LMS Job > Listings Success Count
N/A Ebay LMS Job > Last Operation Time current time NOW()

Statuses:

eBay Status Action Comment
CREATED We call again until we get a final status Indicates the task has been created.
QUEUED We call again until we get a final status Indicates the task has been added to the queue.
IN_PROCESS We call again until we get a final status Indicates the task is being processed.
COMPLETED Final Status Indicates the task has finished being processed
COMPLETED_WITH_ERROR Final Status Indicates the task has completed but there are errors. If there are errors, they will be indicated in the report.
FAILED Final Status Indicates the task has failed to complete.
PARTIALLY_PROCESSED Final Status Indicates the task has failed to complete, but was partially processed.

When we receive FAILED or PARTIALLY_PROCESSED statuses we also set Ebay LMS Job > In Progress set as false and delete all LMS Job objects for the particular task


Get Report

API Call: GET https://api.ebay.com/sell/feed/v1/task/{task_id}/download_result_file

API Docs: https://developer.ebay.com/api-docs/sell/feed/resources/task/methods/getResultFile

This method retrieves the generated file that is associated with the specified task ID. The response of this call is a compressed or uncompressed CSV, XML, or JSON file, with the applicable file extension (for example: csv.gz). Note: The status of the task to retrieve must be in the COMPLETED or COMPLETED_WITH_ERROR state before this method can retrieve the file. You can use the getTask or getTasks method to retrieve the status of the task.

Once we successfully get the report from a LMS with status COMPLETED or COMPLETED_WITH_ERROR we set Ebay LMS Job > In Progress set as false and delete all LMS Job objects for the particular task

We will be using the report file to obtain all errors of unsuccessful updated/created products which we will need to read and update accordingly on item account. Update the product status to error and store the relevant error message.

Example Call:

This call has no payload.

Call Mapping:

Example Response:

The response of this call is a compressed or uncompressed CSV, XML, or JSON file.
This call has no payload.
Integration Field Integration Notes Integration required Hemi Mapping Hemi Notes

Not able to get the report and check the format to finish the mapping.


Additional Information:

Here I am outlining the major differences from the current LMS flow and the new Feed API LMS.

At the moment we are picking all products on “pending“ and mark them as “sent” in order to collect and generate the xml files (that will be converted to zip file before sending) for the LMS (Upload File Step) then because of the limit of 14megabytes (In the new flow nowhere is mentioned file limit) we may add only the half of the picked products which will remain on sent but the other half will be reverted back on pending. This is necessary because both trading API and LMS are working at the same time thus we are changing this logic and incorporate both flows into single cron.

The upload file cron will work in background and there will be running separate crons for every lms. And the updating in the database will work in chunks for 1000 for performance.

Create Upload Job

LMS Feed API
CreateUploadJob createTask

What's Changed:

  1. LMS works through SOAP API while Feed API takes in REST API. In the Feed API, the OAuth Token (AuthorizationToken) follows the term Bearer (Bearer + UserToken).
  2. TaskId in Feed API response is equivalent to jobId in LMS API processing.
  3. SchemaVersion and SiteID values are provided through input Headers in Feed API. In LMS, these values were provided inside the inputFile. The value of <version> in the input files should match the SchemaVersion header value.
  4. In the Feed API, the MarketPlaceId value is provided through X-EBAY-C-MARKETPLACE-ID header. In LMS, this value was provided by SiteID.
  5. With the Feed API, sellers can create multiple jobs at a time. They are queued and only one is processed at any time. In LMS, sellers were blocked to create jobs as well.
  6. In the Feed API, the possible values for schemaVersion, X-EBAY-C-MARKETPLACE-ID, and feedType are described in Version details / Schema version and Supported MarketPlaceIds
  7. The taskId is used in the uploadfile call.

Upload Input File

LMS Feed API
uploadFile uploadFile

What's Changed:

  1. In LMS, the seller can either attach file as input or place its base64 encoded value in the request body. File input can only be a zipped xml formatted file for uploadJob.
  2. For the Feeds API, the input can be an xml file and zipped or in regular format (both formats are allowed). The input can be a file or InputStream type (Inputstream can be used while uploading file programmatically).
  3. Use the Feed API getInputFile method to download the file previously uploaded usinguploadFile.

Start Upload Job

LMS Feed API
startUploadJob Not applicable for the Feed API
  1. In the Feed API, the task is automatically moved to Queued Status, waiting for processing and will be picked up by the system.
  2. The QUEUED status in the Feed API corresponds to the SCHEDULED state in LMS.

AbortJob

LMS Feed API
AbortJob Not supported
Is this article helpful?
0 0 0