Skip to main content
POST
/
v1
/
med
/
infractions
/
{idRelatoInfracao}
/
analyze
Analyze a MED infraction
curl --request POST \
  --url https://plugin-pix-direct.api.lerian.net/v1/med/infractions/{idRelatoInfracao}/analyze \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "idempotencyKey": "<string>",
  "resultadoAnalise": 123,
  "detalhesAnalise": "<string>",
  "tpFraude": 123
}
'
import requests

url = "https://plugin-pix-direct.api.lerian.net/v1/med/infractions/{idRelatoInfracao}/analyze"

payload = {
"idempotencyKey": "<string>",
"resultadoAnalise": 123,
"detalhesAnalise": "<string>",
"tpFraude": 123
}
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>',
resultadoAnalise: 123,
detalhesAnalise: '<string>',
tpFraude: 123
})
};

fetch('https://plugin-pix-direct.api.lerian.net/v1/med/infractions/{idRelatoInfracao}/analyze', 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/infractions/{idRelatoInfracao}/analyze",
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>',
'resultadoAnalise' => 123,
'detalhesAnalise' => '<string>',
'tpFraude' => 123
]),
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/infractions/{idRelatoInfracao}/analyze"

payload := strings.NewReader("{\n \"idempotencyKey\": \"<string>\",\n \"resultadoAnalise\": 123,\n \"detalhesAnalise\": \"<string>\",\n \"tpFraude\": 123\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/infractions/{idRelatoInfracao}/analyze")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotencyKey\": \"<string>\",\n \"resultadoAnalise\": 123,\n \"detalhesAnalise\": \"<string>\",\n \"tpFraude\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://plugin-pix-direct.api.lerian.net/v1/med/infractions/{idRelatoInfracao}/analyze")

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 \"resultadoAnalise\": 123,\n \"detalhesAnalise\": \"<string>\",\n \"tpFraude\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "dtHrCriacao": "<string>",
  "dtHrUltModificacao": "<string>",
  "endToEndId": "<string>",
  "idRelatoInfracao": "<string>",
  "motivo": 123,
  "motivoDescription": "<string>",
  "pspContraParte": "<string>",
  "pspCriador": "<string>",
  "status": 123,
  "statusDescription": "<string>",
  "tpSitOrigem": 123,
  "tpSitOrigemDescription": "<string>",
  "detalhes": "<string>",
  "detalhesAnalise": "<string>",
  "idMarcacaoFraude": "<string>",
  "idRecValores": "<string>",
  "resultadoAnalise": 123,
  "resultadoAnaliseDescription": "<string>",
  "vlrInfracaoCents": 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

idRelatoInfracao
string
required

The infraction GUID.

Body

application/json
idempotencyKey
string
required

Business-derived idempotency key (Chave-Idempotencia).

resultadoAnalise
integer<int64>
required

Infraction analysis result (0=Aceita, 1=Rejeitada).

detalhesAnalise
string

Analysis detail.

tpFraude
integer<int64>

Fraud-type code (0..4); required when resultadoAnalise=0 (Aceita).

Response

OK

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 suspect payment.

idRelatoInfracao
string
required

Infraction GUID (the natural key).

motivo
integer<int64>
required

Infraction motivo code (1=Solicitacao de devolucao, 2=Cancelamento da devolucao).

motivoDescription
string
required

Human-readable infraction motivo label.

pspContraParte
string
required

ISPB of the counterparty.

pspCriador
string
required

ISPB of the infraction creator.

status
integer<int64>
required

stRelatoInfracao lifecycle code (0=Aberto, 1=Recebido, 2=Cancelado, 3=Analisado).

statusDescription
string
required

Human-readable stRelatoInfracao label.

tpSitOrigem
integer<int64>
required

Situation-origin code (0..5).

tpSitOrigemDescription
string
required

Human-readable tpSitOrigem label.

detalhes
string

Free-text detail to help the recebedor analyse.

detalhesAnalise
string

Analysis detail.

idMarcacaoFraude
string

Fraud-marker GUID, when analysis produced one.

idRecValores
string

Value-recovery GUID, when the infraction came from a recovery.

resultadoAnalise
integer<int64>

Infraction analysis result (0=Aceita, 1=Rejeitada); null until analysed.

resultadoAnaliseDescription
string

Human-readable infraction analysis-result label.

vlrInfracaoCents
integer<int64>

Amount to block on the account, in centavos; null when absent.