Donation Webhooks

Donation webhook payloads are generated in response to certain one-time and recurring donations within your nation.

Donation Succeeded, Donation Changed, Donation Canceled

POST https://www.example.com/webhook

{
  "nation_slug": "foobar",
  "payload": {
    "donation": {
      "actblue_order_number": null,
      "amount": "$20.20",
      "amount_in_cents": 2020,
      "author_id": 12703,
      "billing_address": {
          "address1": "123 Fake St",
          "address2": "Apt 1905",
          "address3": "Suite 5A",
          "city": "Pasadena",
          "state": "CA",
          "country_code": "US",
          "zip": "91101",
          "lat": "39.756461",
          "lng": "-105.003145"
      },
      "canceled_at": null,
      "check_number": "7373474378349",
      "corporate_contribution": false,
      "created_at": "2014-02-11T10:21:43-05:00",
      "donor_id": 75408,
      "donor": {
        "id": 75408,
        "external_id": null,
        "support_level": 4,
        "first_name": "Joe",
        "last_name": "Doe",
        "email": "joe@example.com",
        "phone": "4442221111",
        "mobile": "5137069737",
        "birthdate": "Tue, 26 Mar 1985",
        "sex": "M",
        "note": "looking forward to hosting a fundraiser",
        "primary_address": {
          "address1": "123 Fake St",
          "address2": "Apt 1905",
          "address3": "Suite 5A",
          "city": "Pasadena",
          "state": "CA",
          "country_code": "US",
          "zip": "91101",
          "lat": "39.756461",
          "lng": "-105.003145"
        },
        "tags": [],
        "recruiter_id": 75408,
        "created_at": "2014-02-11T10:21:43-05:00",
        "updated_at": "2014-02-11T10:21:43-05:00",
        "mobile_opt_in": true,
        "email_opt_in": true,
        "is_volunteer": false,
        "is_twitter_follower": false,
        "has_facebook": false,
        "state_file_id": "WA0005999453",
        "nbec_guid": "bba7230e-0104-11e2-bb92-373670e030f7",
        "van_id": null,
        "dw_id": null,
        "do_not_call": false,
        "do_not_contact": false,
        "ngp_id": null,
        "pf_strat_id": 91576765,
        "county_file_id": "97076395",
        "twitter_name": "Sam",
        "twitter_id": "385795309",
        "salesforce_id": null,
        "civicrm_id": null,
        "linkedin_id": "2oY82qLuGg",
        "employer": "Hanna Corp",
        "occupation": "Contractor",
        "supranational_district": null,
        "federal_district": null,
        "labour_region": null,
        "state_upper_district": "23",
        "state_lower_district": "60",
        "city_district": "10",
        "county_district": null,
        "judicial_district": null,
        "school_district": null,
        "school_sub_district": null,
        "village_district": null,
        "fire_district": null,
        "precinct_id": 2510,
        "party": "D",
        "rnc_id": null,
        "rnc_regid": null
      },
      "election": null,
      "email": "joe@example.com",
      "employer": "Hanna Corp",
      "failed_at": null,
      "fec_type": "Contribution",
      "fec_type_ngp_code": "C",
      "first_name": "Jake",
      "id": 87,
      "import_id": 139,
      "is_private": false,
      "last_name": "Doe",
      "mailing_slug": "mailing",
      "merchant_account_id": 3,
      "ngp_id": null,
      "occupation": "Contractor",
      "note": "looking forward to hosting a fundraiser",
      "page_slug": "ticket_sales",
      "payment_type_name": "Cash",
      "payment_type_ngp_code": "C",
      "pledge_id": 44,
      "recruiter_name_or_email": "Joe Doe",
      "recurring_donation_id": 5,
      "succeeded_at": "2014-02-11T10:21:43-05:00",
      "tracking_code_slug": "lincoln",
      "updated_at": "2014-02-11T10:21:43-05:00",
      "work_address": null
    }
  },
  "token": "sharedsecret",
  "version": 4
}

Past versions (version 2 and below)

Donation webhooks with version 2 and below will keep receiving an earlier version of the webhook payload. For the donation webhook to return a different version of the payload, the existing donation webhook has to be edited on the Control Panel.

Donation Success/Update/Cancel

POST https://www.example.com/webhook

