Refund Lineitem
Last updated: 04-Jan-2022
Rate this article:
Overview
The refund_lineitem call is used to attempt to issue a full refund on a lineitem. This call will send the REFUND_ISSUED INS message.
URL: https://www.2checkout.com/api/sales/refund_lineitem
HTTP Method: POST
Input Parameters
| Parameter | Description |
|---|---|
| lineitem_id | Line item to issue refund on. Required. |
| category | ID representing the reason the refund was issued. Required. (values: 1-17 from the following list can be used except for 7 as it is for internal use only) |
| ID | Description |
|---|---|
| 1 | Did not receive order |
| 2 | Did not like item |
| 3 | Item(s) not as described |
| 4 | Fraud |
| 5 | Other |
| 6 | Item not available |
| 7 | Do Not Use (Internal use only) |
| 8 | No response from merchant |
| 9 | Recurring last installment |
| 10 | Cancellation |
| 11 | Billed in error |
| 12 | Prohibited product |
| 13 | Service refunded at merchants request |
| 14 | Non delivery |
| 15 | Not as described |
| 16 | Out of stock |
| 17 | Duplicate |
Data Returned
| Parameter | Description |
|---|---|
| response_code | Tells the user whether or not the operation was successful |
| response_message | Tells the user why the operation was or was not successful |
Example API Call
curl -X POST https://www.2checkout.com/api/sales/refund_lineitem \
-u 'username:password' -d 'lineitem_id=1234567890' -d 'category=16' \
-d 'comment=Item not in stock.' -H 'Accept: application/json'Example Successful Response
{
"response_code" : "OK",
"response_message" : "lineitem refunded"
}Common Error Codes
| Code | Description |
|---|---|
| PARAMETER_MISSING | Required parameter missing: |
| PARAMETER_INVALID | Required parameter is invalid: |
| RECORD_NOT_FOUND | Unable to find record. |
| FORBIDDEN | Access denied to sale. |
Method-Specific Error Codes
| Code | Description |
|---|---|
| FORBIDDEN | Permission denied to set refund category to 7. |
| INVALID_PARAMETER | This lineitem cannot be refunded. |
| NOTHING_TO_DO | Lineitem was already refunded. |
| TOO_LATE | Invoice too old to refund lineitem. (Will occur if sale is over 180 days) |
| TOO_HIGH | Lineitem amount greater than remaining balance on invoice. |
| TOO_LOW | Lineitem amount must be at least 0.01. |
Rate this article: