Skip to main content

POST/task/{task_id}/upload_file

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.

Reports often take time to generate and it's common for this method to return an HTTP status of 202, which indicates the report is being generated. Use the getTask with the task ID or getTasks to determine the status of a report.

The status flow is QUEUED > IN_PROCESS > COMPLETED or COMPLETED_WITH_ERROR. When the status is COMPLETED or COMPLETED_WITH_ERROR, this indicates the file has been processed and the order report can be downloaded. If there are errors, they will be indicated in the report file.

For details of how this method is used in the upload flow, see Working with Order Feeds in the Selling Integration Guide.

This call does not have a JSON Request payload but uploads the file as form-data. For example:

 fileName: "AddFixedPriceItem_Macbook.xml" 
name: "file"
type: "form-data"
file: @"/C:/Users/.../AddFixedPriceItem_Macbook.7z"
See Samples for information.

Note: This method applies to all Seller Hub feed types, and to all LMS feed types except LMS_ORDER_REPORT and LMS_ACTIVE_INVENTORY_REPORT.

Note: You must use a Content-Type header with its value set to "multipart/form-data". See Samples for information.

Note: For LMS feed types, upload a regular XML file or an XML file in zipped format (both formats are allowed).

Input

Resource URI

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

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

ParameterTypeDescription
task_idstringThis path parameter is the unique identifier of the task associated with the file that will be uploaded.

Use the getTasks method to retrieve task IDs.

Occurrence: Required

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

The table below shows additional HTTP request headers that are either required, conditionally required, or strongly recommended for this method. Other standard HTTP request headers- opens rest request components page (not in this table) can also be used, but they are optional.

HeaderTypeDescription
Content-TypestringThis header indicates the format of the request body provided by the client. Its value should be set to multipart/form-data.

For more information, refer to HTTP request headers.

Occurrence: Required

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/api_scope/sell.inventory

https://api.ebay.com/oauth/api_scope/sell.fulfillment

https://api.ebay.com/oauth/api_scope/sell.marketing

https://api.ebay.com/oauth/api_scope/commerce.catalog.readonly

https://api.ebay.com/oauth/api_scope/sell.analytics.readonly

See OAuth access tokens for more information.

Request payload

This call does not use a JSON request payload, but uploads files using multipart form data with information about the form data in the key-value pairs. See the Form data key and value description table for more information.

This call has no payload.

Request fields

This call has no field definitions.

Output

HTTP response headers

This call has no response headers.

Response payload

This call has no payload.

Response fields

This call has no field definitions.

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.

StatusMeaning
200Success
400Bad Request
403Forbidden
404Not Found
500Internal Server Error

Error codes

Note: Error Code 160001 may indicate that the payload was not found. Make sure your file is uploaded with the form data key-value pair name: "file". For additional information, see name.

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
160001API_FEEDAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay Developer Technical Support for assistance.
160002API_FEEDREQUESTThe authentication scope {scope} is incorrect for 'feed_type' {feedType}. Refer to documentation for details about the scopes.
160003API_FEEDREQUESTTask {taskID} does not exist.
160020API_FEEDREQUESTThe format of the file to be uploaded is invalid. {additionalInfo}
160023API_FEEDREQUESTTask {taskID} cannot upload a file.
160026API_FEEDREQUESTThis task has expired and you cannot use it to upload a file. You must upload a file within a hour of creating the task.
160028API_FEEDREQUESTThe file you tried to upload is too large. Please try using a smaller file. For more information, see the documentation for this API.
160100API_FEEDREQUESTPayload not found. Make sure your file is uploaded inside the Request Body under the key name 'file'.

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: Upload a File

This call uploads the file associated with the specified task passed in as a path parameter. Upload the file using a Content-Type header with its value set to "multipart/form-data". As shown in the Request Body below, the form data is sent as key-value pairs but not as a JSON request payload.

Input

The input is the task ID task-1******9 as a URI parameter. Although there is no JSON request payload, information about the form data is sent as key-value pairs. See Upload the file for more information.

POSThttps://api.ebay.com/sell/feed/v1/task/task-1******9/upload_file

Output

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