Error Messages: /refund
Every request to POST /v1/refund and to the path-based POST /v1/orders/{id}/refund that returns HTTP 400, with the error key and the message for each case.
This page lists the requests to POST /v1/refund and to the path-based POST /v1/orders/{id}/refund that return HTTP 400, with the error key and the message for each case. Both endpoints are documented on /refund. The conventions for these tables and the errors that several endpoints share are on Error Messages by Endpoint.
POST /v1/refund
POST /v1/refund names the order in the request body with orderId or orderExternalId, and takes amount in cents. All 400 responses use Format A.
| Trigger | Error key | Message |
|---|---|---|
No idempotencyKey | IdempotencyKey | An idempotency key is required. |
Both orderId and orderExternalId sent, or neither | OrderId | Provide exactly one of orderId or orderExternalId. |
amount exceeds the remaining refundable balance. An order with no captured funds has a maximum of 0.00 | General | Amount to refund (<x.xx>) is greater than maximum refund amount in (<y.yy>)) |
| Available balance is below the order discount amount | General | Available balance (<x.xx>) is less than discounts amount (<y.yy>) |
| Refunds are disabled for the merchant | General | Refunds via API or Portal are disabled for this merchant |
- A request without
amountdoes not return400. It returns200withstatus: "FAILED"andresponseCode2001. - A refund declined by the processor returns
200withstatus: "FAILED". See /refund. - If no order matches
orderIdororderExternalId, the API returns404. - A
400from the last three rows is stored against theidempotencyKey. Send a new key after you correct the request.
POST /v1/orders/{id}/refund
The cases in this table were confirmed on the path-based refund endpoint. Its 400 responses use Format A, Format D for the amount mismatch, or Format E for the two envelope cases.
| Trigger | Format | Error key or item | Message |
|---|---|---|---|
refundMessage contains the literal text \u0000 | A | RefundMessage | Input string should not contain \u0000 characters. |
| The credential type does not allow this operation | E | item2: UNSUPPORTED_OPERATION, item3: UNSUPPORTED_OPERATION | Unsupported operation |
| Refunds are disabled for the merchant | A | General | Refunds via API or Portal are disabled for this merchant |
| Available balance is below the order discount amount | A | General | Available balance (<x.xx>) is less than discounts amount (<y.yy>) |
| Refund amount exceeds the maximum refundable amount | A | General | Amount to refund (<x.xx>) is greater than maximum refund amount in (<y.yy>)) |
| Refund could not be processed because of an internal error | E | item2: RefundFailed, item3: RefundFailed (or item2: REFUND_FAILED, item3: RefundFailed) | Failed to refund order |
| Empty body | A | "" | A non-empty request body is required. |
amount and amountToRefund are both sent and do not match | D | — | Refund amount mismatch: amount and amountToRefund do not match. |
amountis in cents.amountToRefundis a decimal amount in major units. If both are sent,amountToRefundmultiplied by 100 must equalamount.- The amount-mismatch body is a JSON string, not an object, sent with
Content-Type: application/json. - A request with neither
amountnoramountToRefunddoes not return400. It returns200withstatus: "FAILED"andresponseCode2001. - A refund declined by the processor returns
200withstatus: "FAILED". See Path-based request model.
Updated about 17 hours ago

