eBay Post-Order APIVersion 2.7.2
 

Upload Return Request Draft File

POST /post-order/v2/return/draft/{draftId}/file/upload

This method may be used on behalf of a buyer to upload files associated with a return request draft. These files may be shipping labels, or perhaps pictures that illustrate the condition of an item.

Input

See also Samples.

Resource URI (production)

POST https://api.ebay.com/post-order/v2/return/draft/{draftId}/file/upload

URI parameters

Parameter Type Required? Meaning
draftId string Required The unique eBay-assigned ID of the return request draft. The draftId value is required as part of the call URI to identify the return request draft for which to attach a file.


HTTP request headers

All requests made to eBay REST operations require you to provide the authorization HTTP header for authentication.
See HTTP request headers for details.



Authorization

This call uses standard authorization tokens. See Making a Call for details.

Payload model

The following lists all fields that could be included in the request.

{ /* UploadFileRequest */
"data": [
    string
    /* More string nodes here */
  ],
"fileName": string,
"filePurpose": string
}

Request field descriptions



Input Container/Field Type Occurrence Meaning
data array of string Required The input for this field is a base64-encoded binary representation of the file you are uploading. Depending on the type of file you are uploading, you may need to encode the file twice.

For images, the system accepts BMP, GIF, JPEG, and PNG files. For shipping labels, the system accepts either an image (BMP, GIF, JPEG, and PNG files) or a PDF file.
fileName string Optional This field is used to name the file that is being uploaded. This field is optional, but naming a file may make it easier for the buyer or seller to keep track of their files, instead of having to remember the fileId value (which is returned in the response) of each file.
filePurpose string Required The enumeration value supplied in this required field indicates the purpose of the file that you're uploading. One of the values defined in the FilePurposeEnum type definition must be used in this field.

Applicable values are from FilePurposeEnum:

ITEM_RELATED
This enumeration value indicates that the file is intended to provide more information about the item. For example, in a case where the buyer and seller are in disagreement over the condition of the item, the buyer or seller may provide a photo of the item that visually shows the condition of the item.
LABEL_RELATED
This enumeration value indicates that the file is intended to provide more information about a shipping label or shipment tracking information. For example, in a case where the buyer and seller are in disagreement over whether shipment tracking information has been provided or not, the buyer or seller may provide a photo of the shipping label itself, or they may provide a file that proves a package has been shipped or delivered.
REFUND_RELATED
This enumeration value indicates that the file is intended to provide more information about a buyer refund. For example, in a case where the buyer is saying that they have not recieved their refund, the seller may provide a file that proves that a refund has been issued.
UNKNOWN
This enumeration value should not be used in a Submit/Upload File request, but it is possible that this value may get returned in a response if the purpose of the file is not known.

Output

See also Samples.

Payload model

Note: For information about the error fields and how to work with them, see Error Handling.

The following lists all fields that could be included in the response.

Supported response formats: application/json, application/xml

For more information:
- See UploadFileResponse for a description of the response structure
- See the following table for descriptions of each of the data elements returned
- See the Samples for an example of the response format

{ /* UploadFileResponse */
"compressedFileData": string,
"fileId": string
}

Response field descriptions



Output Container/Field Type Occurrence Meaning
compressedFileData string Conditionally This field is the base64-encoded binary representation of the compressed version of the file that was uploaded with the request. This field will be returned if the file was successfully associated to the return request or return request draft.
fileId string Conditionally This is unique eBay-assigned ID of the file associated with a return request or return request draft. This field will be returned if the file was successfully associated to the return request or return request draft.
null



Samples

New to making API calls? Please see Making a Call.

Note: Some item IDs, user IDs, or other data in these samples might no longer be active on eBay. If necessary, you can substitute current eBay data in your requests.

Sample: Basic Call

Upload documents to a return draft.

Description

This call uploads documents to a return draft. Documents uploaded to a return draft or return request usually include a picture illustrating the condition/appearance of an item, or a scanned image of shipment tracking information and/or a shipping label.

Input

The draftId path parameter identifies the return draft to which the image will be attached. Along with the image data, this call includes the name of the file and the filePurpose field, which identifies the type of information being provided by this image. Supported file formats are BMP, GIF, JPEG, and PNG.

URL format. See also the non-wrapped version of this URL.

POST https://api.ebay.com/post-order/v2/return/draft/5********1/file/upload
{
  "fileName" : "j******.jpeg",
  "data" : "SGVyZSBpcyB5b3VyIHJld...YWNraW5nIG51bWJlciBpcyAxMjM0NTY3ODk4NzY1",
  "filePurpose" : "ITEM_RELATED"
}

Output

The response payload includes an eBay-generated unique identifier for the image file and a compressed copy of the image data.

JSON format.
{ 
"compressedFileData": "/9j/4***S...q**P/9k=",
"fileId": 5********2
}



Change History

Change Date Description