Skip to main content

Create a Webhook

Creates a Webhook resource.

info

You can manage a webhook either through API or our Dashboard. You can check this guide for learn more.


Endpoint

POST /webhooks

Sample code

const client = require('payrex-node')('insert your PayRex Secret API key.');

const webhook = await client.webhooks.create({
url: 'https://my-ecommerce.com/send-shipments',
description: 'test description',
events: ['payment_intent.succeeded'],
});

Parameters

url REQUIRED

The URL where PayRex will send the event that happened from your account. For security purposes, the URL must be using HTTPS protocol.


description optional

An arbitrary string attached to the Webhook. You can use this to give more information about the Webhook resource.


events REQUIRED

An array of strings that defines the list of events the webhook will listen to. To learn about the possible values, please refer to this list.

Returns

Returns a Webhook resource.