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

ParameterTypeRequiredDescription
typestringtrueThe name of the webhook.
url stringstringtrueA fully formed URL. This is super important because this is the URL where Patricia sends all the Payload events to.
activebooleantrueThis 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

ItemTypeDescription
statusbooleanA boolean attribute to show if the action succeeded or not. The options here can either be true or false
messagestringA human-readable message providing more details about the error.
dataobjectDetails about the webhook response at the time of the transaction.
data.domainstringThis shows the environment where the webhook has been set.
data.urlstringThe webhook URL that was supplied by the user.
data.statusstringThis 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.