Skip to main content
Refund a previously authorized payment using its payment ID and return a payload that includes details of the resulting transaction.

Arguments

refundPreviousPaymentInput
required
mutation refundPreviousPayment($refundPreviousPaymentInput: RefundPreviousPaymentInput!) {
  refundPreviousPayment(refundPreviousPaymentInput: $refundPreviousPaymentInput) {
    refundPreviousPaymentResponse {
      paymentMethodResponse {
        cardPaymentMethodDetails {
          cardDetails {
            paymentBrand
            last4
          }
          networkResponseDetails {
            processorResponseCode
            networkResponseCode
          }
          acquirerTokenDetails {
            tokenizedPan
            token
            walletType
          }
          paymentBrand
        }
        bankPaymentMethodDetails {
          acquirerTokenDetails {
            tokenizedPan
            token
            walletType
          }
          paymentBrand
        }
      }
      cardDetails {
        paymentBrand
        last4
      }
      networkResponseDetails {
        processorResponseCode
        networkResponseCode
      }
      timestampUtc
      transactionId
      paymentId
      duration
      activityDate
      isDuplicateRequest
      tokenDetails {
        tokenizedPan
        token
      }
    }
    errors {
      ... on InternalServiceError {
        message
        dateTimeUtc
        errorDateTime
        transactionId
        processorResponseCode
      }
      ... on RuleInViolationError {
        message
        advice
        explanationOfRule
        ruleName
        processorResponseCode
        dateTimeUtc
        errorDateTime
        transactionId
      }
      ... on SyntaxOnNetworkResponseError {
        message
        attemptedNetwork
        processorResponseCode
        dateTimeUtc
        errorDateTime
        transactionId
      }
      ... on TimeoutOnNetworkResponseError {
        message
        waitTime
        attemptedNetwork
        processorResponseCode
        dateTimeUtc
        errorDateTime
        transactionId
      }
      ... on ValidationFailureError {
        message
        transactionId
        dateTimeUtc
        errorDateTime
        processorResponseCode
        fieldPath
        fieldName
        valueInError
      }
      ... on PriorPaymentNotFoundError {
        message
        unknownPaymentId
        processorResponseCode
        dateTimeUtc
        errorDateTime
        transactionId
      }
    }
  }
}

Response

Returns a RefundPreviousPaymentPayload
{
  "data": {
    "refundPreviousPayment": {
      "refundPreviousPaymentResponse": RefundPreviousPaymentResponse,
      "errors": [
        InternalServiceError
      ]
    }
  }
}