---
title: "Refund Transaction"
method: POST
path: "/public/refundTransaction"
tags: ["Merchant Portal services API"]
---

# Refund Transaction

`POST /public/refundTransaction`

Searches for a transaction by given parameters: <b>originalTransactionId + terminalId + sourceId</b><br> 
and sends a Refund via TecsXml Interface.<br>
Required role for operation: BO_TRANSACTIONMANAGEMENT_REFUND.<br>
Create MPauditlog table record with event type : RefundTransaction.<br>
Supports authentication with the following types of tokens:<br>
* <b>Bearer</b> &lt;token&gt;, which is a Bearer token authentication. The bearer token is a cryptic string, usually generated by the server in response to a login request.
* <b>Basic</b> &lt;credentials&gt;, where credentials is the Base64 encoding of username and password joined by a single colon :, CAS login service will be called for the given username and password for validating credentials.
* <b>TecsWebToken</b> &lt;token&gt;, is used for verifying a TecsWeb signature. Token must be hashed with SHA-256 algorithm in HEX format and constructed in format: <pre>transactionId + | + terminalId + | + secretKey</pre>

## Request body

- RefundTransactionRequest
  - `transactionId` string, required
  - `transactionDate` string, required
  - `terminalId` integer, required
  - `clientId` integer, required
  - `originalTransactionId` string, required
  - `cvc` string
  - `amount` integer, required
  - `currency` string, required
  - `receiptNumber` string, required
  - `paymentReason` string
  - `terminalLocation` string
  - `password` string
  - `ecData` string
  - `ecrData` string
  - `emvData` string
  - `languageCode` string
  - `receiptLayout` integer

## Response `200`

Successful operation

- RefundTransactionResponse
  - `responseCode` integer
  - `responseMessage` string
  - `transactionId` string
  - `messageType` string
  - `cardNumber` string
  - `originalTransactionId` string
  - `amount` integer
  - `ecrData` string
  - `emvData` string
  - `userData` string
  - `transactionDate` string, date-time
  - `authorizationCode` string
  - `txType` string
  - `acquirerName` string
  - `acquirerId` string
  - `cardBrand` string
  - `merchantNumber` string
  - `serialNumber` string
  - `traceNumber` integer
  - `originalTraceNumber` integer
  - `svc` string
  - `balanceAmount` string
  - `exchangeRate` string
  - `merchantName` string
  - `merchantAddress` string
  - `receiptHeader` string
  - `receiptFooter` string
  - `actualBonusPoints` string
  - `exchangeFee` integer

## Other responses

- `400` — * Transaction not found * Mandator not found
- `401` — Unauthorized - Authentication failed, e.g. MandatorId does not march
- `403` — Forbidden - Missing role: BO_TRANSACTIONMANAGEMENT_REFUND
- `500` — Internal server error

---

[API](https://skmtc.dev/bluefin-com/apis/merchant-services.md) · [All operations](https://skmtc.dev/bluefin-com/apis/merchant-services/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/bluefin-com/merchant-services/revisions/84e973bef72c/schema)
