Prerequisites
- A Carbn account with API access
- Carbn API credentials (API key)
- HTTPS endpoint with valid certificate
- Development environment with your preferred language
Step 1: Create Your Webhook Endpoint
First, create an endpoint on your server to receive webhook notifications.Webhook Payload Structure
All webhook payloads follow this structure:HTTP Headers
When Carbn sends webhook events, your endpoint will receive these headers:Content-Type: application/json
User-Agent: Java/17.0.14
X-Webhook-Event-Id
: Unique identifier for this delivery attemptX-Webhook-Id
: Identifier of the webhook configurationX-Webhook-Signature
: Base64 encoded signature for payload verification
Example Webhook Handler
Step 2: Register Your Webhook
Once your endpoint is ready, register it with Carbn. Important: Webhooks are created withstatus: "disabled"
by default and must be enabled separately.
webhook_id
from the response - you’ll need it to enable the webhook.
Step 3: Enable Your Webhook
Before your webhook can receive events, you must enable it using the PUT endpoint:Payment Status Events
Carbn webhooks notify you when payment statuses change. The main status values are:PAYMENT_PROCESSED
- Payment has been successfully processedPAYMENT_FAILED
- Payment processing failed