HomeGuidesChangelogDiscussions
Log In
Guides

Card Webhooks

The webhook is used to listen for events on your integrator account so that your integration can automatically trigger reactions. Webhooks are particularly useful for asynchronous events like when a transaction happens on a card.

Below is the sample data sent to your registered webhook handler:

{
  event: "card.transaction",
  data: {
    amount: 1000,
    currency: "USD",
    card_id: "e22c273f-caf3-42fb-928a-4fb23ad96c0b",
    reference: "2aa7103b-f3e9-4c00-9f3e-81d02fb01a9e"
  }
}

As seen above, the webhook payload has an event property that identifies what the event is about, and the data attribute contains the event data. Below is a list of events broadcasted by the Spendjuice system:

card.transaction
card.reverse-transaction
user.kyc-verification

An example JSON body for each event:

{
  "event": "card.transaction",
  "data": {
    "card_id": "81817411-9ffd-42ba-8bc8-f407b5cef9d9",
    "amount": 1000,
    "reference": "b070b0d2-e394-4783-a6f0-f10ccb3cae89",
    "currency": "USD"
  }
}
{
  "data": {
    "amount": 2000,
    "card_id": "247cedc5-b33e-43f3-ae0e-5ffbcb695452",
    "currency": "USD",
    "reference": "44a935e5-187e-4794-a3b0-a0e8b7f45532"
  },
  "event": "card.reverse-transaction"
}
{
  "data": {
    "status": "failed",
    "user_id": "3cf33ed3-22a4-4825-b3df-aa1056e61795"
  },
  "event": "user.kyc-verification"
}