Unblock a Pix Refund
curl --request POST \
--url https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-Id: <x-account-id>' \
--data '
{
"allowNotFoundUnblock": false
}
'import requests
url = "https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock"
payload = { "allowNotFoundUnblock": False }
headers = {
"X-Account-Id": "<x-account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Account-Id': '<x-account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({allowNotFoundUnblock: false})
};
fetch('https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'allowNotFoundUnblock' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Account-Id: <x-account-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock"
payload := strings.NewReader("{\n \"allowNotFoundUnblock\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Account-Id", "<x-account-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock")
.header("X-Account-Id", "<x-account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowNotFoundUnblock\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Account-Id"] = '<x-account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowNotFoundUnblock\": false\n}"
response = http.request(request)
puts response.read_body{
"refund": {
"id": "019c96a0-0c53-7a8d-8e29-67971d96d0e3",
"originalEndToEndId": "E123456789BR1234567890123456789",
"returnEndToEndId": "D123456789BR1234567890123456789",
"amount": "100.00",
"status": "COMPLETED",
"type": "CASHOUT",
"description": "Customer reported unauthorized transaction",
"accountId": "01989f9e-6508-79f8-9540-835be49fbd0d",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"ledger": {
"transactionId": "550e8400-e29b-41d4-a716-446655440011",
"sourceOperationId": "550e8400-e29b-41d4-a716-446655440012",
"destinationOperationId": "550e8400-e29b-41d4-a716-446655440013",
"revert": {
"transactionId": "550e8400-e29b-41d4-a716-446655440014",
"sourceOperationId": "550e8400-e29b-41d4-a716-446655440015",
"destinationOperationId": "550e8400-e29b-41d4-a716-446655440016"
}
},
"metadata": {}
},
"btgStatus": "CONFIRMED",
"message": "Reversal successfully unblocked."
}Unblock a Pix Refund
Use this endpoint to unblock a refund stuck in PROCESSING status. The plugin fetches the BTG reversal status and triggers settlement if the reversal has already completed or failed on BTG.
POST
/
v1
/
refunds
/
{refund_id}
/
unblock
Unblock a Pix Refund
curl --request POST \
--url https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-Id: <x-account-id>' \
--data '
{
"allowNotFoundUnblock": false
}
'import requests
url = "https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock"
payload = { "allowNotFoundUnblock": False }
headers = {
"X-Account-Id": "<x-account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Account-Id': '<x-account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({allowNotFoundUnblock: false})
};
fetch('https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'allowNotFoundUnblock' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Account-Id: <x-account-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock"
payload := strings.NewReader("{\n \"allowNotFoundUnblock\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Account-Id", "<x-account-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock")
.header("X-Account-Id", "<x-account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowNotFoundUnblock\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://plugin-pix-indirect.api.lerian.net/v1/refunds/{refund_id}/unblock")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Account-Id"] = '<x-account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowNotFoundUnblock\": false\n}"
response = http.request(request)
puts response.read_body{
"refund": {
"id": "019c96a0-0c53-7a8d-8e29-67971d96d0e3",
"originalEndToEndId": "E123456789BR1234567890123456789",
"returnEndToEndId": "D123456789BR1234567890123456789",
"amount": "100.00",
"status": "COMPLETED",
"type": "CASHOUT",
"description": "Customer reported unauthorized transaction",
"accountId": "01989f9e-6508-79f8-9540-835be49fbd0d",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"ledger": {
"transactionId": "550e8400-e29b-41d4-a716-446655440011",
"sourceOperationId": "550e8400-e29b-41d4-a716-446655440012",
"destinationOperationId": "550e8400-e29b-41d4-a716-446655440013",
"revert": {
"transactionId": "550e8400-e29b-41d4-a716-446655440014",
"sourceOperationId": "550e8400-e29b-41d4-a716-446655440015",
"destinationOperationId": "550e8400-e29b-41d4-a716-446655440016"
}
},
"metadata": {}
},
"btgStatus": "CONFIRMED",
"message": "Reversal successfully unblocked."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Unique identifier of the Midaz Ledger Account (UUID format).
Path Parameters
Unique identifier of the refund request (UUID format).
Body
application/json
Opts into the not-found resolution path for CASHOUT refunds. When true and BTG reports the reversal as absent (404), the refund is resolved as FAILED (with idempotent Midaz revert and client webhook) instead of returning a provider error.
Was this page helpful?
⌘I

