Introduction
Introduction
Patricia uses webhooks to notify and send programmatic updates to your application when an event happens in your Patricia Business Account. Webhooks are useful for asynchronous events like when a crypto send transaction initiated by the merchant has started processing on the blockchain when a crypto transaction has been successfully processed when a crypto transaction has been successful.
To begin using webhooks, go to your dashboard and check under your webhooks section, add your webhook URL or you can use the webhook endpoint. When this is done, you should be ready to receive your first webhook events.
Endpoint
POST /v1/webhooks
Request Object
{
"type": "test",
"url": "http://6e1cc924a37f.ngrok.io",
"active": true
}
Parameter Definition
Parameter | Type | Required | Description |
---|---|---|---|
type | string | true | The name of the webhook. |
url string | string | true | A fully formed URL. This is super important because this is the URL where Patricia sends all the Payload events to. |
active | boolean | true | This flag is used to toggle the status of the webhook. This controls if the webhook is ready to receive events. |
{
"status":true,
"message":"Webhook created successfully.",
"data":{
"domain":"test",
"url":"http://6e1cc924a37f.ngrok.io",
"status":"active",
"updated_at":"2021-06-09T15:11:01.000000Z",
"created_at":"2021-06-09T15:11:01.000000Z"
}
}
Attributes
Item | Type | Description |
---|---|---|
status | boolean | A boolean attribute to show if the action succeeded or not. The options here can either be true or false |
message | string | A human-readable message providing more details about the error. |
data | object | Details about the webhook response at the time of the transaction. |
data.domain | string | This shows the environment where the webhook has been set. |
data.url | string | The webhook URL that was supplied by the user. |
data.status | string | This shows the status of the webhook. Webhooks that have their attribute as true are webhooks ready for events while webhooks with status as false are not going to get events. |
Note
Note, Patricia will send POST payloads with raw JSON to your webhook URL.
Updated about 3 years ago