wegive__Payout__c (custom object)WeGive Model: Payout
Overview
This document describes how payout data syncs from WeGive to Salesforce. Payouts represent the transfer of funds from a payment processor to the organization’s bank account. Each payout carries a financial summary showing donation income, fees, refunds, disputes, reserve movements, and deposit amounts.This feature requires the WeGive managed package to be installed in Salesforce, which includes the custom
wegive__Payout__c object. A few payout fields were added in package version 0.7; on older package versions those fields are automatically omitted from the payload.How Payout Data Syncs
Direction
- Export to Salesforce only. Payouts originate with the payment processor and WeGive is the system of record; there is no import of payouts from Salesforce.
Mapping Types
- Hard-coded - Sent by default on every push
- Configurable (mapping rule) - Available to payout mapping rules; sent only when a rule targets a Salesforce field
Sync Configuration
- Push payouts - Enables the export of WeGive payouts to Salesforce
Sync Triggers
Payout data is exported from WeGive to Salesforce when:- Payout Created: A new payout is received from the payment processor
- Payout Updated: An existing payout is modified (e.g., reconciled, deposits recorded)
Sync Process Overview
When a Payout is pushed, the integration:- Generates the financial summary from all transactions in the payout: total donations (gross and fee), service revenue (gross and fee), donation and service revenue refunds, disputes and chargebacks, other fees, and balance released/reserved.
- Compiles deposit information: up to two deposit amounts.
- Creates or updates the record: if the payout has a
salesforce_idit UPDATES the existing record; otherwise it CREATES one (a lock prevents concurrent pushes from creating duplicates). - Applies mapping rules: any export-level mapping rules with
integration= ‘payout’ are merged into the default payload.
Default Field Mapping
These fields are sent on every push.Additional Fields Available to Mapping Rules
The following values are exposed to payout mapping rules but are not sent by default:
Any default field can also be overridden or supplemented with a mapping rule.
Important Notes
Amount Conversion
WeGive stores amounts in cents; every amount in the payload is divided by 100 before it is sent.Disputed Checkbox vs. Disputed Amount
wegive__Disputed__c is a Checkbox in the managed package, so the default payload sends true/false. Sending a dollar amount to it would be rejected by Salesforce. To record the amount, add a mapping rule from summary.disputed_amount to a currency field such as wegive__Disputed_Amount__c.
Multiple Deposits
- No deposit records:
Deposit_1_Amount__c= the total payout amount - One deposit:
Deposit_1_Amount__c= that deposit’s amount - Two deposits: both fields populated
- Three or more deposits: neither deposit field is sent; use the payout total and WeGive’s payout detail for reconciliation
Reserved Balance (Negative Values)
Balance_Reserved__c is sent as abs(amount) * -1 so it reads as a deduction in reports.
Processor Label
wegive__Processor__c combines the processor name, WeGive payout ID, and processor reference: Stripe - 12345 - po_abc123.
Package Version Handling
wegive__Total_Service_Revenue_Income__c, wegive__Deposit_1_Amount__c, wegive__Deposit_2_Amount__c, and wegive__Last_Sync_Date__c are stripped from the payload when the target org’s package does not yet include them, so pushes do not fail on older installs.
Legacy Custom Implementation
One legacy organization uses a differently named custom payout object with un-namespaced field names (for examplePayout_Date__c instead of wegive__Payout_Date__c). On that implementation, Disputed__c carries the dollar amount, the processor field holds only the processor name, mapping rules are not applied, and Last_Sync_Date is not sent. This is not configurable; new implementations use wegive__Payout__c.
Payout Matching & Create/Update Logic
- If the WeGive payout has a
salesforce_id: UPDATE the existing Payout record - If not: CREATE a new Payout record and store its ID on the WeGive payout
Required Fields
The default payload always includeswegive__Payout_Id__c, wegive__Payout_Date__c, wegive__Processor__c, and wegive__Number_of_Transactions__c. Salesforce does not require any specific payout field beyond what your org’s validation rules enforce.
Troubleshooting
Payout not syncing:- Verify the WeGive managed package is installed and the Push payouts toggle is enabled
- Check that the payout was created or modified in WeGive
- Payouts with three or more deposits do not populate either deposit field
- On package versions before 0.7 the deposit fields are omitted
- This is expected; map
summary.disputed_amountto a currency field via a mapping rule
- Sum both deposit amounts for split payouts
- Account for balance released/reserved, fees, refunds, and disputes; the optional
summary.gross_total,summary.total_fees, andsummary.net_payoutfields reproduce the totals on the WeGive payout page