metadata APIv1.3.0

getReturnPolicies

GET
/marketplace/{marketplace_id}/get_return_policies
This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories.

By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review.

Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:

  Accept-Encoding: application/gzip

Input

Resource URI (production)

GET https://api.ebay.com/sell/metadata/v1/marketplace/{marketplace_id}/get_return_policies?

URI parameters

ParameterTypeDescription
marketplace_idstringThis path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components.

Occurrence: Required

filterstringThis query parameter limits the response by returning policy information for only the selected sections of the category tree. Supply categoryId values for the sections of the tree you want returned.

When you specify a categoryId value, the returned category tree includes the policies for that parent node, plus the policies for any leaf nodes below that parent node.

The parameter takes a list of categoryId values and you can specify up to 50 separate category IDs. Separate multiple values with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns the policies for the first 50 IDs and a warning that not all categories were returned.

Example: filter=categoryIds:{100|101|102}

Note that you must URL-encode the parameter list, which results in the following filter for the above example:

  filter=categoryIds%3A%7B100%7C101%7C102%7D

Occurrence: Optional

HTTP request headers

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

OAuth scope

This request requires an access token created with the client credentials 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

See OAuth access tokens for more information.

Output

HTTP response headers

Output container/fieldTypeDescription
returnPoliciesarray of ReturnPolicyA list of elements, where each contains a category ID and a flag that indicates whether or not listings in that category require a return policy.

Occurrence: Always

returnPolicies.categoryIdstringThe category ID to which the return policies apply.

Occurrence: Always

returnPolicies.categoryTreeIdstringA value that indicates the root node of the category tree used for the response set. Each marketplace is based on a category tree whose root node is indicated by this unique category ID value. All category policy information returned by this call pertains to the categories included below this root node of the tree.

A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category that is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes.

Occurrence: Always

returnPolicies.domesticReturnPolicyDetailsThis complex type defines the category policies related to domestic item returns.

Occurrence: Conditional

returnPolicies.domestic.policyDescriptionEnabledbooleanIf set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces.

Occurrence: Conditional

returnPolicies.domestic.refundMethodsarray of RefundMethodEnumA list of refund methods allowed for the associated category.

Occurrence: Conditional

returnPolicies.domestic.returnMethodsarray of ReturnMethodEnumA list of return methods allowed for the associated category.

Occurrence: Conditional

returnPolicies.domestic.returnPeriodsarray of TimeDurationA list of return periods allowed for the associated category.

Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30).

Occurrence: Conditional

returnPolicies.domestic.returnPeriods.unitTimeDurationUnitEnumA time-measurement unit used to specify a period of time.

Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time.

Occurrence: Conditional

returnPolicies.domestic.returnPeriods.valueintegerAn integer that represents an amount of time, as measured by the time-measurement units specified in the unit field.

Occurrence: Conditional

returnPolicies.domestic.returnsAcceptanceEnabledbooleanIf set to true, this flag indicates the seller can configure how they handle domestic returns.

Occurrence: Conditional

returnPolicies.domestic.returnShippingCostPayersarray of ReturnShippingCostPayerEnumA list of allowed values for who pays for the return shipping cost.

Note that for SNAD returns, the seller is always responsible for the return shipping cost.

Occurrence: Conditional

returnPolicies.internationalReturnPolicyDetailsThis complex type defines the category policies related to international item returns.

Occurrence: Conditional

returnPolicies.international.policyDescriptionEnabledbooleanIf set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces.

Occurrence: Conditional

returnPolicies.international.refundMethodsarray of RefundMethodEnumA list of refund methods allowed for the associated category.

Occurrence: Conditional

returnPolicies.international.returnMethodsarray of ReturnMethodEnumA list of return methods allowed for the associated category.

Occurrence: Conditional

returnPolicies.international.returnPeriodsarray of TimeDurationA list of return periods allowed for the associated category.

Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30).

Occurrence: Conditional

returnPolicies.international.returnPeriods.unitTimeDurationUnitEnumA time-measurement unit used to specify a period of time.

Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time.

Occurrence: Conditional

returnPolicies.international.returnPeriods.valueintegerAn integer that represents an amount of time, as measured by the time-measurement units specified in the unit field.

Occurrence: Conditional

returnPolicies.international.returnsAcceptanceEnabledbooleanIf set to true, this flag indicates the seller can configure how they handle domestic returns.

Occurrence: Conditional

returnPolicies.international.returnShippingCostPayersarray of ReturnShippingCostPayerEnumA list of allowed values for who pays for the return shipping cost.

Note that for SNAD returns, the seller is always responsible for the return shipping cost.

Occurrence: Conditional

returnPolicies.requiredbooleanIf set to true, this flag indicates that you must specify a return policy for items listed in the associated category.

Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy.

Occurrence: Always

warningsarray of ErrorDetailV3A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request.

Occurrence: Conditional

warnings.categorystringThe category type for this error or warning. It takes an ErrorCategory object which can have one of three values:
  • Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency.
  • Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors.
  • Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on.

Occurrence: Conditional

warnings.domainstringName of the domain containing the service or application.

Occurrence: Conditional

warnings.errorIdintegerA positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms.

Occurrence: Conditional

warnings.inputRefIdsarray of stringIdentifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation.

Occurrence: Conditional

warnings.longMessagestringAn expanded version of message that should be around 100-200 characters long, but is not required to be such.

Occurrence: Conditional

warnings.messagestringAn end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale.

Occurrence: Conditional

warnings.outputRefIdsarray of stringIdentifies specific response elements associated with the error, if any. Path format is the same as inputRefId.

Occurrence: Conditional

warnings.parametersarray of ErrorParameterV3This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value.

Occurrence: Conditional

warnings.parameters.namestringName of the entity that threw the error.

Occurrence: Conditional

warnings.parameters.valuestringA description of the error.

Occurrence: Conditional

warnings.subdomainstringName of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain.

Occurrence: Conditional

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
204No content
400Bad Request
404Not found
500Internal Server Error

Error codes

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

CodeDomainCategoryMeaning
46000API_METADATAAPPLICATIONThere was a problem with an eBay internal system or process.Contact eBay developer support for assistance.
46001API_METADATAREQUESTThe specified marketplace ID was not found.

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: Get category return policies

The response from getReturnPolicies defines the configuration settings accepted by specific marketplace categories, giving you the guidelines for how to set up the seller return policies for the items you list.

This example retrieves the policies for two specific categories, 173677 and 173678.

Input

This method does not use a request payload.

By default, this method returns the leaf nodes of the entire category tree for the specified marketplace. When you retrieve the entire tree, be sure to get the result as a GZIP file (see the top of the call page for syntax).

Limit the response, specify up to 50 category IDs using the filter query parameter.

Note that you must URL-encode the category ID filter parameter value. This example uses the parameter:
filter=categoryIds:{173677|173678}
GET
https://api.ebay.com/sell/metadata/v1/marketplace/EBAY_MOTORS_US/get_return_policies?filter=categoryIds%3A%7B173677%7C173678%7D

Output

If the call is successful, the response body contains the policies that dictate whether or not you must specify a return policy for items listed in the categories specified in the request, plus the seller return-policy values supported by the associated category.