Create a Refund

You can use this call to create a refund for a payment made with a Google Pay transaction.

Prerequisite

Get an access_token and use it as 'Bearer' token in your request. Find more details here.

Request

POST https://api.pay.cm.com/api/v1/paymentmethods/google-pay/v1/transactions/{transactionId}/refunds
{
  "amount": 1200,
  "reason": "Refund required by customer."
}

Optional parameters

ParameterTypeDescriptionConstraints
amountInt(1...99999999)Denomination in the smallest currency subunit (e.g. eurocents). If empty, the refund amount will be the remaining available amount of the transaction (e.g. total payment amount minus already refunded amounts minus the amounts of the pending refund requests).Must be lower than or equal to the original transaction amount.
reasonString(255)The description for the refund.

Response

If refund has been successfully created then the response is the Get Transaction response with an updated refunds.refundedAmount and refunds.refundedPendingAmount.