Reverse a card sale or a pre-authorization
Reverse a card sale or a pre-authorization
An AI skill is available for this guide, get it on the Skills Marketplace (GitHub).
If a customer requests a refund and the payment is still in an open batch, the merchant can use their POS to look up the card payment and cancel the transaction.
To find the paymentId of the card payment that the merchant wants to reverse, they can retrieve a list of all the card payments that meet the search criteria that the merchant provides. They can then find the transaction that they want in the list of returned results.
Note: If the merchant runs a referenced refund on a bank transfer payment that is in an open batch, our gateway automatically reverses the payment.
Integration steps
Step 1. (Optional) List card payments.
Step 2. Reverse a card payment.
Before you begin
Authenticate your requests before making API calls. If your request fails, see Errors.
Step 1 (Optional) List payments
To retrieve a list of card payments, send a GET request to our Payments endpoint.
Use our filters to narrow down the search results.
Request parameters
To create the body of your request, use the following parameters:
Query parameters
Example request
Response fields
If your request is successful, we retrieve the card payment information and return a response. The response contains the following fields:
Response
Example response
Step 2. Reverse a payment
To reverse a card payment, send a POST request to our Reverse endpoint.
If the merchant wants to reverse only part of the transaction, send the amount that they want to reverse in the amount parameter.
Request parameters
To create the body of your request, use the following parameters:
Request
Example request
Response fields
If your request is successful, we reverse the card payment and return a response. The response contains the following fields:
Response
Example response
Test cases
Before you run test cases, read the Payments page in Test Your Integration.
Reverse a card payment
Send a POST request to the following endpoint:
POST https://api.uat.payroc.com/v1/payments/{paymentId}/reverse
Note: The previous payment must be in the open batch and not settled.
Example response