Skip to main content

Webhooks

Learn more about the Webhook resource

A Webhook resource is used to notify your application about events in your PayRex account.

To laern more about webhooks, please refer to this guide.

Endpoints

EndpointDescription
POST /webhooksCreate webhook endpoint
DELETE /webhooks/:idDelete webhook endpoint
POST /webhooks/:id/disableDisable webhook endpoint
POST /webhooks/:id/enableEnable webhook endpoint
GET /webhooksList webhook endpoint
GET /webhooks/:idRetrieve webhook endpoint
PUT /webhooks/:idUpdate webhook endpoint

The Webhook Resource

{
"id": "wh_225tMcrUMMdiwv2Ya7HTXAEifAx8nno2",
"resource": "webhook",
"secret_key": "whsk_cU8kMThbLEkF3yvz1ygCrPrBdAWguuCU",
"status": "enabled",
"description": "This is the webhook used for sending shipments after receiving successfully paid payments",
"livemode": false,
"url": "https://my-ecommerce.com/send-shipments",
"events": [
"payment_intent.succeeded"
],
"created_at": 1706056262,
"updated_at": 1706056471
}

Attributes


id string

Unique identifier for the resource. The prefix is wh_.


resource string

Represents the resource's type. The value is webhook.


secret_key string

The secret_key is used for webhook signature verification.

To know more about webhook signature verification, please refer to this guide.


status string

The latest status of the Webhook. Possible values are enabled or disabled. A disabled webhook means future events and events with remaining retries that the webhook should send will discontinue.


description string

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


livemode boolean

The value is true if the resource's mode is live or the value is false if the resource is in test mode.


url hash

The URL where the webhook will send the event. To improve the security of the webhook, your URL should use HTTPS.


events array

An array of strings that defines the list of events the webhook will listen to.


created_at timestamp

The time the resource was created and measured in seconds since the Unix epoch.


updated_at timestamp

The time the resource was updated and easured in seconds since the Unix epoch.