Skip to content

Registrar Webhook

Endpoints para crear, listar y eliminar webhooks de notificacion.


Crear Webhook

POST /api/external/webhooks

Headers

HeaderTipoObligatorioDescripcion
AuthorizationStringSiApiKey {client_id}:{client_secret}
Content-TypeStringSiapplication/json
hmacStringSiFirma HMAC-SHA512 del body (mas informacion)

Request Body

CampoTipoObligatorioPor defectoDescripcion
urlStringSi--URL para recibir notificaciones (HTTPS por defecto)
eventsArrayNotodosLista de eventos a suscribir. Si se omite, suscribe a todos.
allow_insecurebooleanNofalsePermite URLs HTTP (no-HTTPS). La seguridad de los datos es responsabilidad del cliente.

Eventos disponibles: pix.charge.created, pix.charge.paid, pix.charge.expired, pix.payout.created, pix.payout.confirmed, pix.payout.failed, pix.payout.returned, pix.refund.requested, pix.refund.completed, pix.return.received, webhook.test

Ejemplo

bash
BODY='{"url":"https://sudominio.com/webhook","events":["pix.charge.paid","pix.payout.confirmed"]}'
HMAC=$(echo -n "$BODY" | openssl dgst -sha512 -hmac "$CLIENT_SECRET" | awk '{print $2}')

curl -X POST https://api.owem.com.br/api/external/webhooks \
  -H "Authorization: ApiKey $CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -H "hmac: $HMAC" \
  -d "$BODY"

Respuesta Exitosa (201)

json
{
  "worked": true,
  "webhook": {
    "id": "wh_a1b2c3d4e5f6",
    "url": "https://sudominio.com/webhook",
    "events": ["pix.charge.paid", "pix.payout.confirmed"],
    "status": "active",
    "created_at": "2026-03-07T15:30:00Z"
  }
}

Respuesta de Error (422)

json
{
  "worked": false,
  "detail": "La URL debe usar HTTPS"
}

Solo HTTPS por Defecto

La URL del webhook debe usar HTTPS. Las URLs con HTTP seran rechazadas, a menos que se envie allow_insecure: true al registrar el webhook.

URLs HTTP

Por defecto, los webhooks requieren HTTPS para garantizar la seguridad de los datos en transito. Para utilizar HTTP, active la opcion allow_insecure: true al registrar el webhook.

Atencion

Las URLs HTTP transmiten datos sin cifrado. La seguridad y confidencialidad de la informacion transmitida es responsabilidad exclusiva del cliente. Owem Pay realizara la entrega del webhook normalmente, pero no se responsabiliza por la interceptacion o fuga de datos en conexiones no cifradas.


Listar Webhooks

GET /api/external/webhooks

Headers

HeaderTipoObligatorioDescripcion
AuthorizationStringSiApiKey {client_id}:{client_secret}

Ejemplo

bash
curl -X GET https://api.owem.com.br/api/external/webhooks \
  -H "Authorization: ApiKey $CLIENT_ID:$CLIENT_SECRET"

Respuesta Exitosa (200)

json
{
  "worked": true,
  "webhooks": [
    {
      "id": "wh_a1b2c3d4e5f6",
      "url": "https://sudominio.com/webhook",
      "events": ["pix.charge.paid", "pix.payout.confirmed"],
      "status": "active",
      "created_at": "2026-03-07T15:30:00Z"
    }
  ]
}

Eliminar Webhook

DELETE /api/external/webhooks/:id

Headers

HeaderTipoObligatorioDescripcion
AuthorizationStringSiApiKey {client_id}:{client_secret}

Parametros de Ruta

ParametroTipoObligatorioDescripcion
idStringSiID del webhook

Ejemplo

bash
curl -X DELETE https://api.owem.com.br/api/external/webhooks/wh_a1b2c3d4e5f6 \
  -H "Authorization: ApiKey $CLIENT_ID:$CLIENT_SECRET"

Respuesta Exitosa (200)

json
{
  "worked": true
}

Respuesta de Error (404)

json
{
  "worked": false,
  "detail": "Webhook no encontrado"
}

Owem Pay Instituição de Pagamento — ISPB 37839059