Pular para o conteúdo principal
POST
/
api
/
webhooks
Configurar webhook da conta
curl --request POST \
  --url https://api.public.firebanking.com.br/api/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://api.example.com/webhooks/pix",
  "eventType": "cash_in",
  "headers": [
    {
      "key": "Authorization",
      "value": "Bearer token123"
    },
    {
      "key": "X-Webhook-Secret",
      "value": "abc123"
    }
  ]
}
'
import requests

url = "https://api.public.firebanking.com.br/api/webhooks"

payload = {
"url": "https://api.example.com/webhooks/pix",
"eventType": "cash_in",
"headers": [
{
"key": "Authorization",
"value": "Bearer token123"
},
{
"key": "X-Webhook-Secret",
"value": "abc123"
}
]
}
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({
url: 'https://api.example.com/webhooks/pix',
eventType: 'cash_in',
headers: [
{key: 'Authorization', value: 'Bearer token123'},
{key: 'X-Webhook-Secret', value: 'abc123'}
]
})
};

fetch('https://api.public.firebanking.com.br/api/webhooks', 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://api.public.firebanking.com.br/api/webhooks",
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([
'url' => 'https://api.example.com/webhooks/pix',
'eventType' => 'cash_in',
'headers' => [
[
'key' => 'Authorization',
'value' => 'Bearer token123'
],
[
'key' => 'X-Webhook-Secret',
'value' => 'abc123'
]
]
]),
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://api.public.firebanking.com.br/api/webhooks"

payload := strings.NewReader("{\n \"url\": \"https://api.example.com/webhooks/pix\",\n \"eventType\": \"cash_in\",\n \"headers\": [\n {\n \"key\": \"Authorization\",\n \"value\": \"Bearer token123\"\n },\n {\n \"key\": \"X-Webhook-Secret\",\n \"value\": \"abc123\"\n }\n ]\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://api.public.firebanking.com.br/api/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://api.example.com/webhooks/pix\",\n \"eventType\": \"cash_in\",\n \"headers\": [\n {\n \"key\": \"Authorization\",\n \"value\": \"Bearer token123\"\n },\n {\n \"key\": \"X-Webhook-Secret\",\n \"value\": \"abc123\"\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.public.firebanking.com.br/api/webhooks")

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 \"url\": \"https://api.example.com/webhooks/pix\",\n \"eventType\": \"cash_in\",\n \"headers\": [\n {\n \"key\": \"Authorization\",\n \"value\": \"Bearer token123\"\n },\n {\n \"key\": \"X-Webhook-Secret\",\n \"value\": \"abc123\"\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "message": "Webhook configurado com sucesso"
}

Autorizações

Authorization
string
header
obrigatório

Enter JWT token

Corpo

application/json
url
string<uri>
obrigatório

URL HTTPS do endpoint que receberá os webhooks. Deve usar protocolo HTTPS.

Exemplo:

"https://api.example.com/webhooks/pix"

eventType
enum<string>
obrigatório

Tipo de evento para receber notificações

Opções disponíveis:
cash_in,
cash_out,
refund_in,
refund_out
Exemplo:

"cash_in"

headers
object[]

Headers customizados para autenticação (máximo 5). Headers bloqueados: host, content-length, connection, transfer-encoding, content-type, user-agent

Maximum array length: 5
Exemplo:
[
{
"key": "Authorization",
"value": "Bearer token123"
},
{
"key": "X-Webhook-Secret",
"value": "abc123"
}
]

Resposta

Webhook configurado com sucesso

success
boolean
obrigatório

Indica se a operação foi bem-sucedida

Exemplo:

true

message
string
obrigatório

Mensagem descritiva do resultado

Exemplo:

"Webhook configurado com sucesso"