Developers Guides Webhooks & Notifications

Webhooks & Notifications

Receive real-time event notifications via webhooks, email, Slack, and SFTP. Subscribe to payment events and settlement reports for merchants and partners.

Online API Webhooks Notifications Events

Overview

Surfboard Payments provides two mechanisms for receiving real-time updates about payment events:

  1. Callback URL (webhook): A per-order webhook URL that receives HTTP callbacks for order and payment state changes.
  2. Notification subscriptions: Persistent subscriptions for merchants or partners that deliver event notifications via email, Slack, or SFTP.

Use callback URLs for immediate, order-level status updates during checkout. Use notification subscriptions for ongoing operational alerts such as daily settlement reports.

Callback URL (Per-Order Webhook)

When creating an order, set controlFunctions.callBackUrl to receive webhook callbacks for that order’s payment lifecycle events.

POST /merchants/:merchantId/orders
{
  "terminal$id": "YOUR_TERMINAL_ID",
  "orderLines": [ ... ],
  "controlFunctions": {
    "callBackUrl": "https://your-server.com/webhooks/payments",
    "initiatePaymentsOptions": {
      "paymentMethod": "CARD"
    }
  }
}

The callBackUrl is a dynamic callback URL that Surfboard uses to perform webhook calls relating to the order and payment. Your endpoint should return a 200 status code to acknowledge receipt.

Notification Subscriptions

For persistent, account-wide notifications, subscribe to events at the merchant or partner level. Each subscription supports multiple delivery channels: email, Slack, and SFTP.

Subscribe to Merchant Report Notifications

POST /merchants/:merchantId/notifications/reports
{
  "event": "DAILY_FILE_TRANSFER",
  "email": "finance@yourcompany.com",
  "slackUrl": "https://hooks.slack.com/services/T00/B00/xxx"
}

You must provide at least one delivery channel (email, slackUrl, or sftpInfo). You can include multiple channels in a single request.

Response:

{
  "status": "SUCCESS",
  "data": [
    {
      "notificationId": "abc123",
      "NotificationChannel": "EMAIL"
    },
    {
      "notificationId": "def456",
      "NotificationChannel": "SLACK"
    }
  ],
  "message": "Notification subscription created successfully"
}

Subscribe to Partner Notifications

Partners use the same structure with the partner endpoint:

POST /partners/:partnerId/notifications/reports
{
  "event": "DAILY_FILE_TRANSFER",
  "email": "ops@partner.com"
}

SFTP Delivery Channel

For automated file-based delivery (such as settlement CSVs), include sftpInfo:

{
  "event": "DAILY_FILE_TRANSFER",
  "sftpInfo": {
    "host": "sftp.yourserver.com",
    "user": "surfboard-reports",
    "port": 22,
    "remoteDirectory": "/reports/daily",
    "separator": ","
  }
}

The response includes a publicKey for SFTP channels. Add this key to your SFTP server’s authorized keys to allow Surfboard to deliver files.

Fetching Existing Subscriptions

Retrieve all configured notification subscriptions for a merchant or partner:

GET /merchants/:merchantId/notifications
GET /partners/:partnerId/notifications

Both endpoints support optional query parameters: event, notificationChannel, and notificationId.

{
  "status": "SUCCESS",
  "data": [
    {
      "notificationId": "abc123",
      "event": "DAILY_FILE_TRANSFER",
      "notificationChannel": "EMAIL",
      "address": { "email": "finance@yourcompany.com" },
      "status": "ACTIVE"
    }
  ]
}

Unsubscribing from Notifications

Remove a subscription by its ID:

DELETE /merchants/:merchantId/notifications/:notificationId
DELETE /partners/:partnerId/notifications/:notificationId

Best Practices

  • Return 200 quickly. Process webhook payloads asynchronously. Return a 200 response before performing business logic to avoid timeouts.
  • Handle retries. Surfboard may retry failed deliveries. Use the orderId or notificationId to deduplicate and ensure idempotent processing.
  • Verify the source. Validate incoming webhook requests against expected IP ranges or signatures to prevent spoofed callbacks.
  • Monitor subscriptions. Periodically fetch your active subscriptions with the GET endpoint to confirm they are still active and correctly configured.
  • Use HTTPS. Always use HTTPS URLs for callback URLs and Slack webhook URLs to protect data in transit.
  • Store notification IDs. Save the notificationId returned when subscribing — you need it to unsubscribe or filter notifications later.

API Reference

