fulfillment API1.11.0

issueRefund

POST
/order/{order_id}/issue_refund
This method allows a seller (opted in to eBay Managed Payments) to issue a full or partial refund to a buyer for an order. Full or partial refunds can be issued at the order level or line item level.

The refunds issued through this method are processed asynchronously, so the refund will not show as 'Refunded' right away. A seller will have to make a subsequent getOrder call to check the status of the refund. The status of an order refund can be found in the paymentSummary.refunds.refundStatus field of the getOrder response.

Note: eBay Managed Payments is currently only available to a limited number of US sellers, but this program is scheduled to become available to more sellers throughout 2019 and beyond.

Input

Resource URI (production)

POST https://api.ebay.com/sell/fulfillment/v1/order/{order_id}/issue_refund

URI parameters

ParameterTypeDescription
order_idstringThe unique identifier of the order. Order IDs are returned in the getOrders method (and GetOrders call of Trading API). The issueRefund method supports the legacy API Order IDs and REST API order IDs.

Note: In the Trading API (and other legacy APIs), Order IDs are transitioning to a new format. The new format is a non-parsable string, globally unique across all eBay marketplaces, and consistent for both single line item and multiple line item orders. These order identifiers will be automatically generated after buyer payment, and unlike in the past, instead of just being known and exposed to the seller, these unique order identifiers will also be known and used/referenced by the buyer and eBay customer support.

For developers and sellers who are already integrated with the Trading API's order management calls, this change shouldn't impact your integration unless you parse the existing order identifiers (e.g., OrderID or OrderLineItemID), or otherwise infer meaning from the format (e.g., differentiating between a single line item order versus a multiple line item order). Because we realize that some integrations may have logic that is dependent upon the identifier format, eBay is rolling out the Trading API change with version control to support a transition period of approximately 9 months before applications must switch to the new format completely. See the OrderID field description in the GetOrders call for more details and requirements on transitioning to the new Order ID format.

Occurrence: Required

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/sell.finances

See OAuth access tokens for more information.

Input container/fieldTypeDescription
reasonForRefundReasonForRefundEnumThe enumeration value passed into this field indicates the reason for the refund. One of the defined enumeration values in the ReasonForRefundEnum type must be used.

This field is required, and it is highly recommended that sellers use the correct refund reason, especially in the case of a buyer-requested cancellation or 'buyer remorse' return to indicate that there was nothing wrong with the item(s) or with the shipment of the order.

Note: If issuing refunds for more than one order line item, keep in mind that the refund reason must be the same for each of the order line items. If the refund reason is different for one or more order line items in an order, the seller would need to make separate issueRefund calls, one for each refund reason.

Occurrence: Required

commentstringThis free-text field allows the seller to clarify why the refund is being issued to the buyer.

Max Length: 1000

Occurrence: Optional

refundItemsarray of RefundItemThe refundItems array is only required if the seller is issuing a refund for one or more individual order line items in a multiple line item order. Otherwise, the seller just uses the orderLevelRefundAmount container to specify the amount of the refund for the entire order.

Occurrence: Conditional

refundItems.refundAmountSimpleAmountThis container is used to specify the amount of the refund for the corresponding order line item. If a seller wants to issue a refund for an entire order, the seller would use the orderLevelRefundAmount container instead.

Occurrence: Conditional

refundItems.refundAmount.currencyCurrencyCodeEnumA three-letter ISO 4217 code (such as USD for US site) that indicates the currency of the amount in the value field. Both the value and currency fields are required when expressing the amount of the refund or the amount involved in a payment dispute.

Occurrence: Conditional

refundItems.refundAmount.valuestringThe monetary amount of the refund. Only use a maximum of two digits to the right of the decimal point. Both the value and currency fields are required when expressing the amount of the refund or the amount involved in a payment dispute.

Occurrence: Conditional

refundItems.lineItemIdstringThe unique identifier of an order line item. This identifier is created once a buyer purchases a 'Buy It Now' item or if an auction listing ends with a winning bidder. Either this field or the legacyReference container is needed to identify an individual order line item that will receive a refund.

Note: The lineItemId field is used to identify an order line item in REST API format, and the legacyReference container is used to identify an order line item in Trading/legacy API format. Both legacy and REST API identifiers are returned in getOrder (Fulfillment API) and GetOrders (Trading API).

Occurrence: Conditional

refundItems.legacyReferenceLegacyReferenceThis container is needed if the seller is issuing a refund for an individual order line item, and wishes to use an item ID/transaction ID pair to identify the order line item. Either this container or the lineItemId field is needed to identify an individual order line item that will receive a refund.

Note: The lineItemId field is used to identify an order line item in REST API format, and the legacyReference container is used to identify an order line item in Trading/legacy API format. Both legacy and REST API identifiers are returned in getOrder (Fulfillment API) and GetOrders (Trading API).

Occurrence: Conditional

refundItems.legacyReference.legacyItemIdstringThe unique identifier of a listing in legacy/Trading API format.

Note: Both legacyItemId and legacyTransactionId are needed to identify an order line item.

Occurrence: Conditional

refundItems.legacyReference.legacyTransactionIdstringThe unique identifier of a sale/transaction in legacy/Trading API format. A 'transaction ID' is created once a buyer purchases a 'Buy It Now' item or if an auction listing ends with a winning bidder.

Note: Both legacyItemId and legacyTransactionId are needed to identify an order line item.

Occurrence: Conditional

