For the complete documentation index, see llms.txt. This page is also available as Markdown.

Save Payments Trigger

Create or update a payments trigger.

A payments trigger runs an action automatically on order events β€” for example sending a receipt email when an order is paid. It fires on OnOrderCreated, OnOrderPaid, or OnWebhookCallReceived; the optional integrations and events fields narrow which payment integrations and webhook events it reacts to. This method creates the trigger (or updates it when you pass an existing triggerId); the response returns its id.

This method is on the Hub surface (norbix.hub.payments) β€” call it from admin tooling or IaC.

These examples assume the SDK is installed and your credentials are set as environment variables β€” each client reads them automatically, so the constructors below take no arguments. See Install a Norbix SDK.

import { Norbix } from '@norbix.ai/ts';
const norbix = new Norbix();

const result = await norbix.hub.payments.savePaymentsTrigger({
  trigger: {
    type: 'Payments',
    when: 'OnOrderPaid',
    name: 'receipt-on-payment',
    isEnabled: true,
    action: {
      type: 'email',
      templateId: 'tmpl_5XqvoF4k6I2GfarDBg3zqq',
      deliverySettings: { recipientsSourceType: 'AllUsers' },
    },
  },
});
using Norbix.Sdk;
using Norbix.Sdk.Types.Hub;

using var client = new NorbixClient();

var result = await client.Payments.SavePaymentsTriggerAsync(new SavePaymentsTrigger
{
    Trigger = new PaymentTriggerRequest
    {
        Type = TriggerType.Payments,
        When = PaymentTriggerType.OnOrderPaid,
        Name = "receipt-on-payment",
        IsEnabled = true,
        Action = new TriggerActionEmailDto
        {
            Type = TriggerActionType.Email,
            TemplateId = "tmpl_5XqvoF4k6I2GfarDBg3zqq",
            DeliverySettings = new EmailToAllUsersDeliverySettingsDto
            {
                RecipientsSourceType = EmailCampaignRecipientsSourceTypes.AllUsers,
            },
        },
    },
});

Scenarios

The examples above send an email to all users. The action object is where the behaviour lives β€” here is one working example for every action type (JavaScript; the structure is identical in the other SDKs, only syntax changes as in the tabs above).

Email specific users

Send a templated email to chosen project users when an order is paid.

Email raw addresses

Send the email to fixed addresses (an ops inbox, an external partner) instead of project users.

Push notification to all users

Send a mobile push from a push template to every user when an order is paid.

SMS to phone numbers

Send a text message to fixed phone numbers.

Call a webhook

Publish the event to your configured webhook destinations. Destinations (URLs, secrets) are managed in the Webhooks module; here you only pick which ones receive it.

Run a function

Execute one of your functions from the Code module with the event as input.

Send a realtime (SSE) event

Push a server-sent event to connected clients β€” for live UI updates.

Run a marketplace function

Fire an installed marketplace function; payload passes extra static values.

For every field of every shape (CC/BCC, campaign timing, timezone settings, token mappings, collection-based audiences), see the API reference. More runnable examples live in the SDK repos on GitHub.

In the dashboard

Manage this visually in Norbix Cloud β€” see Payments β†’ Triggers.

API reference

Full request and response for this endpoint: Save Payments Trigger.

Last updated