Method: asynchronousRefund

Refunds a portion or all of the entire transaction.

This initiates a request to refund funds that were captured. The amount refunded can be equal to or smaller than the remaining captured amount on the transaction. Multiple partial refunds are allowed by calling asynchronousRefund multiple times with different requestId within the header. The final result of the refund is supplied by a call to refundResultNotification. The combination of requestId within the header and paymentIntegratorAccountId is the idempotency key, which uniquely identifies this transaction.

If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type ErrorResponse.

An example request looks like:


{
  "requestHeader": {
    "protocolVersion": {
      "major": 2
    },
    "requestId": "liUrreQY233839dfFFb24gaQM",
    "requestTimestamp": {
      "epochMillis": "1502220434778"
    },
    "paymentIntegratorAccountId": "InvisiCashUSA_USD"
  },
  "transactionId": "bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ",
  "refundAmount": {
    "amountMicros": "208000000",
    "currencyCode": "INR"
  }
}

An example response looks like:


{
  "responseHeader": {
    "responseTimestamp": {
      "epochMillis": "1481900013178"
    }
  },
  "result": {
    "acknowledged": {}
  }
}

HTTP request

POST https://www.integratorhost.example.com/integrator-base-path/refundable-one-time-payment-code-v2/asynchronousRefund

Request body

The request body contains data with the following structure:

JSON representation
{
  "requestHeader": {
    object (RequestHeader)
  },
  "transactionId": string,
  "refundAmount": {
    object (Amount)
  }
}
Fields
requestHeader

object (RequestHeader)

REQUIRED: Common header for all requests.

transactionId

string

REQUIRED: A unique identifier for this transaction. This is a requestId generated by Google. The call during which this requestId is generated will depend on the buy flow.

refundAmount

object (Amount)

REQUIRED: The amount of the refund. Must be a positive number.

Response body

This method supports multiple return types. For additional information about what 4XX or 5XX HTTP status code to return with an ErrorResponse, consult the ErrorResponse object and HTTP status codes documentation.

Possible response messages
HTTP 200 Status

object (AsynchronousRefundResponse)

HTTP 4XX / 5XX Status

object (ErrorResponse)

AsynchronousRefundResponse

Response object for the payment integrator hosted asynchronousRefund method.

JSON representation
{
  "responseHeader": {
    object (ResponseHeader)
  },
  "result": {
    object (AsynchronousRefundResult)
  }
}
Fields
responseHeader

object (ResponseHeader)

REQUIRED: Common header for all responses.

result

object (AsynchronousRefundResult)

REQUIRED: The result of the asynchronous refund call.

AsynchronousRefundResult

Result codes for asynchronousRefund.

JSON representation
{

  // Union field result can be only one of the following:
  "acknowledged": {
    object (Empty)
  }
  // End of list of possible types for union field result.
}
Fields

Union field result.

result can be only one of the following:

acknowledged

object (Empty)

The refund has been requested and the integrator will do additional steps to determine if the refund was successful. Once the integrator knows the result of the refund, they will inform Google of the result by calling the refundResultNotification API.