refunds

Create referenced refund

Changed on
<Warning> **Important:** Our gateway can't run a referenced refund against an ACH payment that's in a closed batch. If the merchant calls [Create Referenced Refund](/api/schema/bank-transfer-payments/refunds/refund) for an ACH payment that has already settled, the request fails with a 400 error. To refund an ACH payment that's in a closed batch, the merchant must run an [unreferenced refund](/api/schema/bank-transfer-payments/refunds/create) instead. </Warning>

Use this method to refund a bank transfer payment that is in a closed batch. For ACH payments, see Automated Clearing House (ACH) payments below before you use this method.

To refund a bank transfer payment, you need its paymentId. Our gateway returned the paymentId in the response of the Create Payment method.

Note: If you don’t have the paymentId, use our List Payments method to search for the bank transfer payment.

If your refund is successful, our gateway returns the payment amount to the customer's account.

Automated Clearing House (ACH) payments

For an ACH payment, this method succeeds only while the payment is in an open batch, and in that case our gateway reverses the payment instead of refunding it. After the batch closes, this method returns a 400 error, Bank transfer with status COMPLETE can not be refunded.

To return funds for an ACH payment that is in a closed batch, use our Create Refund method with the customer’s bank account details or a secure token.

This restriction doesn’t apply to pre-authorized debit (PAD) payments.

Things to consider

  • If the merchant refunds a bank transfer payment that is in an open batch, our gateway reverses the bank transfer payment. In the response, transactionResult.type is payment and transactionResult.status is reversal.
  • Some merchants can run unreferenced refunds, which means that they don’t need a paymentId to return an amount to a customer. For more information about how to run an unreferenced refund, go to Create Refund.
post/bank-transfer-payments/{paymentId}/refund

Request

  • Base URL
    https://api.payroc.com/v1
  • URL
    https://api.payroc.com/v1/bank-transfer-payments/{paymentId}/refund
  • Auth
    HTTP bearer

Path parameters

paymentIdstring required

Unique identifier that our gateway assigned to the payment.

Headers

Idempotency-Keystring uuid required

Unique identifier that you generate for each request. You must use the UUID v4 format for the identifier. For more information about the idempotency key, go to Idempotency.

Request body

amountinteger required

Total amount of the refund. The value is in the currency's lowest denomination, for example, cents.

descriptionstring required

Description of the refund.

Response

Successful request. We refunded the payment.

paymentIdstring required

Unique identifier that we assigned to the payment.

processingTerminalIdstring required

Unique identifier that we assigned to the terminal.

Changes

    • breaking

      the // response property's maxLength was increased from 100 to 255 for the response status

    • warning

      deleted the header request parameter Authorization

    • info

      the endpoint scheme security Bearer was added to the API