Pular para o conteúdo principal
POST
/
v1
/
webhooks
/
refunds
Processar devolução Pix iniciada pelo banco recebedor
curl --request POST \
  --url https://plugin-pix-direct.api.lerian.net/v1/webhooks/refunds \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "endToEndIdDevolucao": "<string>",
  "endToEndIdOriginal": "<string>",
  "idReqJdPi": "<string>",
  "valor": 123,
  "codigoDevolucao": "<string>",
  "infEntreClientes": "<string>",
  "motivoDevolucao": "<string>"
}
'
import requests

url = "https://plugin-pix-direct.api.lerian.net/v1/webhooks/refunds"

payload = {
"endToEndIdDevolucao": "<string>",
"endToEndIdOriginal": "<string>",
"idReqJdPi": "<string>",
"valor": 123,
"codigoDevolucao": "<string>",
"infEntreClientes": "<string>",
"motivoDevolucao": "<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({
endToEndIdDevolucao: '<string>',
endToEndIdOriginal: '<string>',
idReqJdPi: '<string>',
valor: 123,
codigoDevolucao: '<string>',
infEntreClientes: '<string>',
motivoDevolucao: '<string>'
})
};

fetch('https://plugin-pix-direct.api.lerian.net/v1/webhooks/refunds', 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/webhooks/refunds",
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([
'endToEndIdDevolucao' => '<string>',
'endToEndIdOriginal' => '<string>',
'idReqJdPi' => '<string>',
'valor' => 123,
'codigoDevolucao' => '<string>',
'infEntreClientes' => '<string>',
'motivoDevolucao' => '<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/webhooks/refunds"

payload := strings.NewReader("{\n \"endToEndIdDevolucao\": \"<string>\",\n \"endToEndIdOriginal\": \"<string>\",\n \"idReqJdPi\": \"<string>\",\n \"valor\": 123,\n \"codigoDevolucao\": \"<string>\",\n \"infEntreClientes\": \"<string>\",\n \"motivoDevolucao\": \"<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/webhooks/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endToEndIdDevolucao\": \"<string>\",\n \"endToEndIdOriginal\": \"<string>\",\n \"idReqJdPi\": \"<string>\",\n \"valor\": 123,\n \"codigoDevolucao\": \"<string>\",\n \"infEntreClientes\": \"<string>\",\n \"motivoDevolucao\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://plugin-pix-direct.api.lerian.net/v1/webhooks/refunds")

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 \"endToEndIdDevolucao\": \"<string>\",\n \"endToEndIdOriginal\": \"<string>\",\n \"idReqJdPi\": \"<string>\",\n \"valor\": 123,\n \"codigoDevolucao\": \"<string>\",\n \"infEntreClientes\": \"<string>\",\n \"motivoDevolucao\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "dtHrCreditoSgct": "<string>",
  "dtHrValidacao": "<string>",
  "idCreditoSgct": "<string>",
  "idReqJdPi": "<string>",
  "motivo": "<string>",
  "motivoComplemento": "<string>",
  "resultado": 123
}
{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}

Autorizações

Authorization
string
header
obrigatório

Autenticacao por token JWT Bearer. Obtenha o token no endpoint /v1/login/oauth/access_token usando credenciais do cliente (clientId e clientSecret).

Inclua o token no header Authorization: Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

O token expira apos 3600 segundos (1 hora).

Corpo

application/json
endToEndIdDevolucao
string
obrigatório

Id de retorno atribuído pelo upstream (chave de idempotência + dedup).

endToEndIdOriginal
string
obrigatório

Id ponta a ponta do CASH_OUT original.

idReqJdPi
string
obrigatório

Id da requisição upstream (GUID), ecoado no reconhecimento.

valor
number<double>
obrigatório

Valor de retorno em reais (um número JSON).

codigoDevolucao
string

Código de motivo de retorno (eRefundCode).

infEntreClientes
string

Informação inter-clientes em texto livre.

motivoDevolucao
string

Motivo de retorno em texto livre.

Resposta

OK

dtHrCreditoSgct
string

carimbo de data/hora de crédito do gateway de liquidação (ISO-8601).

dtHrValidacao
string

Data/hora da validação (ISO-8601).

idCreditoSgct
string

id de crédito do gateway de liquidação.

idReqJdPi
string

Id da requisição upstream ecoado.

motivo
string

Código de motivo (em um retorno rejeitado).

motivoComplemento
string

Complemento do motivo.

resultado
integer<int64>

Resultado da validação (0=Inválido, 1=Válido).