Skip to main content
Coming Soon - Webhook functionality is currently in development. This page documents the planned implementation.

Overview

The transaction.created event is triggered when a supporter successfully completes a transaction on your Givebutter campaign. This includes one-time donations, ticket purchases, merchandise sales, and other transaction types.

When This Event Fires

  • Supporter completes a one-time donation
  • Ticket is purchased for an event
  • Merchandise or items are purchased
  • First payment of a recurring plan is processed
  • Any other transaction is successfully completed
This event fires immediately after payment is confirmed and processed. For recurring donations, you’ll receive a transaction.created event for each payment processed.

Webhook Payload

{
  "id": "evt_abc123def456",
  "type": "transaction.created",
  "created_at": "2024-01-15T10:30:00Z",
  "data": {
    "id": "txn_123456789",
    "amount": 5000,
    "currency": "USD",
    "status": "completed",
    "type": "donation",
    "payment_method": "card",
    "fee_covered": true,
    "gross_amount": 5000,
    "fee_amount": 250,
    "net_amount": 4750,
    "donor": {
      "id": "cont_987654321",
      "first_name": "Jane",
      "last_name": "Doe",
      "email": "[email protected]",
      "phone": "+1234567890"
    },
    "campaign": {
      "id": "camp_abc123",
      "title": "Annual Gala 2024",
      "url": "https://givebutter.com/annual-gala-2024"
    },
    "note": "In memory of John Smith",
    "anonymous": false,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  },
  "account_id": "acct_xyz789"
}

Event Data Fields

id
string
required
Unique identifier for the transaction (prefixed with txn_)
amount
integer
required
Transaction amount in cents (e.g., 5000 = $50.00)
currency
string
required
Three-letter ISO currency code (e.g., USD, CAD, EUR)
status
string
required
Transaction status. Always completed for this event.
type
string
required
Type of transaction: donation, ticket, merchandise, registration, or other
payment_method
string
required
Payment method used: card, paypal, venmo, ach, google_pay, or daf
fee_covered
boolean
required
Whether the donor chose to cover processing fees
gross_amount
integer
required
Total amount including fees (in cents)
fee_amount
integer
required
Processing fee amount (in cents)
net_amount
integer
required
Net amount after fees (in cents). What you receive.
donor
object
required
Information about the supporter who made the transaction
campaign
object
required
Campaign the transaction belongs to
note
string
Optional message or note left by the donor
anonymous
boolean
required
Whether the donor chose to remain anonymous
created_at
string
required
ISO 8601 timestamp when the transaction was created
updated_at
string
required
ISO 8601 timestamp when the transaction was last updated

Common Use Cases

Automatically send personalized thank you emails when donations are received:
async function handleTransactionCreated(event) {
  const { donor, amount, campaign } = event.data;

  await sendEmail({
    to: donor.email,
    subject: `Thank you for your donation to ${campaign.title}!`,
    body: `Dear ${donor.first_name},\n\nThank you for your generous donation of $${amount / 100}.`
  });
}
Keep your CRM updated with real-time donation data:
async function handleTransactionCreated(event) {
  const { donor, amount, campaign } = event.data;

  await crm.createOrUpdateContact({
    email: donor.email,
    firstName: donor.first_name,
    lastName: donor.last_name,
    lastDonation: amount / 100,
    lastDonationDate: event.data.created_at,
    totalDonations: await calculateTotalDonations(donor.id)
  });
}
Celebrate fundraising milestones when they’re reached:
async function handleTransactionCreated(event) {
  const campaign = await fetchCampaign(event.data.campaign.id);

  // Check if we hit a milestone
  if (campaign.total_raised >= 10000 && campaign.total_raised - event.data.amount < 10000) {
    await notifyTeam({
      message: `🎉 ${campaign.title} just hit $10,000!`,
      channel: '#fundraising'
    });
  }
}
Push real-time metrics to your custom dashboards:
async function handleTransactionCreated(event) {
  const { amount, campaign, created_at } = event.data;

  await analytics.trackEvent('donation_received', {
    amount: amount / 100,
    campaign_id: campaign.id,
    campaign_name: campaign.title,
    timestamp: created_at
  });

  await dashboard.updateMetrics({
    total_raised: await calculateTotalRaised(),
    donation_count: await getDonationCount(),
    average_donation: await getAverageDonation()
  });
}