Subscribe to webhooks

Create and manage webhook subscriptions from the dashboard or over the API.

A webhook subscription pairs one endpoint URL with a list of events. Create one when you want Preczn to notify your system about changes instead of polling the API. The Dashboard and the API manage the same subscriptions, so you can create a subscription one way and edit it the other way.

A subscription has these values:

ValueRequiredDescription
Endpoint URLYesThe URL Preczn sends each notification to. Use HTTPS
EventsYesThe events to receive. See Webhook events
ActiveYesWhether the subscription delivers notifications
DescriptionNoA label for your own reference
Custom header and valueNoOne extra HTTP header sent with every notification

Preczn generates two more values that you can't set:

  • Subscription ID: starts with wh_ in Live mode and wh_test_ in Test mode.
  • Signing secret: signs every notification from this subscription. See Receive and verify webhooks.

Signing secrets don't rotate. A subscription keeps the same secret until you delete it.

📘

One subscription, one mode

A subscription receives events only from the mode it was created in. To receive the same events in Live and Test mode, create one subscription in each. See Live vs. test mode.


Creating a subscription

Choose how you'll create the subscription. Select the Dashboard tab or the API tab.

  1. Go to Settings → Webhooks.
  2. Select Create Webhook.
  3. In Details, enter the Endpoint URL. Optionally, enter a Description.
  4. Optionally, under Authorization, enter an HTTP Header and a Header Value. Preczn sends this header with every notification, so your endpoint can authenticate the request.
  5. Under Events, select the events to receive. The events are grouped in two sections, Merchant and Transactions & loans.
  6. Select Create Webhook.
Create Webhook CancelCreate Webhook
Details
*Endpoint URL
https://
Description
Add description of webhook endpoint…
Authorization
HTTP Header
[header]
Sent with every delivery for your server to authenticate.
Header Value
**********************
StatusActiveDeliveries are sent to this endpoint
Events
Merchant
Lifecycle
Createdmerchant.created
Updatedmerchant.updated
Deletedmerchant.deleted
Locations
Createdlocation.created
Updatedlocation.updated
Deletedlocation.deleted
Forms
Createdform.created
Startedform.started
Updatedform.updated
Completedform.completed
Expiredform.expired
Transactions & loans
Transactions
Approvedtransaction.approved
Pendingtransaction.pending
Declinedtransaction.declined
Erroredtransaction.errored
Loans
Createdloan.created
Updatedloan.updated

A subscription created in the Dashboard is active and starts delivering right away.

A new subscription receives only events that happen after you create it.


Editing or disabling a subscription

A disabled subscription keeps its ID, signing secret, and delivery history, but it receives nothing. Events that happen while it's disabled aren't delivered later. Choose how you'll change the subscription. Select the Dashboard tab or the API tab.

  1. Go to Settings → Webhooks.
  2. Do one of the following on the subscription's row:
    • To edit it, select Edit, change the values, and then select Save Changes. The Status switch on the same page turns the subscription on or off.
    • To turn it off or on, open the row's actions menu, select Disable or Enable, and then select Confirm.

A change to the events takes effect for later events only. Editing a subscription doesn't change its ID or signing secret. To re-enable a subscription that Preczn disabled after repeated failures, see Webhook delivery, retries, and failures.


Viewing subscriptions

Choose how you'll view your subscriptions. Select the Dashboard tab or the API tab.

  1. Go to Settings → Webhooks. The list shows each subscription's ID, URL, description, events, and status.
  2. To see a subscription's signing secret, open the row's actions menu and select Reveal signing secret.
  3. To see its delivery history, open the row's actions menu and select Webhook Attempts.

Deleting a subscription

Deleting a subscription is permanent. If you might want it back, disable it instead. Choose how you'll delete the subscription. Select the Dashboard tab or the API tab.

  1. Go to Settings → Webhooks.
  2. Open the subscription's actions menu and select Delete.
  3. Select Confirm.

Errors

These errors apply to the /v1/webhooks endpoints.

StatusCause
400A required field is missing, an event isn't in Webhook events, or endpointUrl isn't a valid URL
401The API key is missing or inactive, or its mode doesn't match the subscription's mode
403The API key is a public key, or the subscription belongs to another platform
404No subscription has that ID

FAQ

Should I use the Dashboard or the API?

Use either one. They manage the same subscriptions. The API suits environment setup that runs without anyone signing in. Only the Dashboard shows delivery history and resends past transaction notifications.

Can two subscriptions point at the same URL?

Yes. Each subscription has its own signing secret, events, and failure counter, and each one delivers separately. Your URL receives one notification for each matching subscription.

Can I set more than one custom header?

No. A subscription sends one custom header. To confirm that a request came from Preczn, verify its signature. The custom header is for your endpoint's own authentication.


Did this page help you?