The Donation Campaigns API enables you to create and manage fundraising campaigns on a site. You can configure each campaign with specific goals, custom or predefined donation amounts, and progress tracking capabilities. Learn more about Wix Donations.
Using the Donation Campaigns API, you can:
It's important to note the following point before starting to code:
When creating donation campaigns, you must configure custom or predefined donation amounts for each campaign:
customAmountEnabled: Whether donors can specify their own donation amount.predefinedDonationAmounts: Suggested donation options.Enable both options for maximum flexibility.
For each campaign, you must specify at least 1 of the following donation frequencies:
ONE_TIME: Single donation.WEEK: Weekly recurring donations.MONTH: Monthly recurring donations.YEAR: Yearly recurring donations.COLLECTING: Campaign is actively accepting donations.EXPIRED: Campaign has passed its end date and acceptDonationsAfterEndDate is false.GOAL_REACHED: Campaign has reached its target amount and acceptDonationsAfterGoal is false.The Donation Campaigns API supports donations and reports metrics in a site's default currency only.
After creating a campaign, you must integrate with eCommerce APIs to accept donations. The Donation Campaigns API doesn't process payments.
You can integrate with eCommerce APIs to accept donations in the following ways:
Wix Donations app form: Add the built-in donation form to a site. The form handles the eCommerce integration automatically. This form option requires minimal setup and lets you start accepting donations quickly.
Manual eCommerce API integration: Manually integrate donations with Wix eCommerce APIs. Use this approach when you want to customize the donation process, control the checkout experience, or create custom donation flows. The eCommerce APIs allow you to tailor the donation process to your specific requirements. For example, you can call the API to add a donation to the cart and let Wix eCommerce handle the rest of the checkout flow. This option requires more development work but provides greater flexibility and customization.
Wix eCommerce processes donations as orders. To retrieve donations for a campaign, call Search Orders and filter by:
This returns all orders (donations) associated with the specified campaign.
You can also view donations for a specific campaign in a site's dashboard. To do so, click View Donations on the Donations dashboard page.
Campaign metrics provide aggregated insights into fundraising progress. The metrics automatically aggregate data from all donations associated with the campaign.
Get Donation Campaign Metrics retrieves the total donation count and the amount collected. The metrics are real time and reflect successful donations processed.