What are Webhooks?

Webhooks

You can use webhook subscriptions to receive notifications about particular events. After you've subscribed to a webhook, you can let your app execute code immediately after specific events occur, instead of having to make API calls periodically to check their status. For example, you can rely on webhooks to trigger an action in your app when a balance for a card is retrieved for a quote or when a fraud check has been completed on a customer. By using webhooks subscriptions you can make fewer API calls overall, which makes sure that your apps are more efficient and update quickly.

Anatomy of a webhook

After you configure a webhook subscription, the events that you specified will trigger a webhook notification each time they occur. This notification contains a JSON payload and HTTP headers that provide context. For example, the quote/completed webhook includes the following headers:

X-Exchange-Topic: quote/completed
X-Exchange-Hmac-Sha256: XWmrwMey6OsLMeiZKwP4FppHH3cmAiiJJAweH5Jo4bM=
X-Exchange-API-Version: v3

X-Exchange-Topic describes the type of event that was raised when calling the webhook

X-Exchange-Hmac-Sha256 is used to verify the webhook came from GiftDeals. Since your webhook will need to be open to the internet you need to verify that the call was properly authenticated.

X-Exchange-API-Version is used to confirm what version of the API used to serialize the webhook event payload. As new versions are released this may be updated to reflect the new version.

List of supported webhook events and topics

When creating a webhook you specify the topic you wish to receive.

EventsTopicsObject Sent
quotequote/completed - Sent when a quote has been completed and a result is availableQuoteResponse
fraudfraud/completed - Sent when a fraud check has been completed, and a result is available

fraud/updated - Sent when a customer or card has been determined to be fraudulent. This can happen anytime after an acquisition has been completed.
FraudCheckResponse

FraudCheckResponse