About eCommerce Integration with Donation Campaigns

The Donation Campaigns API creates campaign entities but doesn't process payments. To accept donations, integrate with the eCommerce Cart and Checkout APIs.

Use the Wix eCommerce APIs when you want to customize the donation process, control the checkout experience, or create custom donation flows. This approach provides the same donation features as the built-in Wix Donations app form but with greater flexibility.

Use the eCommerce APIs as much or as little as you need. For example, you can call Add To Cart to add a donation to the cart and let Wix eCommerce handle the rest of the checkout flow by calling Navigate To Cart Page, or you can build a fully custom experience.

To integrate donation campaigns into an eCommerce cart, checkout, or order, use the catalogReference object structure as part of the lineItems array in the following eCommerce API methods:

Catalog reference object structure

The catalogReference object for donation campaigns includes the following fields:

FieldTypeDescription
catalogItemIdStringRequired. This is the donationCampaignId.
appIdStringRequired. Use the Wix Donations app ID: "333b456e-dd48-4d6b-b32b-9fd48d74e163"
optionsObjectRequired. Contains donation-specific settings.

Options object structure

The options object contains the following fields:

FieldTypeDescription
amountNumberRequired. The donation amount. Must be greater than 0.
frequencyStringOptional. The recurring donation frequency. Omit this field for one-time donations. See supported frequency values.

Frequency values

For recurring donations, use 1 of the following frequency values:

ValueDescription
WEEKA weekly recurring donation.
MONTHA monthly recurring donation.
YEARA yearly recurring donation.

Examples

One-time donation

Copy

Monthly recurring donation

Copy
Did this help?