Method: asynchronousRefund

Refunds a portion of or the entire transaction initiated through generateReferenceNumber. 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": 1,
      "minor": 3,
      "revision": 0
    },
    "requestId": "G18FCDTLD5B0SR4",
    "requestTimestamp": "1482489410000"
  },
  "paymentIntegratorAccountId": "InvisiCashUSA_USD",
  "generateReferenceNumberRequestId": "bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ",
  "refundAmount": {
    "amountMicros": "728000000",
    "currencyCode": "INR"
  }
}

An example response looks like:


{
  "responseHeader": {
    "responseTimestamp": "1482489412366"
  },
  "result": {
    "acknowledged": {}
  }
}

HTTP request

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

Request body

The request body contains data with the following structure:

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

object (RequestHeader)

REQUIRED: Common header for all requests.

paymentIntegratorAccountId

string

REQUIRED: This is the payment integrator account ID that defines contractual constraints around this transaction.

generateReferenceNumberRequestId

string

REQUIRED: A unique identifier for the cash payment which is to be refunded. This is the requestId generated by Google during the generateReferenceNumber call. This identifier will be set to the requestId in the requestHeader of the generateReferenceNumber call.

refundAmount

object (Amount)

REQUIRED: The amount of the refund, this will be a positive number, and should always be less-than or equal-to the remaining balance for the cash payment.

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)

Amount

Associates an amount in micros with a currency code.

JSON representation
{
  "amountMicros": string,
  "currencyCode": string
}
Fields
amountMicros

string (Int64Value format)

REQUIRED: An amount in micros.

currencyCode

string

REQUIRED: ISO 4217 3-letter currency code

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 of this asynchronous refund.

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. The result of the refund. 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.