Cadastrar webhook
curl --request POST \
--url https://api.ephra.io/v1/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://seusite.com/webhooks/ephra",
"events": [
"transaction_created",
"transaction_paid",
"transaction_refunded"
],
"name": "Produção",
"isActive": true,
"productIds": [
"<string>"
]
}
'import requests
url = "https://api.ephra.io/v1/webhook"
payload = {
"url": "https://seusite.com/webhooks/ephra",
"events": ["transaction_created", "transaction_paid", "transaction_refunded"],
"name": "Produção",
"isActive": True,
"productIds": ["<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({
url: 'https://seusite.com/webhooks/ephra',
events: ['transaction_created', 'transaction_paid', 'transaction_refunded'],
name: 'Produção',
isActive: true,
productIds: ['<string>']
})
};
fetch('https://api.ephra.io/v1/webhook', 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.ephra.io/v1/webhook",
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://seusite.com/webhooks/ephra',
'events' => [
'transaction_created',
'transaction_paid',
'transaction_refunded'
],
'name' => 'Produção',
'isActive' => true,
'productIds' => [
'<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://api.ephra.io/v1/webhook"
payload := strings.NewReader("{\n \"url\": \"https://seusite.com/webhooks/ephra\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\",\n \"transaction_refunded\"\n ],\n \"name\": \"Produção\",\n \"isActive\": true,\n \"productIds\": [\n \"<string>\"\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.ephra.io/v1/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://seusite.com/webhooks/ephra\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\",\n \"transaction_refunded\"\n ],\n \"name\": \"Produção\",\n \"isActive\": true,\n \"productIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ephra.io/v1/webhook")
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://seusite.com/webhooks/ephra\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\",\n \"transaction_refunded\"\n ],\n \"name\": \"Produção\",\n \"isActive\": true,\n \"productIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 42,
"name": "Produção",
"isActive": true,
"signatureSecret": "a1b2c3...",
"url": "https://seusite.com/webhooks/ephra",
"events": [],
"productIds": [
"<string>"
],
"createdAt": "2026-06-03T12:00:00.000Z"
}
}{
"statusCode": 400,
"error": "Bad Request",
"message": "Documento inválido para o tipo selecionado"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Token inválido ou expirado"
}Webhooks
Cadastrar webhook
Cadastra um endpoint HTTPS para receber notificações de eventos. A URL é testada com um POST no momento do cadastro. Guarde o signatureSecret retornado.
POST
/
v1
/
webhook
Cadastrar webhook
curl --request POST \
--url https://api.ephra.io/v1/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://seusite.com/webhooks/ephra",
"events": [
"transaction_created",
"transaction_paid",
"transaction_refunded"
],
"name": "Produção",
"isActive": true,
"productIds": [
"<string>"
]
}
'import requests
url = "https://api.ephra.io/v1/webhook"
payload = {
"url": "https://seusite.com/webhooks/ephra",
"events": ["transaction_created", "transaction_paid", "transaction_refunded"],
"name": "Produção",
"isActive": True,
"productIds": ["<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({
url: 'https://seusite.com/webhooks/ephra',
events: ['transaction_created', 'transaction_paid', 'transaction_refunded'],
name: 'Produção',
isActive: true,
productIds: ['<string>']
})
};
fetch('https://api.ephra.io/v1/webhook', 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.ephra.io/v1/webhook",
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://seusite.com/webhooks/ephra',
'events' => [
'transaction_created',
'transaction_paid',
'transaction_refunded'
],
'name' => 'Produção',
'isActive' => true,
'productIds' => [
'<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://api.ephra.io/v1/webhook"
payload := strings.NewReader("{\n \"url\": \"https://seusite.com/webhooks/ephra\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\",\n \"transaction_refunded\"\n ],\n \"name\": \"Produção\",\n \"isActive\": true,\n \"productIds\": [\n \"<string>\"\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.ephra.io/v1/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://seusite.com/webhooks/ephra\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\",\n \"transaction_refunded\"\n ],\n \"name\": \"Produção\",\n \"isActive\": true,\n \"productIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ephra.io/v1/webhook")
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://seusite.com/webhooks/ephra\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\",\n \"transaction_refunded\"\n ],\n \"name\": \"Produção\",\n \"isActive\": true,\n \"productIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 42,
"name": "Produção",
"isActive": true,
"signatureSecret": "a1b2c3...",
"url": "https://seusite.com/webhooks/ephra",
"events": [],
"productIds": [
"<string>"
],
"createdAt": "2026-06-03T12:00:00.000Z"
}
}{
"statusCode": 400,
"error": "Bad Request",
"message": "Documento inválido para o tipo selecionado"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Token inválido ou expirado"
}Cadastra um endpoint HTTPS para receber notificações de eventos. A URL é testada com um
POST no momento do cadastro.
Guarde o
signatureSecret retornado — você precisa dele para validar a assinatura de cada webhook recebido.Veja todos os eventos disponíveis e seus payloads em Webhooks › Eventos.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Example:
"https://seusite.com/webhooks/ephra"
Available options:
transaction_created, transaction_paid, transaction_refunded, transaction_updated, transfer_created, transfer_completed, transfer_canceled, transfer_updated, infraction, card_declined, sale_lost, cart_abandoned, product_canceled Example:
[
"transaction_created",
"transaction_paid",
"transaction_refunded"
]
Example:
"Produção"
Limita o webhook a produtos específicos. Omitido = todos.
⌘I
