Skip to main content
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>"
  ]
}
'
{
  "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"
  }
}
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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
url
string<uri>
required
Example:

"https://seusite.com/webhooks/ephra"

events
enum<string>[]
required
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"
]
name
string | null
Example:

"Produção"

isActive
boolean
default:true
productIds
string[]

Limita o webhook a produtos específicos. Omitido = todos.

Response

Webhook criado

success
boolean
Example:

true

data
object