Method: asynchronousRefund

Refunds a portion or all of the transaction initiated through asynchronousCaptureFundsReservation.

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 card-fop-v1.asynchronousRefund multiple times with different requestId within the header. The final result of the refund is supplied by a call to [refundResultNotification][google.standardpayments.flows.card_fop_async_refund.v1.GoogleCardAsyncRefundService.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": 1,
      "minor": 0,
      "revision": 0
    },
    "requestId": "G18FCDTLD5B0SR4",
    "requestTimestamp": "1482489410000"
  },
  "paymentIntegratorAccountId": "SpeedyPaymentsIndia_INR",
  "captureRequestId": "G112YZH4XPDV88J",
  "refundAmount": "364000000"
}

An example response looks like:


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

HTTP request

POST https://www.integratorhost.example.com/integrator-base-path/v1/payment-integrator-card-fop-api/asynchronousRefund

Request body

The request body contains data with the following structure:

JSON representation
{
  "requestHeader": {
    object (RequestHeader)
  },
  "paymentIntegratorAccountId": string,
  "captureRequestId": string,
  "refundAmount": string
}
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.

captureRequestId

string

REQUIRED: A unique identifier for the capture to be refunded. This is the requestId generated by Google during the captureFundsReservation or capture which this request is associated with.

refundAmount

string (Int64Value format)

REQUIRED: The amount of the refund, a positive number of micros of the currency unit specified in the originating message, either the funds reservation or initiating capture.

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 card-fop-v1.asynchronousRefund method.

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

object (ResponseHeader)

REQUIRED: Common header for all responses.

result

enum (AsynchronousRefundResultCode)

REQUIRED: The result of the asynchronous refund call.

AsynchronousRefundResultCode

Result codes for asynchronousRefund.

Enums
ASYNCHRONOUS_REFUND_RESULT_CODE_UNSPECIFIED Do not ever set this default value!
ACKNOWLEDGED The refund has been requested and the integrator will do additional steps to determine if the capture was successful. Once the integrator knows the result of the refund, they will inform Google of the result by calling the refundNotification API.