eBay Post-Order APIVersion 2.7.7
 

Get Return Shipping Label

GET /post-order/v2/return/{returnId}/get_shipping_label

This method retrieves detailed information on a return shipping label, including a URL where the shipping label can be downloaded and printed.

If an error is returned saying that a return shipping label doesn't exist for the return request, the POST /post-order/v2/return/{returnId}/initiate_shipping_label method may need to be called first.

This method is not supported in the Sandbox environment.

Input

See also Samples.

Resource URI (production)

GET https://api.ebay.com/post-order/v2/return/{returnId}/get_shipping_label

URI parameters

Parameter Type Required? Meaning
returnId string Required The unique eBay-assigned ID of the return. The returnId value is required as part of the call URI to identify the return request for which a shipping label is being retrieved.


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

This call has no request payload.


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 GetShippingLabelResponse 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

{ /* GetShippingLabelResponse */
"carrier": string,
"labelContent": string,
"labelCost":
    { /* Amount */
    "convertedFromCurrency": string,
    "convertedFromValue": number,
    "currency": string,
    "exchangeRate": string,
    "value": number
    },
"labelFormat": string,
"labelPrintStatus": string,
"labelURL": string,
"trackingNumber": string
}

Response field descriptions



Output Container/Field Type Occurrence Meaning
carrier string Conditionally This field shows the shipping carrier that will be used to ship the return or replacement item. The ShippingCarrierEnum type contains some popular shipping carriers for the US, UK, Germany, Canada, and Australia, but it is not a complete list.

Applicable values: See ShippingCarrierEnum
labelContent string Conditionally This field is the base64-encoded binary representation of the return shipping label.
labelCost Amount Conditionally This container shows the cost of the shipping label. This amount may not be available if the labelPrintStatus value is EXPIRED, FAILED, or UNKNOWN.
labelCost
  .convertedFromCurrency
string Conditionally The three-letter ISO 4217 code representing the currency of the amount in the convertedFromValue field. This value is the pre-conversion currency.

If no conversion occurs, this should not be populated.

The list of three-digit currency codes that may be returned in this field are defined in the CurrencyCodeEnum type definition.

Applicable values: See CurrencyCodeEnum
labelCost.convertedFromValue number Conditionally The monetary amount before any conversion is performed, in the currency specified by the convertedFromCurrency field. This value is the pre-conversion amount. The value field contains the converted amount of this value, in the currency specified by the currency field.

If no conversion occurs, this should not be populated.
labelCost.currency string Conditionally A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with any container using Amount type.

The list of three-digit currency codes that may be returned in this field are defined in the CurrencyCodeEnum type definition.

Applicable values: See CurrencyCodeEnum
labelCost.exchangeRate string Conditionally This field shows the exchange rate used to convert the amount in the convertedFromValue field to amount in the value field. This field is only returned when eBay does a currency version.
labelCost.value number Conditionally The monetary amount, in the currency specified by the currency field. This field is always returned with any container using Amount type.
labelFormat string Conditionally This enumeration value indicates the file format used for the printable shipping label.

Applicable values are from ShippingLabelFormatEnum:

PDF
This enumeration value indicates that the shipping label file is a Portable Document Format (.PDF) file.
PNG
This enumeration value indicates that the shipping label file is a Portable Network Graphics (.PNG) file.
UNKNOWN
This enumeration value indicates that the file type of the shipping label is unknown.

Code so that your app gracefully handles any future changes to this list.
labelPrintStatus string Conditionally This enumeration value indicates the current status of the shipping label. Read the descriptions for the individual enumeration values for more information about what each status value indicates.

Applicable values are from LabelPrintStatusEnum:

EXPIRED
This enumeration value is returned if the shipping label has expired, and is no longer available.
FAILED
This enumeration value is returned if the print shipping label job has failed.
PRINTED
This enumeration value is returned if the shipping label has been printed.
REQUESTED
This enumeration value is returned if the request for a shipping label has been initiated.
UNKNOWN
This enumeration value is returned if the status of the shipping label is unknown.

Code so that your app gracefully handles any future changes to this list.
labelURL string Conditionally This string value is the URL of the page where the shipping label can be downloaded and printed. This field is returned if it exists for the shipping label.
trackingNumber string Conditionally This value is the tracking number of the shipment. Most carriers provide shipment tracking, so this field will generally be returned if a shipping label is available for the order line item.
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: Get a Shipping Label

Retrieve a copy of all data for a return shipping label.

Description

This operation requests the information that comprises the return shipping label that is associated with the specified return.

Input

The returnId parameter is required to identify the return associated with the deired label. This call has no request payload.

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

GET https://api.sandbox.ebay.com/post-order/v2/return/5********1/get_shipping_label

Output

The response returned by this operation indicates that the carrier is the U.S. Postal Service, and that the label has been printed. It also includes the binary data comprising the shipping label (truncated for readability in this sample).

JSON format.
{
    "labelPrintStatus": "PRINTED",
    "carrier": "USPS",
    "labelContent": "i**************************************Z ... Q**************************************C"
}




Change History

Change Date Description