Webhooks 🔔
Overview
Webhook Architecture
POST Payment Webhook
Endpoint Setup
1.
2.
webhook
when creating an invoice or use deafult webhook
on the collection or API settings3.
Request Details
Headers
Header | Value | Description |
---|---|---|
Content-Type | application/json | Format of the request body |
Accept | application/json | Expected response format |
User-Agent | Tranzakt-Payment-Platform/1.0 | Identifies our platform |
X-Webhook-ID | UUID string | Unique identifier for the webhook event |
Request Body
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"event": "payment.successful",
"createdAt": "2024-05-20T10:15:30.123Z",
"data": {
"id": "22205053-02c7-4607-9cb5-5fa58cecae6d",
"collectionId": "37a71e2e-ed54-4e46-a3a9-47a211c352ea",
"collectionName": "Product Sales",
"title": "Checkout Invoice",
"amount": 40000,
"totalAmount": 40400,
"serviceCharge": 400,
"vat": 0,
"payerName": "John Doe",
"payerEmail": "john.doe@example.com",
"payerPhoneNumber": "07078955432",
"billerName": "Example Business",
"billerEmail": "sales@example.com",
"billerAddress": "123 Business St",
"type": "Live",
"status": "Paid",
"paymentMethod": "Card",
"paymentDate": "2024-05-20T10:15:30.123Z",
"billerMetaData": {
"order-id": "12345"
},
"callBackUrl": "https://your-api.com/webhooks/tranzakt",
"dateCreated": "2024-05-20T10:00:00.000Z"
}
}
Request Body Fields
Field | Type | Description |
---|---|---|
id | string | Unique identifier for the webhook notification |
event | string | Type of event that triggered the webhook (e.g., payment.successful ) |
createdAt | string | ISO 8601 timestamp when the webhook was generated |
data | object | Contains the complete invoice information |
data.id | string | Invoice ID |
data.collectionId | string | Collection ID associated with this invoice |
data.collectionName | string | Name of the collection |
data.title | string | Invoice title |
data.amount | number | Base amount in kobo/cents |
data.totalAmount | number | Total amount including fees in kobo/cents |
data.serviceCharge | number | Service charge in kobo/cents |
data.vat | number | VAT amount in kobo/cents |
data.payerName | string | Name of the payer |
data.payerEmail | string | Email of the payer |
data.payerPhoneNumber | string | Phone number of the payer |
data.billerName | string | Your business name |
data.billerEmail | string | Your business email |
data.billerAddress | string | Your business address |
data.type | string | Invoice type (Test or Live ) |
data.status | string | Invoice status (will be Paid for successful payments) |
data.paymentMethod | string | Method used for payment (e.g., Card , BankTransfer ) |
data.paymentDate | string | ISO 8601 timestamp when payment was made |
data.billerMetaData | object | Custom metadata you provided when creating the invoice |
data.callBackUrl | string | The URL receiving this webhook |
data.dateCreated | string | ISO 8601 timestamp when the invoice was created |
Expected Response
Status: 200 OK
Implementation Notes
1.
id
to prevent duplicate processing.2.
3.
4.
🔐 Security Note: Always validate incoming webhooks to ensure they originate from Tranzakt before processing them.
Code Example
Node.js (Express) Implementation
Event Types
Event Type | Description |
---|---|
payment.successful | Sent when a payment is successfully completed |
Troubleshooting
1.
2.
3.
4.
5.
⚠️ Remember that webhooks are only delivered if your endpoint is accessible from the internet. Local development servers may need to use a tunneling service like ngrok.
Modified at 2025-05-20 15:43:02