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.

TriggerError keyMessage
No idempotencyKeyIdempotencyKeyAn idempotency key is required.
Both orderId and orderExternalId sent, or neitherOrderIdProvide exactly one of orderId or orderExternalId.
amount exceeds the remaining refundable balance. An order with no captured funds has a maximum of 0.00GeneralAmount to refund (<x.xx>) is greater than maximum refund amount in (<y.yy>))
Available balance is below the order discount amountGeneralAvailable balance (<x.xx>) is less than discounts amount (<y.yy>)
Refunds are disabled for the merchantGeneralRefunds via API or Portal are disabled for this merchant
  • A request without amount does not return 400. It returns 200 with status: "FAILED" and responseCode 2001.
  • A refund declined by the processor returns 200 with status: "FAILED". See /refund.
  • If no order matches orderId or orderExternalId, the API returns 404.
  • A 400 from the last three rows is stored against the idempotencyKey. 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.

TriggerFormatError key or itemMessage
refundMessage contains the literal text \u0000ARefundMessageInput string should not contain \u0000 characters.
The credential type does not allow this operationEitem2: UNSUPPORTED_OPERATION, item3: UNSUPPORTED_OPERATIONUnsupported operation
Refunds are disabled for the merchantAGeneralRefunds via API or Portal are disabled for this merchant
Available balance is below the order discount amountAGeneralAvailable balance (<x.xx>) is less than discounts amount (<y.yy>)
Refund amount exceeds the maximum refundable amountAGeneralAmount to refund (<x.xx>) is greater than maximum refund amount in (<y.yy>))
Refund could not be processed because of an internal errorEitem2: RefundFailed, item3: RefundFailed (or item2: REFUND_FAILED, item3: RefundFailed)Failed to refund order
Empty bodyA""A non-empty request body is required.
amount and amountToRefund are both sent and do not matchD—Refund amount mismatch: amount and amountToRefund do not match.
  • amount is in cents. amountToRefund is a decimal amount in major units. If both are sent, amountToRefund multiplied by 100 must equal amount.
  • The amount-mismatch body is a JSON string, not an object, sent with Content-Type: application/json.
  • A request with neither amount nor amountToRefund does not return 400. It returns 200 with status: "FAILED" and responseCode 2001.
  • A refund declined by the processor returns 200 with status: "FAILED". See Path-based request model.

Did this page help you?