Opportunity (Transactions/Donations) - Field Mapping
Salesforce Object: OpportunityWeGive Model: Transaction
How Opportunity Data Syncs
This table shows all fields that sync between WeGive and Salesforce for transactions/donations. Direction:- Import from Salesforce - Data imports from Salesforce into WeGive only
- Export to Salesforce - Data exports from WeGive to Salesforce only
- Both Ways - Data syncs in both directions
- Configurable - Can be customized via integration settings
- Hard-coded - Built into the integration logic and cannot be changed
Sync Triggers
From WeGive to Salesforce (Export)
Opportunity data is exported from WeGive to Salesforce when:- Transaction Created: A new donation/transaction is created in WeGive
- Transaction Updated: An existing transaction is modified in WeGive (e.g., status changed, amount updated, campaign assigned)
From Salesforce to WeGive (Import)
Opportunity data is imported from Salesforce to WeGive based on:- Last Modified Date: WeGive periodically polls Salesforce for Opportunities that have been modified since the last sync
- Sync Frequency: The integration checks for updated Opportunities on a scheduled basis (frequency varies by integration configuration)
- Modified Field Tracking: Only Opportunities with a
LastModifiedDatenewer than the last successful sync are pulled into WeGive
- Creating a new Opportunity in Salesforce will import it to WeGive on the next sync cycle
- Updating an existing Opportunity in Salesforce will trigger an import to WeGive on the next sync cycle
- The sync is based on Salesforce’s
LastModifiedDatefield, not individual field changes
Sync Process Overview
Opportunity-Level Synchronization
WeGive syncs donations and transactions at the Opportunity level in Salesforce, which is NPSP’s standard object for tracking donations. Each transaction in WeGive corresponds to an Opportunity in Salesforce, maintaining the complete donation record including donor information, amount, campaign attribution, and tribute details.Pulling Data from Salesforce
When pulling data from Salesforce, WeGive queries Opportunities based on the last modified date and any specific filtering criteria. The integration pulls comprehensive data from the Opportunity record, including all standard and custom fields that have been mapped. This data is used to create or update the corresponding WeGive Transaction record, maintaining all the necessary relationships to donors, campaigns, and recurring donations. The import process includes special handling for recurring donation relationships, ensuring that one-time and recurring gifts are properly categorized and linked.Pushing Data to Salesforce
When a Transaction record is created or updated in WeGive, the integration compiles a payload for the Salesforce Opportunity object. This payload includes all mapped fields and ensures that the Opportunity record is properly created or updated in Salesforce. The integration handles complex logic including:- Automatic Name Generation: If no transaction name is provided, WeGive generates one using the format “[donor name] [month-year]”
- Stage Name Mapping: Transaction status is mapped to appropriate Opportunity Stage values
- Amount Calculation: Net donation amount (amount minus fees) is calculated and converted to dollars
- Type Assignment: Automatically sets “Recurring” or “One-Time” based on whether the transaction is linked to a recurring donation
- Record Type Assignment: Assigns the appropriate Record Type based on whether the donation is tax-deductible
- Tribute Handling: Populates tribute/memorial information when present
npe01__Do_Not_Automatically_Create_Payment__c to true to prevent NPSP from automatically creating Payment records. This is because the WeGive integration handles payment creation separately (when uses_payments is enabled), ensuring better control over payment record creation and avoiding duplicates.
Opportunity Field Mappings
| Salesforce Field | WeGive Field | WeGive API Field | Direction | Type | Notes |
|---|---|---|---|---|---|
| Name | Transaction Name | name | Both Ways | Configurable | Create only; auto-generated if not provided |
| Amount | Donation Amount | amount | Both Ways | Configurable import Hard-coded export | Export: (amount - fee) / 100 (net amount in dollars) |
| CloseDate | Transaction Date | created_at | Both Ways | Configurable import Hard-coded export | Export: Formatted as Y-m-d in org timezone |
| Type | Transaction Type | Dynamic | Export to Salesforce | Hard-coded | ’Recurring’ or ‘One-Time’ based on scheduled_donation_id |
| LeadSource | Lead Source | Static: ‘Web’ | Export to Salesforce | Hard-coded | Always set to ‘Web’ |
| RecordTypeId | Record Type | Dynamic | Export to Salesforce | Hard-coded | Based on is_tax_deductible |
| AccountId | Donor Account ID | owner.salesforce_account_id | Both Ways | Configurable import Hard-coded export | Create only |
| ContactId | Donor Contact ID | owner.salesforce_id | Both Ways | Configurable import Hard-coded export | Create only |
| CampaignId | Campaign ID | campaign.salesforce_id | Both Ways | Configurable import Hard-coded export | |
| npe03__Recurring_Donation__c | Recurring Donation ID | scheduled_donation.salesforce_id | Both Ways | Configurable import Hard-coded export | Create only; links to recurring donation |
| StageName | Opportunity Stage | stage_name | Export to Salesforce | Configurable import Hard-coded export | See Picklist Values section below |
| npsp__Tribute_Type__c | Tribute Type | Static: ‘Honor’ | Export to Salesforce | Hard-coded | Only populated if tribute exists |
| npsp__Honoree_Name__c | Tribute Name | tribute_name | Export to Salesforce | Hard-coded | |
| npe01__Do_Not_Automatically_Create_Payment__c | Disable Auto Payment | Static: true | Export to Salesforce | Configurable import Hard-coded export | Literal ‘true’; Create only; prevents NPSP from auto-creating payments |
Picklist Values
StageName (Opportunity Stage)
The integration automatically maps transaction status to Salesforce Opportunity Stage:| WeGive Transaction Status | Default Salesforce StageName | Can Be Modified |
|---|---|---|
| Successful / Processing | Closed Won | Yes - Configurable in integration settings |
| Failed | Closed Lost | Yes - Configurable in integration settings |
| Pending | Pledged | Yes - Configurable in integration settings |
| Refunded | Closed Lost | Yes - Configur |
Important Notes
Amount Calculation
When exporting to Salesforce, the Opportunity Amount is calculated as(amount - fee) / 100 to show the net donation amount in dollars. WeGive stores amounts in cents internally, so the division by 100 converts to the dollar amount expected by Salesforce.
Example: If a donor gives $100 with a $3 processing fee:
- WeGive stores: amount = 10000 (cents), fee = 300 (cents)
- Salesforce receives: Amount = $97.00 (net donation)
Automatic Name Generation
If no transaction name is provided when creating an Opportunity, WeGive automatically generates a name using the format:{donor.name} {month-year}
Examples:
- “John Smith 01-2024”
- “ABC Corporation 12-2023”
Payment Creation Prevention
The fieldnpe01__Do_Not_Automatically_Create_Payment__c is always set to true to prevent NPSP from automatically creating Payment records. This is critical because:
- The WeGive integration handles Payment creation separately when
uses_payments = true - Prevents duplicate Payment records from being created
- Gives the integration full control over the payment lifecycle
Recurring vs One-Time Donations
TheType field is automatically determined based on the transaction’s relationship to a recurring donation:
- Type = “Recurring” - Transaction has a
scheduled_donation_id(part of a recurring donation plan) - Type = “One-Time” - Transaction has no
scheduled_donation_id(standalone donation)
Tribute/Honoree Logic
Tribute fields are only populated when the transaction includes tribute/memorial information:- If tribute information exists,
npsp__Tribute_Type__cis set to “Honor” - The
npsp__Honoree_Name__cfield contains the name of the person being honored or memorialized - If no tribute information exists, these fields remain empty
Record Type Assignment
TheRecordTypeId is dynamically assigned based on the transaction’s is_tax_deductible flag:
- Tax-deductible donations receive one Record Type
- Non-tax-deductible donations receive a different Record Type
- This is queried dynamically from your Salesforce org’s Record Type configuration
Lead Source
TheLeadSource field is always set to “Web” for all donations coming from WeGive, indicating that the donation originated from an online source.
Create-Only Fields
Several fields are only set during the creation of a new Opportunity and cannot be updated afterwards:AccountId- Donor’s Account relationshipContactId- Donor’s Contact relationshipnpe03__Recurring_Donation__c- Recurring donation relationshipnpe01__Do_Not_Automatically_Create_Payment__c- Payment prevention flag
Update Behavior
When updating an existing Opportunity, only the following fields are modified:CloseDate- Transaction dateCampaignId- Campaign assignmentStageName- Opportunity stage (based on status)npe03__Recurring_Donation__c- Recurring donation linkType- Recurring or One-TimeAmount- Donation amount (net of fees)
Opportunity Matching & Create/Update Logic
When WeGive exports a transaction to Salesforce, the integration uses the following logic:Step 1: Check for Existing Salesforce Opportunity ID
The integration first checks if the WeGive transaction already has asalesforce_id stored:
- If Salesforce Opportunity ID exists: The integration will UPDATE the existing Opportunity record in Salesforce
- If no Salesforce Opportunity ID exists: The integration creates a NEW Opportunity in Salesforce
Why This Matters
Unlike Contacts and Accounts, Opportunities are not matched by email, name, or other identifying information. Each transaction creates a unique Opportunity record unless it already has a Salesforce ID stored. This approach ensures:- Every donation is tracked as a separate, distinct Opportunity
- No risk of accidentally merging different donations
- Updates only modify the correct, linked Opportunity
- Complete donation history is preserved in both systems
salesforce_id reference in WeGive, it will create a duplicate Opportunity in Salesforce on the next sync. Always maintain the Salesforce ID relationship for transactions to prevent duplication.
Payment (npe01__OppPayment__c) - Field Mapping
Salesforce Object: npe01__OppPayment__cWeGive Model: Transaction (when uses_payments = true)
How Payment Data Syncs
This table shows all fields that sync between WeGive and Salesforce for payment records. Payments are only created when the integration settinguses_payments is enabled.
Direction:
- Import from Salesforce - Data imports from Salesforce into WeGive only
- Export to Salesforce - Data exports from WeGive to Salesforce only
- Both Ways - Data syncs in both directions
- Configurable - Can be customized via integration settings
- Hard-coded - Built into the integration logic and cannot be changed
Sync Triggers
From WeGive to Salesforce (Export)
Payment data is exported from WeGive to Salesforce when:- Payment Created: A new transaction is processed in WeGive (and
uses_payments = true) - Payment Updated: An existing transaction is modified in WeGive (e.g., status changed, amount updated)
uses_payments setting is enabled for your integration.
From Salesforce to WeGive (Import)
Payment data is imported from Salesforce to WeGive based on:- Last Modified Date: WeGive periodically polls Salesforce for Payment records that have been modified since the last sync
- Sync Frequency: The integration checks for updated Payment records on a scheduled basis (frequency varies by integration configuration)
- Modified Field Tracking: Only Payment records with a
LastModifiedDatenewer than the last successful sync are pulled into WeGive
- Creating a new Payment in Salesforce will import it to WeGive on the next sync cycle
- Updating an existing Payment in Salesforce will trigger an import to WeGive on the next sync cycle
- The sync is based on Salesforce’s
LastModifiedDatefield, not individual field changes
Sync Process Overview
Payment-Level Synchronization
WeGive syncs transaction payment details at the Payment level in Salesforce whenuses_payments = true. This follows NPSP’s model where Opportunities represent donation commitments and Payments represent the actual payment transactions. Each transaction in WeGive can create both an Opportunity and a Payment record in Salesforce.
When Payments Are Created
Payment records are only created when the integration settinguses_payments = true. When this setting is disabled, all transaction data goes into the Opportunity record only, and no separate Payment records are created.
Pulling Data from Salesforce
When pulling data from Salesforce, WeGive queries Payment records based on the last modified date. The integration pulls comprehensive payment data including payment amounts, dates, methods, and processing details. This data is used to update the corresponding WeGive Transaction record.Pushing Data to Salesforce
When a Transaction record is created or updated in WeGive (anduses_payments = true), the integration compiles a payload for the Salesforce Payment object. This payload includes:
- Payment Amount: Net amount after fees, converted to dollars
- Payment Date: Transaction creation date
- Payment Method: Mapped from WeGive payment types
- Payment Status: Based on transaction status (paid/unpaid)
- Processing Details: Gateway ID, batch number, fees, and card details
npe01__Opportunity__c field.
Payment Field Mappings
| Salesforce Field | WeGive Field | WeGive API Field | Direction | Type | Notes |
|---|---|---|---|---|---|
| npe01__Payment_Amount__c | Payment Amount | amount | Both Ways | Configurable import Hard-coded export | Export: (amount - fee) / 100 (net amount in dollars) |
| npe01__Payment_Date__c | Payment Date | created_at | Both Ways | Configurable import Hard-coded export | Export: Formatted date |
| npe01__Payment_Method__c | Payment Method | source_type | Export to Salesforce | Configurable import Hard-coded export | See Picklist Values section |
| npe01__Paid__c | Payment Status | Dynamic | Export to Salesforce | Configurable import Hard-coded export | Based on transaction status |
| npe01__Opportunity__c | Opportunity ID | salesforce_id | Export to Salesforce | Configurable import Hard-coded export | Create only; links to Opportunity |
| npsp__Batch_Number__c | Payout ID | payout_id | Export to Salesforce | Configurable export | |
| npsp__Gateway_Payment_ID__c | WeGive Transaction ID | id | Export to Salesforce | Configurable export | Create only |
| npsp__Total_Transaction_Fees__c | Transaction Fee | fee_amount | Export to Salesforce | Configurable export | |
| npsp__Donor_Cover_Amount__c | Fee Covered Amount | fee_covered_amount | Export to Salesforce | Configurable export | Create only |
| npsp__Card_Last_4__c | Card Last 4 Digits | paymentMethod.last_four | Export to Salesforce | Configurable export | Create only; for credit/debit cards |
| npsp__Card_Network__c | Card Network | paymentMethod.issuer | Export to Salesforce | Configurable export | Create only; e.g., Visa, Mastercard |
Picklist Values
npe01__Payment_Method__c (Payment Method)
The integration maps WeGive payment types to Salesforce Payment Method values:| WeGive Payment Type | Default Salesforce Payment Method | Can Be Modified |
|---|---|---|
| card | Credit Card | Yes - Configurable via payment method mapping |
| bank_account (ACH) | ACH/EFT | Yes - Configurable via payment method mapping |
| paypal | PayPal | Yes - Configurable via payment method mapping |
| venmo | Venmo | Yes - Configurable via payment method mapping |
| check | Check | Yes - Configurable via payment method mapping |
| cash | Cash | Yes - Configurable via payment method mapping |
| stock | Stock | Yes - Configurable via payment method mapping |
| wire | Wire Transfer | Yes - Configurable via payment method mapping |
| other | Other | Yes - Configurable via payment method mapping |
Configuration: Payment method mappings can be customized in your integration settings to match your Salesforce org’s Payment Method picklist values. This allows you to align with your organization’s specific payment categorization.
Dynamic Mapping: The integration first checkssource_type, then falls back to payment_type if source_type is not available, ensuring the most accurate payment method is recorded.
Important Notes
When Payments Are Created
Payment records are only created when the integration settinguses_payments = true. This setting determines whether the integration creates separate Payment records or includes all payment information in the Opportunity record only.
When to Enable uses_payments:
- You want detailed payment tracking separate from donation commitments
- You need to track multiple payments per opportunity (installments)
- You want to use NPSP’s payment rollup features
- You need payment-level reporting
uses_payments:
- You prefer simpler one-record-per-donation tracking
- You don’t need the additional complexity of separate payment records
- Your organization doesn’t use NPSP’s payment features
Payment vs Opportunity
Understanding the distinction between these two objects:- Opportunity = The donation commitment/pledge/intention
- Payment = The actual payment transaction details
Payment Amount Calculation
The payment amount is calculated as(amount - fee) / 100 to show the net payment amount in dollars:
- WeGive stores amounts in cents
- The division by 100 converts to dollars for Salesforce
- Fees are subtracted to show the net amount received
- WeGive stores: amount = 10000 (cents), fee = 300 (cents)
- Salesforce Payment receives: npe01__Payment_Amount__c = $97.00 (net payment)
Payment Status Logic
Thenpe01__Paid__c field is set based on the transaction status:
| Transaction Status | npe01__Paid__c Value |
|---|---|
| successful | true |
| refunded | true |
| pending | false |
| failed | false |
Legacy Integration Note
For legacy integrations (older integration setups), the following fields are excluded from export to maintain compatibility:npsp__Donor_Cover_Amount__cnpsp__Batch_Number__cnpsp__Gateway_Payment_ID__cnpsp__Total_Transaction_Fees__c
Card Details
Card-specific fields are only populated when the payment method is a credit or debit card:npsp__Card_Last_4__c- Last 4 digits of the card numbernpsp__Card_Network__c- Card issuer (Visa, Mastercard, American Express, Discover, etc.)
Create-Only Fields
Several fields are only set during the creation of a new Payment and cannot be updated afterwards:npe01__Opportunity__c- Link to parent Opportunitynpsp__Gateway_Payment_ID__c- WeGive transaction IDnpsp__Donor_Cover_Amount__c- Fee coverage amountnpsp__Card_Last_4__c- Card last 4 digitsnpsp__Card_Network__c- Card network/issuer
Update Behavior
When updating an existing Payment, only the following fields are modified:npe01__Paid__c- Payment statusnpe01__Payment_Amount__c- Payment amountnpe01__Payment_Date__c- Payment datenpe01__Payment_Method__c- Payment method
Gateway Payment ID
Thenpsp__Gateway_Payment_ID__c field stores the WeGive transaction ID, providing a direct link back to the original transaction in WeGive. This is useful for:
- Reconciliation between systems
- Support and troubleshooting
- Audit trails
- Integration monitoring
Payment Matching & Create/Update Logic
When WeGive exports a transaction to Salesforce with payments enabled, the integration uses the following logic:Step 1: Check for Existing Salesforce Payment ID
The integration first checks if the WeGive transaction already has asalesforce_payment_id stored:
- If Salesforce Payment ID exists: The integration will UPDATE the existing Payment record in Salesforce
- If no Salesforce Payment ID exists: The integration creates a NEW Payment record in Salesforce and links it to the Opportunity
Step 2: Link to Parent Opportunity
When creating a new Payment, the integration automatically links it to the parent Opportunity using thenpe01__Opportunity__c field. This establishes the relationship between the donation commitment (Opportunity) and the actual payment transaction (Payment).
Why This Matters
Each transaction creates a unique Payment record linked to its Opportunity. This ensures:- Every transaction payment is tracked separately
- Updates only modify the correct, linked Payment
- Payment details are preserved even if the Opportunity is updated
- NPSP can properly roll up payment amounts to the parent Opportunity
salesforce_payment_id reference in WeGive, it will create a duplicate Payment in Salesforce on the next sync.