# Pay Ops cookbook

> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

> Quickstart recipes for operations, reporting, and notifications

<AudienceInfo audiences={["developers", "partners", "merchants"]} />

Use these recipes to get started with Pay Ops features and functions. See [Pay Ops overview](/guides/pay-ops-overview) for more.

New to the API? Start with the [authentication guide](/cookbooks/cookbooks-overview) on the cookbooks home.

<div class="sr-only">
  <h3>Recipe: Subscribe to webhooks</h3>
  /// 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](/guides/pay-ops-developer-webhooks-quickstart) for tunneling setup.
  * An `eventType` to subscribe to. See the [webhook payloads reference](/guides/pay-ops-webhooks-payloads) 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`.

  ```bash
  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.

  ```json highlight=4
  {
    "isSuccess": true,
    "responseCode": 1,
    "responseData": 1717,
    "responseText": "Success"
  }
  ```

  See [Create notification](/developers/api-reference/notification/add-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](/guides/pay-ops-webhooks-payloads) and [managing notifications](/guides/pay-ops-developer-notifications-manage).
</div>