Wix Tree Planting: How to Add Verified Reforestation to a Wix Store
If you run a Wix store and you want to plant a tree for every order, you have probably searched the Wix App Market for a tree planting app and found that the good options are all built for Shopify. That is the usual story in ecommerce sustainability: the tooling clusters on one platform and everyone else gets told to wait. The good news for Wix merchants is that you do not need a packaged app to add verified reforestation. You need an API and a few lines of backend code.
This guide shows Wix store owners and developers how to add verified tree planting to a Wix or Wix Studio store using GoodAPI. It covers why an API beats a widget on Wix, where to hook into the order lifecycle with Velo, and how to keep the integration honest and retry-safe in production.
Why Wix Stores Need an API, Not an App
Wix is not a small platform. Wix eCommerce powers more than 3 million online stores processing over $12.4 billion in annual sales, and Wix leads the broader website-builder market with a 45%+ share. That is a very large number of merchants who care about sustainability and keep getting told the green tooling was built for somebody else’s checkout.
The reason a drop-in app is not the right fit for Wix is the same reason Wix merchants pick the platform: they want to manage their store without standing up a separate backend. Velo gives you exactly that. Velo is Wix’s development platform, and it lets you run server-side code that reacts to store events without leaving the Wix environment. So instead of waiting for a vendor to ship a Wix app, you can connect a sustainability API directly to the moment an order is paid.
What an API-first approach buys you
A platform-agnostic planting API gives a Wix team three things a hypothetical app could not. You decide the trigger, so a tree can be planted on a paid order, a subscription renewal, a bookings payment, or any custom milestone you define in code. You own the data, so you can attribute trees to specific orders and pull verification evidence into your own dashboard or customer-facing pages. And you stay portable, because the same call survives a redesign, a migration to Wix Studio, or even a future move off Wix entirely.
GoodAPI was built as that kind of API first and a Shopify app second. The REST endpoint is the product, which is why it drops cleanly into Velo, into a Magento module, into a headless React build, or anywhere else your order logic lives.
What You Will Build
The pattern here is deliberately simple and production-shaped: a customer completes checkout, Wix confirms the order is paid, a backend Velo event handler observes that event, and your code calls GoodAPI to plant a tree attributed to the order. Planting on the paid event rather than at checkout submission means you never plant a tree for an order that never actually pays.
In Velo terms, that is one backend event handler and one helper function that makes the HTTPS request. No app submission, no theme widget, no front-end changes.
Step-by-Step: Wix Tree Planting With GoodAPI
Get your API keys
Sign up at app.thegoodapi.com for a production key and a test key. Both behave identically, but the test key never charges you and never plants real trees, so use it for the entire build. Store the key with Wix Secrets Manager, never hard-coded in a backend file.
Enable Velo and add a backend events file
Turn on Dev Mode (Velo) in the Wix editor. In the Backend section of the code panel, create or open events.js. This is where Wix runs your server-side event handlers, and it is the right home for a planting call.
Listen for the order-paid event
Export a handler for the Wix eCommerce order-paid event. On classic Wix Stores that is wixStores_onOrderPaid; on the newer Wix eCommerce APIs you can use the wix-ecom-backend order events. The handler fires once payment is confirmed.
Call the plant/trees endpoint
From the handler, send a POST to https://app.thegoodapi.com/plant/trees using Velo’s fetch, with your key in the Authorization header and a body that includes a count, an attribution, and an idempotency_key set to the Wix order ID.
Surface verified impact to customers
Call GET /plant/trees and GET /evidence from backend code to read running totals and verification media, then render a “trees planted” figure on your storefront, a thank-you page, or order confirmation emails.
The backend event handler
In backend/events.js, the handler is short. It reads the order, then calls a helper that talks to GoodAPI. Keeping the request in a separate backend module makes it easy to reuse and to test.
import { plantTreeForOrder } from 'backend/goodapi.web';
export function wixStores_onOrderPaid(event) { const orderId = event.orderId; const lineItemCount = event.number; // human-readable order number for attribution return plantTreeForOrder(orderId, lineItemCount);}The GoodAPI call
The helper does the actual planting. Note the idempotency_key: passing the Wix order ID means that if Wix retries the event, or you replay it during testing, GoodAPI recognizes the order and never plants a second tree for it.
import { getSecret } from 'wix-secrets-backend';import { fetch } from 'wix-fetch';
export async function plantTreeForOrder(orderId, orderNumber) { const apiKey = await getSecret('GOODAPI_KEY');
const response = await fetch('https://app.thegoodapi.com/plant/trees', { method: 'post', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ count: 1, attribution: `wix-order-${orderNumber}`, idempotency_key: orderId }) });
return response.json();}That is the whole integration. One paid order in, one verified tree out, attributed and de-duplicated.
Keeping It Honest: Verification, Not a Logo
Adding a “we plant a tree per order” badge is easy. Backing it up is where most sustainability claims fall apart, and where shoppers and regulators are increasingly skeptical. This is the part of the build that matters most.
GoodAPI’s reforestation partner is Veritree, a verified reforestation organization with global projects. Planting through GoodAPI means each tree is tracked, geolocated, and supported through its critical first years of growth, not just counted at the moment money changes hands. Because you can read that evidence back through the GET /evidence endpoint, you can show customers the actual project and verification media rather than a generic leaf icon.
Wix Studio and headless builds
If you are on Wix Studio or running a headless front end against Wix data, the same logic applies. The planting call belongs on the server, fired by the paid-order event or your own webhook, never in client-side code where the API key would be exposed. Velo backend functions and the wix-ecom-backend order events give you a clean place to put it, and the GoodAPI request itself does not change.
Start Planting From Your Wix Store
Wix merchants have spent a long time on the wrong side of the sustainability tooling gap. With GoodAPI you do not have to wait for a Wix app to catch up. A backend Velo event handler, one API call, and a test key are enough to add verified reforestation to your store this afternoon and ship it once you are happy with it.
If your store runs on Shopify as well, the same verified planting is available as a native install through the GoodAPI app on the Shopify App Store. And if you want to go deeper on the technical side, the GoodAPI tree planting API guide walks through the endpoints, attribution, and evidence flow in more detail. Either way, the model is the same: a flat $0.43 per tree, no monthly fee, and trees you can actually prove were planted.
Ready to build? Grab a test key at thegoodapi.com and have your first verified tree planted from a Wix order before lunch.