eBay Post-Order APIVersion 2

Create Return Shipping Label

POST /post-order/v2/return/{returnId}/initiate_shipping_label

This buyer-side call initiates the creation of an eBay return shipping label for the buyer. This call needs to be run before the buyer can retrieve the shipping label with the get_shipping_label call or before the buyer can send the shipping label to an email address using the send_shipping_label call.

Input

See also Samples.

Resource URI (production)

POST https://api.ebay.com/post-order/v2/return/{returnId}/initiate_shipping_label

URI parameters

Parameter Type Required? Meaning
returnId string Required The unique identifier of the return. The returnId value is required to identify the return for which a shipping label is being initiated.


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

{ /* InitiateShippingLabelResponse */
"carrier": token,
"labelData": string,
"labelURL": string,
"trackingNumber": string
}

Response field descriptions



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

Applicable values: See ShippingCarrierEnum
labelData string Conditionally This field contains the text of the shipping label.
labelURL string Conditionally This field provides the URL to the page where the buyer can go and download and print out the shipping label.
trackingNumber string Conditionally This value is the tracking number on the shipping label. Shipment tracking is available for most shipping carriers.
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: Initiate a Shipping Label

This buyer-side operation generates an eBay return shipping label for the buyer.

Description

If the assocated eBay site supports eBay labels, use this operation to provision an eBay return shipping label for the buyer.

Input

The returnId parameter is required to identify the return to which the return shipping label will apply. This call has no request payload.

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

POST https://api.sandbox.ebay.com/post-order/v2/return/5000119608/initiate_shipping_label

Output

If the call is successful, a return shiping label is created and the response payload includes information on the return shipping label, including the shipping carrier and tracking number. In this particular sample, the carrier is USPS, and there is a URL where the shipment can be tracked.

JSON format.
{
  "carrier": "USPS",
  "labelData": "Ben Buyer, 2145 Hamilton Avenue, San Jose, CA 95125, United States",
  "labelURL": "http://return.ebay.com/ws/eBayISAPI.dll?ResolveReturn&eventName=returnLabel&returnId=5000119608",
  "trackingNumber": "9301920128700000562779"
}



Change History

Change Date Description
1.0
2015-06-30
  • Call (added): New call.