Creating Callbacks
Security Note: Callbacks can only be managed using your Secret API Key, not your Public Key. This is for security purposes, as callbacks have access to sensitive event data.
Callbacks allow you to receive real-time notifications about events in your account. When creating a callback, you need to specify a URL endpoint that will receive the webhook payload, the events you want to subscribe to, and an optional description.
When an event occurs, our system will send a POST request to your URL with details about the event. You should acknowledge receipt of the webhook by returning a 2XX status code.
Headers
- Authorization:
Bearer YOUR_SECRET_KEY
- Content-Type:
application/json
Body Parameters
url
Required - The URL where webhook notifications will be sent.
description
Optional - A description of the callback for your reference.
events
Required - Comma-separated list of events to subscribe to (e.g., "payout.created,payout.updated").
Response Parameters
result
Status of the callback creation.
id
Unique identifier for the newly created callback.
url
The URL where webhook notifications will be sent.
description
The description of the callback.
events
The events the callback is subscribed to.
is_active
Whether the callback is active.
message
Message describing the result of the operation.
Sample Request to Create a Callback
curl -X POST https://api.zuripay.app/v1/callback \ -H "Authorization: Bearer zp_test_26PHem9AhJZvU623DfE1x4sd" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/webhooks/payments", "description": "Payment notification endpoint", "events": "payment.created,payment.updated,payment.completed" }'
Sample Responses
{ "result": "success", "id": "zp_callback_1234567890", "url": "https://example.com/webhooks/payments", "description": "Payment notification endpoint", "events": "payment.created,payment.updated,payment.completed", "is_active": true, "failure_count": 0, "last_triggered": null, "date_created": "2023-01-15T14:30:45Z", "date_updated": "2023-01-15T14:30:45Z", "message": "Callback created successfully." }