Skip to main content
POST
/
v1
/
med
/
refunds
/
{idSolDevolucao}
/
cancel
Cancel a MED refund request
curl --request POST \
  --url https://plugin-pix-direct.api.lerian.net/v1/med/refunds/{idSolDevolucao}/cancel \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "idempotencyKey": "<string>"
}
'
import requests

url = "https://plugin-pix-direct.api.lerian.net/v1/med/refunds/{idSolDevolucao}/cancel"

payload = { "idempotencyKey": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({idempotencyKey: '<string>'})
};

fetch('https://plugin-pix-direct.api.lerian.net/v1/med/refunds/{idSolDevolucao}/cancel', 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-direct.api.lerian.net/v1/med/refunds/{idSolDevolucao}/cancel",
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([
'idempotencyKey' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$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-direct.api.lerian.net/v1/med/refunds/{idSolDevolucao}/cancel"

payload := strings.NewReader("{\n \"idempotencyKey\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

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-direct.api.lerian.net/v1/med/refunds/{idSolDevolucao}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotencyKey\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://plugin-pix-direct.api.lerian.net/v1/med/refunds/{idSolDevolucao}/cancel")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"idempotencyKey\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "breached": true,
  "dtHrCriacao": "<string>",
  "dtHrUltModificacao": "<string>",
  "endToEndId": "<string>",
  "idSolDevolucao": "<string>",
  "ispbContestado": "<string>",
  "ispbSolicitante": "<string>",
  "motivo": 123,
  "motivoDescription": "<string>",
  "status": 123,
  "statusDescription": "<string>",
  "valorDevolucaoCents": 123,
  "analysisDeadline": "<string>",
  "detalhes": "<string>",
  "detalhesAnalise": "<string>",
  "endToEndIdDevolucao": "<string>",
  "idRecValores": "<string>",
  "idRelatoInfracao": "<string>",
  "motivoRejeicao": 123,
  "motivoRejeicaoDescription": "<string>",
  "resultadoAnalise": 123,
  "resultadoAnaliseDescription": "<string>",
  "valorDevolvidoCents": 123
}
{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}

Authorizations

Authorization
string
header
required

JWT Bearer token authentication. Obtain token from /v1/login/oauth/access_token endpoint using client credentials (clientId and clientSecret).

Include token in Authorization header: Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Token expires after 3600 seconds (1 hour).

Path Parameters

idSolDevolucao
string
required

The refund-request GUID.

Body

application/json
idempotencyKey
string
required

Business-derived idempotency key (Chave-Idempotencia).

Response

OK

breached
boolean
required

True when the analysis deadline has been reached or passed (computed at read time); false when no deadline is set.

dtHrCriacao
string
required

Upstream creation timestamp (RFC 3339 UTC).

dtHrUltModificacao
string
required

Upstream last-modification timestamp (RFC 3339 UTC) — the poll watermark.

endToEndId
string
required

EndToEndId of the contested payment or devolucao.

idSolDevolucao
string
required

Refund-request GUID (the natural key).

ispbContestado
string
required

ISPB of the contested PSP.

ispbSolicitante
string
required

ISPB of the requesting PSP.

motivo
integer<int64>
required

Refund motivo code (0=Falha Operacional, 1=Fraude, 3=Pix Automático).

motivoDescription
string
required

Human-readable refund motivo label.

status
integer<int64>
required

stSolDevolucao lifecycle code (0=Aberta, 1=Cancelada, 2=Analisada).

statusDescription
string
required

Human-readable stSolDevolucao label.

valorDevolucaoCents
integer<int64>
required

Requested refund amount, in centavos.

analysisDeadline
string

Contestado-side analysis deadline; null for filer-side and terminal requests.

detalhes
string

Free-text detail.

detalhesAnalise
string

Analysis detail.

endToEndIdDevolucao
string

pacs.004/pacs.008 devolucao reference, recorded at analysis.

idRecValores
string

Value-recovery GUID, when from a recovery.

idRelatoInfracao
string

Linked infraction GUID, when fraud.

motivoRejeicao
integer<int64>

Rejection reason (0,1,3,4); present only when the analysis rejected the request.

motivoRejeicaoDescription
string

Human-readable rejection-reason label.

resultadoAnalise
integer<int64>

Refund analysis result (0=Aceita Totalmente, 1=Aceita Parcialmente, 2=Rejeitada); null until analysed.

resultadoAnaliseDescription
string

Human-readable refund analysis-result label.

valorDevolvidoCents
integer<int64>

Amount actually refunded, in centavos; null when absent.