Pay Ops cookbook

Quickstart recipes for operations, reporting, and notifications
View as MarkdownOpen in Claude
Applies to:DevelopersPartnersPaypoints

Use these recipes to get started with Pay Ops features and functions. See Pay Ops overview for more.

New to the API? Start with the authentication guide on the cookbooks home.

Recipe: Subscribe to webhooks

/// Overview

Register a webhook so Payabli notifies your server in real time when an event occurs. This recipe creates a single subscription for one event type.

/// Prerequisites

Before you start, make sure you have the following:

  • A publicly accessible URL that accepts POST requests. Supported ports are 80, 443, 8080, and 4443. For local development, see the webhook quickstart for tunneling setup.
  • An eventType to subscribe to. See the webhook payloads reference for all available events.
  • The ownerId of the paypoint or organization that owns the notification, plus its matching ownerType: 0 for organization or 2 for paypoint.

/// Step 1: Create the webhook subscription

Register the webhook with Payabli. Set method to web and target to your server’s public URL.

Send a POST request to /api/Notification.

$curl -X POST "https://api.payabli.com/api/Notification" \
> -H "Content-Type: application/json" \
> -H "requestToken: YOUR_API_TOKEN" \
> -d '{
> "content": {
> "eventType": "ApprovedPayment"
> },
> "frequency": "untilcancelled",
> "method": "web",
> "ownerId": 236,
> "ownerType": 0,
> "status": 1,
> "target": "https://your-server.example.com/webhook"
> }'

The response returns the notificationId in responseData. Save this — you need it to update or delete the subscription later.

1{
2 "isSuccess": true,
3 "responseCode": 1,
4 "responseData": 1717,
5 "responseText": "Success"
6}

See Create notification for the full API reference.

/// What’s next

You’re now subscribed. Trigger the event to see a payload land on your server. Learn more about webhook payloads and managing notifications.