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.

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

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

Input

Resource URI (production)

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

URI parameters

ParameterTypeDescription
task_idstringThe task_id associated with the file that will be uploaded. This ID was generated when the specified task was created.

Occurrence: Required

HTTP request headers

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

In addition, this method requires you to include the Content-Type header and its value should be set to "multipart/form-data". See HTTP request headers- opens rest request components page for details.

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

Copy complete valid JSON to clipboard

This call does not have a Request payload.

Form data

The following links are to definitions for Form data.

Request fields

This call does not have Request fields (no payload).

Form data fields

The following definitions apply to Form data used in this call.

Input container/fieldTypeDescription
creationDatestring

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

Occurrence: Optional

fileNamestring

The name of the file including its extension (for example, xml or csv) to be uploaded.

Occurrence: Required

modificationDatestring

The file modified date.

Format: UTC yyyy-MM-ddThh:mm:ss.SSSZ

For example:

Created on September 9, 2019

2019-09-09T00:00:00.000Z

Occurrence: Optional

namestring

A content identifier. The only presently supported name is file.

Occurrence: Required

parametersobject

The parameters you want associated with the file.

Occurrence: Optional

readDatestring

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

Occurrence: Optional

sizeinteger

The size of the file.

Occurrence: Optional

typestring

The file type. The only presently supported type is form-data.

Occurrence: Required

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.

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".

Input

There is no request payload. The input is the task ID task-1******9 as a URI parameter.

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.