Skip to content

Register Webhook

Endpoints to create, list, and remove notification webhooks.


Create Webhook

POST /api/v2/external/webhooks

Headers

HeaderTypeRequiredDescription
AuthorizationStringYesBearer {access_token}
Content-TypeStringYesapplication/json
hmacStringYesHMAC-SHA512 signature of the body (learn more)

Request Body

FieldTypeRequiredDescription
urlStringYesHTTPS URL to receive notifications
eventsArrayNoList of events to subscribe to. If omitted, subscribes to all.

Available events: pix.received, pix.completed, pix.failed, pix.refund, pix.med

Example

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

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

Success Response (201)

json
{
  "worked": true,
  "webhook": {
    "id": "wh_a1b2c3d4e5f6",
    "url": "https://yoursite.com/webhook",
    "events": ["pix.received", "pix.completed"],
    "status": "active",
    "created_at": "2026-03-07T15:30:00Z"
  }
}

Error Response (422)

json
{
  "worked": false,
  "detail": "URL must use HTTPS"
}

HTTPS only

The webhook URL must use HTTPS. URLs with HTTP will be rejected.


List Webhooks

GET /api/v2/external/webhooks

Headers

HeaderTypeRequiredDescription
AuthorizationStringYesBearer {access_token}

Example

bash
curl -X GET https://api.owem.com.br/api/v2/external/webhooks \
  -H "Authorization: Bearer $TOKEN"

Success Response (200)

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

Remove Webhook

DELETE /api/v2/external/webhooks/:id

Headers

HeaderTypeRequiredDescription
AuthorizationStringYesBearer {access_token}

Path Parameters

ParameterTypeRequiredDescription
idStringYesWebhook ID

Example

bash
curl -X DELETE https://api.owem.com.br/api/v2/external/webhooks/wh_a1b2c3d4e5f6 \
  -H "Authorization: Bearer $TOKEN"

Success Response (200)

json
{
  "worked": true
}

Error Response (404)

json
{
  "worked": false,
  "detail": "Webhook not found"
}

Owem Pay Instituição de Pagamento — ISPB 37839059