> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://beta-docs.payabli.com/api-reference/moneyin/refund-a-settled-transaction/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://beta-docs.payabli.com/_mcp/server. # Refund transaction GET https://api-sandbox.payabli.com/api/MoneyIn/refund/{transId}/{amount} Refund a transaction that has settled and send money back to the account holder. If a transaction hasn't been settled, void it instead. Reference: https://beta-docs.payabli.com/api-reference/moneyin/refund-a-settled-transaction ## Authentication - `requestToken` header (required) — API Key authentication via header ## Servers - `https://api-sandbox.payabli.com/api` (Sandbox, default) - `https://api.payabli.com/api` (Production) ## Request ### Path parameters - `amount` (double, required) — Amount to refund from original transaction, minus any service fees charged on the original transaction. The amount provided cannot be greater than the original total amount of the transaction, minus service fees. For example, if a transaction was $90 plus a $10 service fee, you can refund up to $90. An amount equal to zero will refund the total amount authorized minus any service fee. - `transId` (string, required) — ReferenceId for the transaction (PaymentId). ## Response ### 200 Ok - `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure. - `pageIdentifier` (string, optional) — Auxiliary validation used internally by payment pages and components. - `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/api-reference/api-responses). - `responseData` (ResponseDataRefunds, optional) - `responseText` (string, optional) — Response text for operation: 'Success' or 'Declined'. ## Errors ### 400 Bad Request Error Bad request/ invalid data - `any` ### 401 Unauthorized Error Unauthorized request. - `any` ### 500 Internal Server Error Internal API Error - `any` ### 503 Service Unavailable Error Database connection error - `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure. - `responseData` (map from string to any, optional) — The object containing the response data. - `responseText` (string, optional) — Response text for operation: 'Success' or 'Declined'. ## Types ### ResponseDataRefunds - `authCode` (string, optional) — Authorization code for the transaction. - `avsResponseText` (string, optional) — This field is not applicable to refund operations. - `customerId` (long, optional) — The Payabli-generated unique ID for the customer. - `cvvResponseText` (string, optional) — This field is not applicable to refund operations. - `expectedProcessingDateTime` (datetime, optional) — The expected time that the refund will be processed. This value only appears when the `resultCode` is `10`, which means that the refund has been initiated and is queued for processing. See [Enhanced Refund Flow](/guides/pay-in-enhanced-refund-flow) for more information about refund processing. - `methodReferenceId` (string, optional) — This field is not applicable to refund operations. - `referenceId` (string, optional) — The transaction identifier in Payabli. - `resultCode` (integer, optional) — Result code for the operation. Value 1 indicates a successful operation, values 2 and 3 indicate errors. A value of 10 indicates that an operation has been initiated and is pending. - `resultText` (string, optional) — Text description of the transaction result ## Examples ### Initiated **Response** ```json { "isSuccess": true, "responseCode": 1, "responseData": { "authCode": "A0000", "expectedProcessingDateTime": "2026-02-15T10:30:00Z", "referenceId": "10-3ffa27df-b171-44e0-b251-e95fbfc7a723", "resultCode": 10, "resultText": "INITIATED" }, "responseText": "Success" } ``` **SDK Code** ```python Initiated import requests url = "https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/0" headers = {"requestToken": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript Initiated const url = 'https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/0'; const options = {method: 'GET', headers: {requestToken: ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Initiated package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/0" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("requestToken", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Initiated require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/0") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java Initiated import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/0") .header("requestToken", "") .asString(); ``` ```php Initiated request('GET', 'https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/0', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```csharp Initiated using RestSharp; var client = new RestClient("https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/0"); var request = new RestRequest(Method.GET); request.AddHeader("requestToken", ""); IRestResponse response = client.Execute(request); ``` ```swift Initiated import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/0")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Captured **Response** ```json { "isSuccess": true, "responseCode": 1, "responseData": { "authCode": "A0000", "referenceId": "10-3ffa27df-b171-44e0-b251-e95fbfc7a723", "resultCode": 1, "resultText": "CAPTURED" }, "responseText": "Success" } ``` **SDK Code** ```python Captured import requests url = "https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/100.99" headers = {"requestToken": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript Captured const url = 'https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/100.99'; const options = {method: 'GET', headers: {requestToken: ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Captured package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/100.99" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("requestToken", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Captured require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/100.99") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java Captured import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/100.99") .header("requestToken", "") .asString(); ``` ```php Captured request('GET', 'https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/100.99', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```csharp Captured using RestSharp; var client = new RestClient("https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/100.99"); var request = new RestRequest(Method.GET); request.AddHeader("requestToken", ""); IRestResponse response = client.Execute(request); ``` ```swift Captured import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723/100.99")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` > If you're a software company, you're a payments company™