ActionMethodEndpoint
Set per-order webhookPOST/merchants/:merchantId/orders (via controlFunctions.callBackUrl)
Subscribe merchant reportsPOST/merchants/:merchantId/notifications/reports
Subscribe partner reportsPOST/partners/:partnerId/notifications/reports
Fetch merchant notificationsGET/merchants/:merchantId/notifications
Fetch partner notificationsGET/partners/:partnerId/notifications
Unsubscribe merchantDELETE/merchants/:merchantId/notifications/:notificationId
Unsubscribe partnerDELETE/partners/:partnerId/notifications/:notificationId

Other Guides

in-store

Tap to Pay on iPhone SDK

Accept contactless payments directly on iPhone. Complete integration guide for Surfboard's iOS SoftPOS SDK -- from setup to production.

in-store

Android SoftPOS SDK

Turn Android devices into payment terminals with the Surfboard Android SoftPOS SDK. Complete integration guide from setup to production.

in-store

EMV Terminal Integration

Integrate traditional card-present terminals through Surfboard's unified API. From account setup to live payments in one guide.

online

Payment Page

Redirect customers to a Surfboard-hosted checkout page. The fastest way to accept online payments with minimal integration effort.

in-store

Inter-App Integration

Integrate your POS app with CheckoutX using native app switch. Register terminals, process payments, and scan NFC tags through a bi-directional deep link flow.

online

Self-Hosted Checkout

Embed a payment form directly in your web app with the Surfboard Online SDK. Full UI control with Surfboard handling PCI compliance.

online

Server-to-Server API

Process online payments entirely from your backend with Merchant Initiated Transactions. Full control over recurring payments, subscriptions, and tokenized card flows.

online

Create an Order

Learn how to create orders with line items, tax, customer details, and control functions. The starting point for accepting payments with the Surfboard API.

online

Merchant Onboarding

Set up merchants and stores on the Surfboard platform. Walk through the full onboarding flow from merchant creation to KYB completion and store setup.

online

Payment Lifecycle

Manage the full payment lifecycle from order creation through capture, void, cancel, and refund operations using the Surfboard Payments API.

online

Capture a Payment

Finalize a previously authorized payment by capturing funds. Covers delay capture and pre-authorization flows with step-by-step API examples.

in-store

Terminal & Device Management

Manage payment terminals and devices via the Surfboard API. Register in-store and online terminals, configure settings, and handle device operations.

online

Cancel a Payment

Stop an in-progress payment before it completes. Use cancellation when a customer abandons checkout or a payment needs to be halted mid-process.

online

Recurring Payments

Implement subscription billing and recurring charges using tokenization, recurring payment configuration, and Merchant Initiated Transactions.

online

Void a Payment

Reverse a completed payment before settlement. Voiding stops funds from transferring to the merchant's account, avoiding incorrect transactions.

in-store

Receipts

Generate, email, print, and customise receipts for in-store transactions using the Surfboard Receipts API.

online

Refund an Order

Process a full refund by creating a return order with negative quantities. Covers the complete refund flow with API examples and payment method requirements.

online

Partial Refund

Refund specific items or a reduced amount from a completed order. Process partial returns by creating a return order with only the items to be refunded.

in-store

Tips Configuration

Configure tipping on Surfboard payment terminals at the merchant, store, or terminal level using a hierarchical override model.

in-store

NFC Tag Reading

Use the NFC Reading API to create tag-reading sessions on payment terminals, scan NFC/RFID-tagged products, and retrieve scanned tag data.

online

Partial Payments

Split an order across multiple payment methods or transactions. Accept card, cash, and Swish in any combination to settle a single order.

in-store

Multi-Merchant Terminals

Set up shared payment terminals for multiple merchants using the Multi-Merchant Group API. Ideal for food courts, events, and co-located businesses.

online

Store Management

Create, update, verify, and manage in-store and online stores using the Surfboard Payments Store APIs.

online

Gift Cards & Promotions

Issue and manage gift cards, track transactions, and create marketing promotions using the Surfboard Payments APIs.

online

Product Catalog

Create and manage product catalogs, products, variants, inventory levels, and analytics through the Catalog API.

online

Settlements & Reporting

Retrieve settlement reports, view adjustments, manage merchant charges, and register customer profiles for reconciliation and billing.

online

Account & Service Provider Management

Create merchant and partner accounts, manage user roles, register service providers, and configure external notifications via the Surfboard API.

online

Payment Methods

Activate, deactivate, and list payment methods for a merchant. Manage card, Swish, Klarna, AMEX, Vipps, MobilePay, and more via the API or Partner Portal.

online

Client Auth Tokens

Generate client-side authentication tokens for secure API access from browsers and mobile apps without exposing your API key or secret.

online

Partner Branding

Configure white-label branding for terminals and payment pages. Set colors, fonts, logos, and cover images at the partner level via API or Partner Portal.

Ready to get started?

Create a sandbox account and start building your integration today.