{
  "nation_slug": "foobar",
  "payload": {
    "donation": {
      "donation_nationbuilder_id": 1,
      "amount": "$20.20",
      "amount_in_cents": 2020,
      "authorization": null,
      "ngp_id": null,
      "actblue_order_number": null,
      "election_cycle": null,
      "election_period_ngp_code": null,
      "election_period_name": null,
      "election_period_id": null,
      "payment_type_ngp_code": "C",
      "payment_type_name": "Cash",
      "payment_type_id": 1,
      "fec_type_ngp_code": null,
      "fec_type_name": null,
      "fec_type_id": null,
      "check_number": null,
      "currency": null,
      "succeeded_at": null,
      "failed_at": null,
      "canceled_at": null,
      "created_at": "05\/30\/2013 12:51 AM",
      "is_private": false,
      "ip_address": null,
      "note": null,
      "page_slug": null,
      "recruiter_id": 75408,
      "recruiter_name": "Jake Doe",
      "tracking_code_slug": null,
      "merchant_account_name": null,
      "is_corporate_contribution": false,
      "signup": {
        "nationbuilder_id": 75408,
        "twitter_id": null,
        "twitter_login": null,
        "meetup_id": null,
        "civicrm_id": null,
        "external_id": null,
        "salesforce_id": null,
        "prefix": null,
        "first_name": "Joe",
        "middle_name": null,
        "last_name": "Doe",
        "suffix": null,
        "full_name": "Joe Doe",
        "legal_name": null,
        "employer": null,
        "occupation": null,
        "sex": null,
        "party": null,
        "religion": null,
        "church": null,
        "ethnicity": null,
        "marital_status": null,
        "website": null,
        "language": null,
        "is_deceased": false,
        "born_at": "05\/14\/1942",
        "email1": "joe@example.com",
        "email2": null,
        "email3": null,
        "email4": null,
        "email_opt_in": true,
        "phone_number": null,
        "work_phone_number": null,
        "do_not_call": false,
        "do_not_contact": false,
        "federal_donotcall": false,
        "mobile_number": null,
        "mobile_opt_in": true,
        "is_mobile_bad": false,
        "fax_number": null,
        "household_size": null,
        "demo": null,
        "support_level": null,
        "inferred_support_level": null,
        "priority_level": null,
        "availability": null,
        "note": null,
        "parent_id": null,
        "point_person_name_or_email": null,
        "recruiter_id": 75408,
        "recruiter_name_or_email": "Jake Doe",
        "tag_list": "",
        "created_at": "05\/28\/2013  3:37 PM",
        "unsubscribed_at": null,
        "is_supporter": true,
        "is_prospect": false,
        "is_volunteer": false,
        "is_donor": null,
        "is_fundraiser": true,
        "is_ignore_donation_limits": false,
        "first_donated_at": "12\/31\/2012  7:00 PM",
        "last_donated_at": "05\/27\/2013  8:00 PM",
        "donations_count": 2,
        "donations_amount": "$40.40",
        "donations_amount_in_cents": 4040,
        "donations_raised_count": 2,
        "donations_raised_amount": "$40.40",
        "donations_raised_amount_in_cents": 4040,
        "donations_pledged_amount": "$0.00",
        "donations_pledged_amount_in_cents": 0,
        "donations_count_this_cycle": 0,
        "donations_amount_this_cycle": "$0.00",
        "donations_amount_this_cycle_in_cents": 0,
        "donations_raised_count_this_cycle": 2,
        "donations_raised_amount_this_cycle": "$40.40",
        "donations_raised_amount_this_cycle_in_cents": 4040,
        "maximum_donation_possible_this_cycle": "$0.00",
        "maximum_donation_possible_this_cycle_in_cents": 0,
        "membership_level_name": null,
        "membership_started_at": null,
        "membership_expires_at": null,
        "assistant_first_name": null,
        "assistant_last_name": null,
        "assistant_email": null,
        "assistant_phone": null,
        "assistant_mobile": null,
        "assistant_work_phone": null,
        "nbec_guid": null,
        "pf_strat_id": null,
        "state_file_id": null,
        "county_file_id": null,
        "dw_id": null,
        "van_id": null,
        "ngp_id": null,
        "pf_matchkey": null,
        "previous_party": null,
        "inferred_party": null,
        "federal_district": null,
        "state_upper_district": null,
        "state_lower_district": null,
        "county_district": null,
        "city_district": null,
        "village_district": null,
        "judicial_district": null,
        "school_district": null,
        "school_sub_district": null,
        "fire_district": null,
        "precinct_name": null,
        "precinct_code": null,
        "media_market_name": null,
        "support_probability_score": null,
        "turnout_probability_score": null,
        "capital_amount": null,
        "capital_amount_in_cents": 500,
        "spent_capital_amount": null,
        "spent_capital_amount_in_cents": 0,
        "received_capital_amount": null,
        "received_capital_amount_in_cents": 500,
        "address": {
          "country_code": null,
          "country": null,
          "state": "CA",
          "city": "Pasadena",
          "county": null,
          "zip": "91101",
          "address1": "123 Fake St",
          "address2": null,
          "address3": null,
          "fips": null
        }
      }
    }
  },
  "token": "sharedsecret",
  "version": 2
}

Showing 4 reactions

Wrap code snippets in <code></code> tags.
Please check your e-mail for a link to activate your account.