Recurring Donation Data Mapping
This document details how WeGiveScheduledDonation records map to DonorPerfect pledges.
DonorPerfect Table Reference
Primary Table:dpgift (record type Pledge, via dp_savepledge) — DonorPerfect doesn’t use a separate dppledge table for this integration; pledges live in the same gift table under a different record type
WeGive Model: ScheduledDonation
Sync Direction: WeGive → DonorPerfect (Push Only — no pull-back of pledge status or changes)
Core Pledge Fields
Financial Information
Fee handling here is the opposite direction from one-time gifts: a one-time transaction’s
dp_savegift subtracts the fee to get a net amount; a pledge’s dp_savepledge adds the fee (only if the donor is covering it) to reflect the total amount actually billed. Don’t assume the same fee-math applies to both.Fund Attribution
Schedule and Frequency
Membership and Miscellaneous Fields
syncScheduledDonation()’s full parameter set includes several fields that are always null, regardless of any WeGive data: reminder set to "N", solicit_code, sub_solicit_code, campaign, membership_type, membership_level, membership_enr_date, membership_exp_date, membership_link_id, address_id, ty_letter_no, vault_id, receipt_delivery_g, contact_id, writeoff_date. writeoff_amount is always 0. initial_payment is always "N".
There’s no membership-tracking integration, no campaign attribution, and no writeoff-amount tracking despite these parameters existing in the
dp_savepledge payload — they’re always sent as empty/zero placeholders.Gift Narrative
Same fixed narrative as one-time gifts:"Online gift through WeGive", no pledge-specific variant.
Data Flow Process
syncScheduledDonation()triggers on scheduled-donation create/update (real-time)- If the source donor has no
dp_id,exportDonor()runs first - Under a per-scheduled-donation DB lock: if
dp_idalready exists, the previous DonorPerfect pledge record is fetched and any locally-null param is backfilled from it before sending an update dp_savepledgeis called; on success,dp_idis stored
Payment-to-Pledge Linking
Individual payments link to a pledge via the transaction’s own sync (syncGift()), not the pledge’s sync:
pledge_paymentis set to"Y"if the transaction has ascheduled_donation_idplinkis set to the linked scheduled donation’sdp_id, if that scheduled donation has already synced
If a payment is processed before its scheduled donation has ever synced to DonorPerfect (no
dp_id yet), plink is simply null for that payment — there’s no guaranteed ordering that forces the pledge to sync first. The pledge does eventually get its own dp_id from its own independent sync trigger, but a specific payment might race ahead of it.Error Handling
API Operations
dp_savepledge
See the full parameter breakdown above — every field not explicitly listed as WeGive-derived is a fixed placeholder (null, "N", or 0).
Data Quality Considerations
Before Sync
- Understand that pledge frequency will show as Monthly in DonorPerfect regardless of the real schedule (known issue) — factor this into any DonorPerfect-side reporting expectations until that’s fixed
- Don’t rely on the pledge record for fund/GL code reporting — that lives only on the individual linked payments
Ongoing Maintenance
- Check Sentry (not the WeGive dashboard) for
dp_savepledgefailures
Known Limitations
- Frequency: always “Monthly” regardless of actual cadence (known issue)
- Fund attribution: none on the pledge itself
- No pledge-status sync: pause/cancel/resume in WeGive doesn’t push any corresponding status change to DonorPerfect
- No pull-back: pledge changes made directly in DonorPerfect never flow back to WeGive
- No membership or campaign data: fields exist in the payload but are always empty placeholders
Troubleshooting
Pledges Not Creating
Possible causes:- The integration is disabled
- The donor sync (triggered inline first) failed
- API authentication failure
- Confirm the integration’s
enabledflag - Check Sentry for the specific failure
Payments Not Linking to Pledges
Possible cause: The scheduled donation hasn’t synced yet (nodp_id) at the moment the payment itself synced — plink will be null for that payment permanently; it isn’t retroactively backfilled.
Pledge Shows Wrong Frequency
Cause: Known bug, not a misconfiguration.Related Documentation
Transaction Mapping
How individual payments link to pledges
Donor Mapping
Donor record requirements for pledges
Fund Management
GL code setup (used by individual payments, not by pledges themselves)
Configuration Guide
Integration-level configuration (most sync-scope toggles are currently non-functional)