orderLevelRefundAmountSimpleAmountThis container is used to specify the amount of the refund for the entire order. If a seller wants to issue a refund for an individual line item within a multiple line item order, the seller would use the refundItems array instead.

Occurrence: Conditional

orderLevelRefundAmount.currencyCurrencyCodeEnumA three-letter ISO 4217 code (such as USD for US site) that indicates the currency of the amount in the value field. Both the value and currency fields are required when expressing the amount of the refund or the amount involved in a payment dispute.

Occurrence: Conditional

orderLevelRefundAmount.valuestringThe monetary amount of the refund. Only use a maximum of two digits to the right of the decimal point. Both the value and currency fields are required when expressing the amount of the refund or the amount involved in a payment dispute.

Occurrence: Conditional

Output

HTTP response headers

Output container/fieldTypeDescription
refundIdstringThe unique identifier of the order refund. This value is returned unless the refund operation fails (refundStatus value shows FAILED). This identifier can be used to track the status of the refund through a getOrder or getOrders call. For order-level refunds, check the paymentSummary.refunds.refundId field in the getOrder/getOrders response, and for line item level refunds, check the lineItems.refunds.refundId field(s) in the getOrder/getOrders response.

Occurrence: Conditional

refundStatusRefundStatusEnumThe value returned in this field indicates the success or failure of the refund operation. A successful issueRefund operation should result in a value of PENDING. A failed issueRefund operation should result in a value of FAILED, and an HTTP status code and/or and API error code may also get returned to possibly indicate the issue.

The refunds issued through this method are processed asynchronously, so the refund will not show as 'Refunded' right away. A seller will have to make a subsequent getOrder call to check the status of the refund. The status of an order refund can be found in the paymentSummary.refunds.refundStatus field of the getOrder response.

Occurrence: Always

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
200OK
400Bad Request
403Access Forbidden
404Resource Not found
409Conflict
500Internal Server Error

Error codes

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

CodeDomainCategoryMeaning
34900API_FULFILLMENTAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay developer support for assistance.
34901API_FULFILLMENTREQUESTOrder id can't be null or empty.
34902API_FULFILLMENTREQUESTRequest can't be empty.
34903API_FULFILLMENTREQUESTThe refund reason must be specified.
34905API_FULFILLMENTREQUESTEither orderLevelRefundAmount or refundItems must be specified.
34906API_FULFILLMENTREQUESTThe amount value must be specified.
34907API_FULFILLMENTREQUESTThe amount value must be positive and within two decimals.
34908API_FULFILLMENTREQUESTThe amount currency must be specified.
34909API_FULFILLMENTREQUESTThe amount currency isn't correct.
34910API_FULFILLMENTREQUESTEither legacyReference or lineItemId must be specified for item level refund.
34911API_FULFILLMENTREQUESTLegacy item id must be specified for item level refund if you use legacyReference.
34912API_FULFILLMENTREQUESTLegacy transaction id must be specified for item level refund if you use legacyReference.
34913API_FULFILLMENTREQUESTCan not find the order.
34914API_FULFILLMENTREQUESTCan't find the item in the order.
34915API_FULFILLMENTREQUESTThe refund amount exceeds order amount.
34916API_FULFILLMENTBUSINESSA post-transaction case exists on this order, seller refund can't be triggered.
34917API_FULFILLMENTBUSINESSThe order status is not correct, refund can't be triggered against the order.
34918API_FULFILLMENTBUSINESSThis is not an eBay managed payments order.
34919API_FULFILLMENTREQUESTUnauthorized access.
34920API_FULFILLMENTBUSINESSThis order is out of time to trigger refund.
34921API_FULFILLMENTREQUESTThe comment exceeds the length limit, please make sure it doesn't exceed 1000 characters.
34922API_FULFILLMENTREQUESTRefund can't be issued while previous refund is processing.
34923API_FULFILLMENTREQUESTRefund can�t be issued for this type of order (seller created order).

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: Order-Level Refund

Seller issues order-level refund

Input

Seller issues an order-level refund to the buyer after the buyer requests cancellation of the order. The refund amount is $1.00.
POST
https://api.ebay.com/sell/fulfillment/v1/order/23-03522-31852/issue_refund

Output

The response is successful and a unique identifier of the refund is returned. All successfully-initiated refunds through the issueRefund call will produce a refundStatus value of PENDING. Sellers can then use a getOrder call to track the progress of the refund.

Sample 2: Single Line Item-Level Refund Using lineItemId

Seller issues line item-level refund using lineItemId field

Input

Seller issues an line item-level refund to the buyer after the buyer requests cancellation of one line item in the order. The seller uses the lineItemId field to identify the line item that will be refunded. The refund amount is $1.00.
POST
https://api.ebay.com/sell/fulfillment/v1/order/24-03528-54027/issue_refund

Output

The response is successful and a unique identifier of the refund is returned. All successfully-initiated refunds through the issueRefund call will produce a refundStatus value of PENDING. Sellers can then use a getOrder call to track the progress of the refund.

Sample 3: Single Line Item-Level Refund Using legacyReference

Seller issues line item-level refund using legacyReference container

Input

Seller issues an line item-level refund to the buyer after the buyer requests cancellation of one line item in the order. The seller uses the legacyReference container to identify the line item that will be refunded. The refund amount is $1.00.
POST
https://api.ebay.com/sell/fulfillment/v1/order/10-03523-27355/issue_refund

Output

The response is successful and a unique identifier of the refund is returned. All successfully-initiated refunds through the issueRefund call will produce a refundStatus value of PENDING. Sellers can then use a getOrder call to track the progress of the refund.