Run a referenced refund for a card payment
An AI skill is available for this guide, get it on the Skills Marketplace (GitHub).
A merchant can use the payment details of a card payment to run a referenced refund. To run a referenced refund, the merchant should first retrieve the payment information in one of the following ways:
- Use the paymentId.
- Search for the payment using payment information such as the card number.
Note: If the merchant runs a refund on a payment that is in an open batch, our gateway automatically cancels the payment.
Integration steps
Step 1. Retrieve information about the original payment.
(Optional) Step 1a. Retrieve information about the payment using the paymentId.
(Optional) Step 1b. Retrieve information about the payment without the paymentId.
Step 2. Refund the payment.
Before you begin
Authenticate your requests before making API calls. If your request fails, see Errors.
Step 1. Retrieve information about the original payment
1a – (Optional) Retrieve information with the paymentId
Send a GET request with the paymentID to the Payments endpoint.
Path 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
1b (Optional) – Retrieve information without the payment ID
Send a GET request to the Payments endpoint.
Request parameters
To create the body of your request, use the following parameters:
Example request
Response fields
If your request is successful, we retrieve a list of card payments and return a response. The response contains the following fields:
Response
Example response
Step 2. Refund the payment
To refund a card transfer payment, send a POST request to the Payments endpoint.
Request parameters
To create the body of your request, use the following parameters:
Request
Example request
Response fields
If your request is successful, we refund 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.
Refund a card payment
Send a POST request to the following endpoint:
POST https://api.uat.payroc.com/v1/payments/{paymentId}/refund
Note: To settle a payment, the terminal must first close the batch and then our gateway settles the payments within an hour. To adjust when the terminal closes a batch, use the terminal settings in the Merchant Portal.
Example response