> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tesouro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validation errors

> Errors from failed value validation or business rule checks after a request reaches internal transaction handlers.

Validation errors occur after the request has successfully made it into the internal transaction handlers, but further value validation, or business rules, have determined one or more errors.

```json title="Response Structure: Validation Error" lines expandable theme={null}
{
  "data": { "nameOfMutation": null },
  "errors": [
    {
      "message": "<text description of the error>",
      "path": ["<name of mutation or query>"],
      "extensions": {
        "code": "<a specific error code for the error>",
        "advice": "<advice for resolving the error>",
        "valueInError": "<the value provided that is in error>"
      }
    }
  ]
}
```

```json title="Response: Capture - Payment Is Already Captured" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Payment is already fully captured",
      "path": ["captureAuthorization"],
      "extensions": {
        "code": "PAYMENT_IS_ALREADY_CAPTURED",
        "advice": "Review error details and fix internal system",
        "valueInError": "<guid>"
      }
    }
  ]
}
```

```json title="Response: Capture - Capture Amount Exceeds Authorized Amount" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Cannot capture more than what was authorized",
      "path": ["captureAuthorization"],
      "extensions": {
        "code": "CAPTURE_AMOUNT_EXCEEDS_AUTHORIZED_AMOUNT",
        "advice": "Review error details and fix internal system",
        "valueInError": "<decimal>"
      }
    }
  ]
}
```

```json title="Response: Refund - Payment Not Settled" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Cannot refund a payment that hasn't been settled",
      "path": ["refundWithReference"],
      "extensions": {
        "code": "PAYMENT_NOT_SETTLED",
        "advice": "Review error details and fix internal system",
        "valueInError": "<guid>"
      }
    }
  ]
}
```

```json title="Response: Refund - Original Transaction Was Declined" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Transaction to be refunded must have been approved",
      "path": ["refundWithReference"],
      "extensions": {
        "code": "ORIGINAL_TRANSACTION_WAS_DECLINED",
        "advice": "Review error details and fix internal system",
        "valueInError": "<guid>"
      }
    }
  ]
}
```

```json title="Response: Refund - Amount Exceeds Outstanding Balance" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Refund amount exceeds outstanding balance",
      "path": ["refundWithReference"],
      "extensions": {
        "code": "REFUND_AMOUNT_EXCEEDS_OUTSTANDING_BALANCE",
        "advice": "Review error details and fix internal system",
        "valueInError": "<decimal>"
      }
    }
  ]
}
```

```json title="Response: Refund - Amount Must Be Greater Than Zero" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Refund amount must be greater than zero",
      "path": ["refundWithReference"],
      "extensions": {
        "code": "REFUND_AMOUNT_MUST_BE_GREATER_THAN_ZERO",
        "advice": "Review error details and fix internal system",
        "valueInError": "<decimal>"
      }
    }
  ]
}
```

```json title="Response: Refund - Merchant ID Doesn't Match Prior Authorization" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Merchant ID does not match that of previous transaction",
      "path": ["refundWithReference"],
      "extensions": {
        "code": "MERCHANT_ID_DOESNT_MATCH_PRIOR_AUTH",
        "advice": "Review error details and fix internal system",
        "valueInError": "<guid>"
      }
    }
  ]
}
```

```json title="Response: Refund - Invalid Transaction Type For Refund" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Payment must be captured to be refunded",
      "path": ["refundWithReference"],
      "extensions": {
        "code": "PAYMENT_MUST_BE_SETTLED",
        "advice": "Review error details and fix internal system",
        "valueInError": "<guid>"
      }
    }
  ]
}
```

```json title="Response: Reversal - Original Transaction Was Declined" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Transaction to be reversed must have been approved",
      "path": ["reverseTransaction"],
      "extensions": {
        "code": "ORIGINAL_TRANSACTION_WAS_DECLINED",
        "advice": "Review error details and fix internal system",
        "valueInError": "<guid>"
      }
    }
  ]
}
```

```json title="Response: Reversal - Invalid Transaction Type For Reversal" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "<text description of the error>",
      "path": ["reverseTransaction"],
      "extensions": {
        "code": "INVALID_TRANSACTION_TYPE_FOR_REVERSAL",
        "advice": "Review error details and fix internal system",
        "valueInError": "<guid>"
      }
    }
  ]
}
```

```json title="Response: Reversal - Reversal Amount Exceeds Authorized Amount" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Reversal amount too high",
      "path": ["reverseTransaction"],
      "extensions": {
        "code": "REVERSAL_AMOUNT_GREATER_THAN_ORIGINAL_AUTHORIZATION_AMOUNT",
        "advice": "Review error details and fix internal system",
        "valueInError": "<decimal>"
      }
    }
  ]
}
```

```json title="Response: Reversal - Payment Already Settled" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Cant reverse a transaction that has already been cleared",
      "path": ["reverseTransaction"],
      "extensions": {
        "code": "PAYMENT_ALREADY_SETTLED",
        "advice": "Review error details and fix internal system",
        "valueInError": "<guid>"
      }
    }
  ]
}
```

```json title="Response: Reversal - Merchant ID Doesn't Match Prior Authorization" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Merchant ID does not match that of previous transaction",
      "path": ["reverseTransaction"],
      "extensions": {
        "code": "PRIOR_AUTH_MID_MUST_MATCH_REQUEST_MID",
        "advice": "Review error details and fix internal system",
        "valueInError": "<guid>"
      }
    }
  ]
}
```

```json title="Response: Reversal - Amounts Don't Equal Requested Amount" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "Sum of amount details does not match TransactionAmount",
      "path": ["reverseTransaction"],
      "extensions": {
        "code": "AMOUNTS_DO_NOT_ADD_UP_TO_TOTAL_REQUESTED_AMOUNT",
        "advice": "Review error details and fix internal system",
        "valueInError": "<decimal>"
      }
    }
  ]
}
```
