Tpay
API

Refunds

A refund request begins when you want to return funds to the payer for a previously executed transaction. The refund process can begin provided that your account has sufficient funds to cover the full amount of the refund and the refund fee. These funds will be deducted from the account at the moment the refund request is submitted.

Before you start

Make sure that:

Payment channels that do not support refunds

  • PayPal.

Full refund processing

To process a full refund, send a POST request to the endpoint:

https://api.tpay.com/transactions/{transactionId}/refunds

Replace {transactionId} with the ID of the transaction you want to refund:

https://api.tpay.com/transactions/ta_jrkNGj5L29pnlbqw/refunds

Check the details in the API Reference documentation: POST /transactions/{transactionId}/refunds

The request body should be empty:

{}

Example

curl --location --request POST 'http://api.tpay.com/transactions/ta_jrkNGj5L29pnlbqw/refunds' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json'
Note

The transaction for which a full refund is processed will change its status to refund.

Partial refund processing

To process a partial refund, send a POST request to the endpoint:

https://api.tpay.com/transactions/{transactionId}/refunds

Replace {transactionId} with the ID of the transaction you want to refund:

https://api.tpay.com/transactions/ta_jrkNGj5L29pnlbqw/refunds

Check the details in the API Reference documentation: POST /transactions/{transactionId}/refunds

In the request, specify the following parameters:

amount
The refund amount (in PLN).

The basic request body should look like this:

{
  "amount": 100.15
}

Example:

curl --location --request POST 'http://api.tpay.com/transactions/ta_jrkNGj5L29pnlbqw/refunds' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json'
--data '{
"amount": 100.15
}'
Note

A transaction for which a partial refund has been processed will not change its status. Even if the sum of the partial refunds reaches 100% of the transaction amount, the transaction status will not be changed to refund.

Retrieving refunds for a transaction

To retrieve refunds for a transaction, send a GET request to the endpoint:

https://api.tpay.com/transactions/{transactionId}/refunds

Replace {transactionId} with the ID of the transaction for which you want to get the list of refunds.

https://api.tpay.com/transactions/ta_jrkNGj5L29pnlbqw/refunds

Check the details in the API Reference documentation: GET /transactions/{transactionId}/refunds

In the request, you can specify the following parameters (queryParam) to filter the refunds:

from
Date and time in the yyyy-mm-dd hh:mm:ss format.
to
Date and time in the yyyy-mm-dd hh:mm:ss format.
page
Page number.
limit
Results per page.

Example:

curl --location 'https://api.tpay.com/transactions/ta_jrkNGj5L29pnlbqw/refunds?from=2023-03-01%2013%3A44%3A55&to=2023-03-01%2014%3A44%3A55&page=1&limit=35' \
--header 'Authorization: Bearer <access_token> '\

After sending the request, you will receive a GET /transactions/{transactionId}/refunds schema in response.

Retrieving the list of refunds

To retrieve the list of recent refunds, send a GET request to the endpoint:

https://api.tpay.com/refunds

Check the details in the API Reference documentation: GET /refunds

In the request, you can specify the following parameters (queryParam) to filter the refunds:

payerEmail
Payer's email.
transactionTitle
Transaction title.
context
Refund type (transactional, card).
token
Payment token (Possible only when context: card).
from
Date and time in the yyyy-mm-dd hh:mm:ss format.
to
Date and time in the yyyy-mm-dd hh:mm:ss format.
page
Page number.
limit
Results per page.

After sending the request, you will receive a GET /refunds schema in response.

Example:

curl --location 'https://api.tpay.com/refunds?payerEmail=Jan%20Nowak&transactionTitle=TR-123&context=transactional&from=2024-03-01%2013%3A44%3A55&to=2024-06-01%2014%3A44%3A55&page=1&limit=35' \
--header 'Authorization: Bearer <access_token> '\

Retrieving information about a single refund

To retrieve information about a single refund, send a GET request to the endpoint:

https://api.tpay.com/refunds/{refundId}

Replace {refundId} with the refund ID:

https://api.tpay.com/refunds/ta_jrkNGj5L29pnlbqw

Check the details in the API Reference documentation: GET /refunds/{refundId}

Example:

curl --location 'https://api.tpay.com/refunds/123' \
--header 'Authorization: Bearer <access_token> '\

After sending the request, you will receive a GET /refunds/{refundId} schema in response.

Refund statuses

StatusDescription
NewThe funds have been ordered for a refund by the Merchant.
PendingThe refund is pending.
CancelThe refund has been canceled.
HoldThe refund has been held by the Customer Service representative, according to the Merchant's email or phone instructions.
DoneThe refund has been completed and the funds have been transferred to the payer's bank account.
ProcessedThe refund has been successfully processed, awaiting bank confirmation
BLIK_pendingThe refund is awaiting processing.
BLIK_processedThe refund has been successfully processed, and the funds are in the payer's bank account.
BLIK_incorrectThe refund has been successfully processed, and the funds are in the payer's bank account.