Skip to main content

Headers

string
string
string
string
Event name for this delivery, for example alert.created, alert.updated, deflection.created, or deflection.updated.

Body

Alert events (alert.*) and deflection events (deflection.*) use different JSON bodies. Use the tabs below for field definitions; the example on the right switches between Alert and Deflection.

First set up your webhook URL in the Chargeblast dashboard in the settings tab. Chargeblast will begin emitting events to your webhook URL. Switch the example above between Alert and Deflection, or see Webhook event types for when each X-Event-Type fires.
The externalOrder field is not available in the alert.created event. Please use the alert.updated event if you require this field.

Authentication

To authenticate the integrity of incoming webhooks, a header is passed into the post request to your endpoint under the header name svix-signature. The value in this header is an HMAC-SHA256 encoded string using the payload of the request with the webhook secret as key. In order to authenticate the request, you perform a HMAC-SHA256 encoding using a concat of webhook request body, svix_timestamp and svix_id and your webhook secret (whsec_xxxxxxxxxxxx) and ensure these strings match. Then input string to SHA256 HMAC will look like: signedContent = "${svix_id}.${svix_timestamp}.${body}" This is a common method for ensuring that the webhook messages you receive in your server are from a trusted source and haven’t been tampered with.
The svix-signature header is composed of a list of space delimited signatures and their corresponding version identifiers. The signature list is most commonly of length one. Though there could be any number of signatures. For example: v1,bm9ldHUjKzFob2VudXRob2VodWUzMjRvdWVvdW9ldQo= v2,MzJsNDk4MzI0K2VvdSMjMTEjQEBAQDEyMzMzMzEyMwo= Make sure to remove the version prefix and delimiter (e.g. v1,) before verifying the signature. Use v1. In this example, you’d compare your signature against bm9ldHUjKzFob2VudXRob2VodWUzMjRvdWVvdW9ldQo=.

Types

Chargeblast emits several X-Event-Type values, including alert events (alert.created, alert.updated, alert.refunded, alert.matched, alert.will_expire, alert.within_refund_rules) and deflection events (deflection.created, deflection.updated). The guide below documents when each event fires and which alert or deflection types apply: Webhook event types