Skip to main content

The webhook object

A webhook is a callback configuration that tells Orafi where to deliver event notifications. Each business profile can have one active webhook.
id
string
Unique identifier for the webhook configuration.
url
string
Publicly accessible HTTPS endpoint that receives event payloads.
secret
string
Shared secret used to sign webhook payloads. Use this to verify that incoming requests originate from Orafi.
events
string[]
Event types the webhook is subscribed to. Only listed events are delivered.
createdAt
datetime
When the webhook was created.
updatedAt
datetime
When the webhook was last updated.
profileId
string
Business profile that owns this webhook.

Available event types

EventDescription
payment.successA payment was completed successfully
payment.failedA payment attempt failed
{
  "id": "cmjh39i5x0000v814e7owtybc",
  "url": "https://yourapp.com/webhooks/orafi",
  "secret": "whsec_a79ab7ad5d9ae565...1bcb3",
  "events": ["payment.success", "payment.failed"],
  "createdAt": "2025-12-22T11:44:41.780Z",
  "updatedAt": "2025-12-22T11:44:41.780Z",
  "profileId": "84a9f045-8a21-4ce4-a7a0-828265c0021b"
}

Get webhook details

GET /webhook
Returns the current webhook configuration for the authenticated profile.
curl -X GET https://api.orafi.app/webhook \
  -H "x-api-key: ora_test_your_api_key"

Get event types

GET /webhook/events
Returns all event types available for webhook subscriptions.
curl -X GET https://api.orafi.app/webhook/events \
  -H "x-api-key: ora_test_your_api_key"

Register a webhook

POST /webhook/register
Registers or updates the webhook endpoint for your business profile. Orafi generates a secret automatically that you can use to verify payloads.

Request body

url
string
required
Publicly accessible HTTPS URL to receive webhook events.
curl -X POST https://api.orafi.app/webhook/register \
  -H "Content-Type: application/json" \
  -H "x-api-key: ora_test_your_api_key" \
  -d '{
    "url": "https://yourapp.com/webhooks/orafi"
  }'

Subscribe to an event

POST /webhook/subscribe
Adds an event type to your existing webhook subscription.

Request body

event
string
required
The event type to subscribe to (e.g. payment.failed).
curl -X POST https://api.orafi.app/webhook/subscribe \
  -H "Content-Type: application/json" \
  -H "x-api-key: ora_test_your_api_key" \
  -d '{
    "event": "payment.failed"
  }'