DOCS

REST API & meta fields

This page documents the REST endpoints registered by Fundations FREE (version 2.8.x), the AJAX endpoint used by the donation form, and the meta fields exposed through the WordPress REST API.

Why use the REST API

The REST API lets you read fundraiser and donation data from external systems, mobile apps, or JavaScript running outside the block editor. The custom get-fund/v1 namespace provides gallery management endpoints. Standard WordPress REST API endpoints expose fundraiser and donation records with all registered meta fields.

Custom REST namespace: get-fund/v1

Base URL: /wp-json/get-fund/v1

Fundations registers endpoints in this namespace for webhook handling and gallery management.

PayPal webhook

PropertyValue
MethodPOST
Path/wp-json/get-fund/v1/paypal-webhook
AuthenticationNone (PayPal posts without credentials)
Sourceincludes/donation/trait-registration.php

Handles the following PayPal webhook event types:

  • PAYMENT.CAPTURE.COMPLETED: marks the donation as paid and fires get_fund_donation_paid
  • PAYMENT.CAPTURE.DENIED: marks the donation as failed
  • CHECKOUT.ORDER.VOIDED: marks the donation as cancelled

All gallery endpoints share the same permission callback: the request must be authenticated as a user who holds the edit_post capability on the fundraiser, or whose user ID matches the _get_fund_creator_id meta value on that post.

PropertyValue
MethodGET
Path/wp-json/get-fund/v1/actions/{id}/gallery
AuthenticationPublic (no credentials required for reading)
Sourceincludes/class-get-fund-gallery.php

Returns the gallery image array for a get_fund_action post. Each entry includes id, url, full, thumbnail, medium, large, alt, caption, and title.

PropertyValue
MethodPOST
Path/wp-json/get-fund/v1/actions/{id}/gallery
Authenticationedit_post capability or post creator
Sourceincludes/class-get-fund-gallery.php

Replaces the gallery image list for the fundraiser.

PropertyValue
MethodDELETE
Path/wp-json/get-fund/v1/actions/{id}/gallery/{image_id}
Authenticationedit_post capability or post creator
Sourceincludes/class-get-fund-gallery.php

Removes a single image from the gallery by its attachment ID.

PRO-only webhook endpoints

The following endpoints are registered by the fundations-pro plugin. They are not available in the FREE plugin.

MethodPathProvider
POST/wp-json/get-fund/v1/mollie-webhookMollie
POST/wp-json/get-fund/v1/stripe-webhookStripe

Both endpoints process payment status updates from their respective payment providers and fire get_fund_donation_paid when a payment is confirmed.

Donation form AJAX endpoint

The donation form does not use the REST API. It submits to the standard WordPress AJAX handler.

PropertyValue
Actionget_fund_process_donation
URL/wp-admin/admin-ajax.php
MethodPOST
Nonce fieldget_fund_donation_nonce
Rate limit5 requests per IP per 15 minutes (configurable via get_fund_submission_rate_limit filter)
HoneypotPresent on every form submission

This endpoint is not a REST endpoint and does not use the get-fund/v1 namespace. Do not call it as /wp-json/get-fund/v1/donate.

WordPress REST API: post type endpoints

Both the get_fund_action and get_fund_donation post types are registered with show_in_rest = true, which makes them available through the standard WordPress REST API.

Post typeREST baseEndpoint
get_fund_actionget_fund_action/wp-json/wp/v2/get_fund_action
get_fund_donationget_fund_donation/wp-json/wp/v2/get_fund_donation

Standard WordPress authentication and capability checks apply. Only published posts are returned to unauthenticated requests.

Campaign meta fields

Registered on the get_fund_action post type. All fields use show_in_rest = true.

FieldTypeDescription
_get_fund_amountfloatGoal amount
_get_fund_raised_amountfloatTotal donations (kept in sync with the stats table)
_get_fund_raised_amount_offsetfloatManual adjustment added to the displayed total
_get_fund_statusstringactive, completed, pending, or cancelled
_get_fund_end_datestringExpiration date in Y-m-d format
_get_fund_expiredboolSet to true when the expiration cron marks the post expired
_get_fund_creator_idintWordPress user ID of the fundraiser creator
_get_fund_creator_namestringDisplay name (stored for guest creators who have no user account)
_get_fund_creator_anonymousboolWhether the creator is displayed anonymously
_get_fund_is_campaignbooltrue when this is a parent campaign that others may join
_get_fund_campaign_idintParent campaign post ID for child fundraisers
_get_fund_team_idintTeam post ID for team members
_get_fund_structure_typestringOne of individual, join_team, or create_team
_get_fund_gallery_imagesarrayAttachment IDs for the gallery
_get_fund_updatesarrayCampaign updates stored as structured data
_get_fund_claim_tokenstring30-day token for guest fundraiser claim flow

Donation meta fields

Registered on the get_fund_donation post type. All fields use show_in_rest = true.

FieldTypeDescription
_get_donation_amountfloatDonation amount
_get_donation_typestringDonation type
_get_donation_action_idintRelated get_fund_action post ID
_get_donation_donor_namestringFull donor name
_get_donation_donor_first_namestringFirst name
_get_donation_donor_middle_namestringMiddle name
_get_donation_donor_last_namestringLast name
_get_donation_marketing_consentboolWhether the donor opted in to marketing
_get_donation_donor_emailstringDonor email address
_get_donation_donor_phonestringDonor phone number
_get_donation_messagestringOptional message from the donor
_get_donation_statusstringPayment status: pending, paid, cancelled, failed
_get_donation_payment_idstringTransaction ID from the payment provider
_get_donation_datestringDonation date
_get_donation_payment_providerstringProvider slug: paypal, mollie, stripe, test
_get_donation_mollie_customer_idstringMollie customer ID (PRO)
_get_donation_mandate_idstringMollie mandate ID for recurring (PRO)
_get_donation_subscription_statusstringRecurring subscription status (PRO)
_get_donation_next_payment_datestringNext scheduled payment date (PRO)
_get_donation_original_donation_idintOriginal donation ID for recurring child donations (PRO)

Custom donations table

In addition to the WordPress post type, Fundations writes donation records to a custom database table {prefix}get_fund_donations when the custom table is ready. Code that reads donations should use Get_Fund_Donation_Model::is_custom_table_ready() to check whether the table exists before writing to it, and is_using_custom_table() to determine which storage layer to read from. These two checks are distinct: the table can exist without the read-mode flag being enabled.

What you cannot do

  • The donation form cannot be submitted via the REST API. It requires the AJAX handler with a valid nonce.
  • Mollie and Stripe webhook endpoints are PRO-only. Posting to those paths will return a 404 on a FREE-only installation.
  • The get_fund_donation post type uses WordPress authentication for write operations. You cannot update donation records without the appropriate capability.