Cadastrar webhook
curl --request POST \
--url https://api.ephra.io/v1/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048",
"events": [
"transaction_created",
"transaction_paid"
]
}
'import requests
url = "https://api.ephra.io/v1/webhook"
payload = {
"url": "https://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048",
"events": ["transaction_created", "transaction_paid"]
}
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://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048',
events: ['transaction_created', 'transaction_paid']
})
};
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://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048',
'events' => [
'transaction_created',
'transaction_paid'
]
]),
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://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\"\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://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\"\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://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 21,
"name": null,
"isActive": true,
"signatureSecret": "0507734bb82af3853f45c049e9c47c65a7c398367b7f57efdc435315a0f196efaac1bd2f75db4e9ab74203b41cbd96c72f98b4ed017cfa0f74f9ff3285f62ada",
"url": "https://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048",
"events": [
"transaction_created",
"transaction_paid"
],
"productIds": [],
"createdAt": "2026-09-12T06:29:57.352Z"
}
}{
"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://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048",
"events": [
"transaction_created",
"transaction_paid"
]
}
'import requests
url = "https://api.ephra.io/v1/webhook"
payload = {
"url": "https://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048",
"events": ["transaction_created", "transaction_paid"]
}
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://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048',
events: ['transaction_created', 'transaction_paid']
})
};
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://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048',
'events' => [
'transaction_created',
'transaction_paid'
]
]),
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://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\"\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://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\"\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://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048\",\n \"events\": [\n \"transaction_created\",\n \"transaction_paid\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 21,
"name": null,
"isActive": true,
"signatureSecret": "0507734bb82af3853f45c049e9c47c65a7c398367b7f57efdc435315a0f196efaac1bd2f75db4e9ab74203b41cbd96c72f98b4ed017cfa0f74f9ff3285f62ada",
"url": "https://erp.minhaloja.com.br/integracoes/ephra/9f3c1a7e5b2d48c0a6e1f7b93d5c2048",
"events": [
"transaction_created",
"transaction_paid"
],
"productIds": [],
"createdAt": "2026-09-12T06:29:57.352Z"
}
}{
"statusCode": 400,
"error": "Bad Request",
"message": "Documento inválido para o tipo selecionado"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Token inválido ou expirado"
}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
