Skip to content

Payments​

Stripe payment processing


Get checkout config​

GET
/payments/checkout-config

What the donation checkout prices with: whether the one-sheet checkout
is on for this caller, the fee rule for each kind of payment method, the
version of the "Save for next time" wording, Stripe's minimum charge,
and whether each checkout offers a tip to FundlyHub (tips). The
checkout carries no rate and no tip default of its own; it reads them
here.

sheetEnabled is the server's own answer for the
features.donate_sheet_v2 setting, the same answer
POST /payments/create-intent checks in sheet mode. While it is
false, show the previous checkout.

Public, and authentication is optional: it changes sheetEnabled only
while the setting is off, for a signed-in operator the setting allows.
The answer is Cache-Control: no-store.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)
or

Responses​

The checkout config.

application/json
JSON
{
"data": {
"sheetEnabled": false,
"feeSchedule": {
"card": {
"percent": 0.029,
"fixedCents": 30,
"capCents": null
},
"card_intl": {
"percent": 0.044,
"fixedCents": 30,
"capCents": null
},
"us_bank_account": {
"percent": 0.008,
"fixedCents": 0,
"capCents": 500
}
},
"saveConsentVersion": "2026-11-09",
"minimumChargeCents": 50,
"tips": {
"fundly_gift": true,
"nonprofit_gift": false,
"platform_tip": true,
"event_tickets": false,
"community_fund_gift": false,
"community_dues": false,
"creator_membership": false
}
}
}

Playground​

Server
Authorization

Samples​


Get the caller's anonymous alias key​

GET
/payments/anonymous-identity

The opaque key an anonymous gift from this caller is shown under on
public pages, so the checkout can name the alias ("Shown on the page
as Anonymous Neighbor") before the donor pays. It is the same
anonymous_key the public donor lists carry for that donor's
anonymous gifts; seed the alias and its avatar from it exactly as
those lists do.

Signed in, the key is the account's. For a guest it is the key their
earlier anonymous gifts from this browser or network already use, or
null when a gift from them would start a new identity (its alias is
known only once the gift exists). Show the plain "Anonymous" wording
for null; never guess an alias.

Asking creates nothing and changes nothing: no donor, no identity and
no gift is written. The key is not a credential and names nobody.
Public, authentication optional. The answer is
Cache-Control: private, no-store.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)
or

Responses​

The key, or null.

application/json
JSON
{
"data": {
"anonymous_key": "3f9a1c0b7d2e4a6f8b10"
}
}

Playground​

Server
Authorization

Samples​


Create payment intent​

POST
/payments/create-intent

Create a Stripe PaymentIntent for a donation. This is the first half of
the donation flow; confirm it with POST /payments/confirm once Stripe
reports the payment succeeded.

Every field is snake_case, and every amount is in integer cents.
amount_cents is the donation itself; tip_amount_cents is the
optional tip to FundlyHub. A tip is taken only while the checkout's
switch is on: tips.fundly_gift from GET /payments/checkout-config
for a personal Fundly, tips.nonprofit_gift for a church or
non-profit's campaign. While it is off, a non-zero tip answers 409
tip_not_offered and nothing is charged; it is never dropped
silently. The charge Stripe sees is
amount_cents + tip_amount_cents, and it must clear Stripe's $0.50
(50 cent) minimum.

amount_cents was called amount. The value was always cents — only
the name has changed, so that it says so.

fundraiser_id decides where the money goes. Omit it and the
PaymentIntent is created against the platform account with no campaign
attribution — the donation is not credited to any campaign and no
transfer to a creator is scheduled. It is optional in the sense that
the request succeeds without it, not in the sense that it is safe to
leave out.

The campaign must be active and not deleted; anything else is
rejected (404 if the id is unknown, 409 if the campaign exists but
cannot accept money).

Authentication is optional — a signed-in donor gets the donation linked
to their account, an anonymous one does not. reCAPTCHA is enforced
(see below), except that a signed-in session whose email is verified
may omit the token. While donations are switched off platform-wide the
request is refused with 403 and no PaymentIntent is created.
A personal campaign reserves its pending donation under the fundraiser row
lock before the provider request, preventing concurrent owner/beneficiary
reassignment. The same row is enriched with the PaymentIntent before its
client secret is returned. Unconfirmed intents whose reservation cannot
be saved are canceled and the request fails; no usable secret is returned.
Failed preparation remains a failed payment attempt without increasing
raised totals. Nonprofit checkout keeps its existing immutable reservation.

Two modes. A request without confirmation_token_id or
payment_method_id is the previous checkout, unchanged: the gift is
priced with the card fee rule, the PaymentIntent offers Stripe's
payment methods except US bank accounts, and the browser confirms it
with Stripe.js using client_secret.

Sheet mode is the one-sheet checkout, used while sheetEnabled
from GET /payments/checkout-config is true. The request carries
exactly one way to pay: confirmation_token_id for a new card, US
bank account, Apple Pay, Google Pay or Link payment (from Stripe.js
createConfirmationToken), or payment_method_id for one of the
signed-in donor's saved methods. The server reads the method, prices
the gift with that method's fee rule (fee_kind), creates a
PaymentIntent for that method only, records the pending gift, and
confirms the payment itself. The 200 answer carries the
PaymentIntent's status:

  • succeeded: the payment went through.
  • processing: a US bank debit was accepted. It takes about four
    business days to clear. The gift is recorded and counted now, like a
    card gift, and is reversed if the bank returns the debit.
  • requires_action: the card issuer wants the donor to authenticate
    (3-D Secure). Finish it in the browser with
    stripe.handleNextAction({ clientSecret }).

Then call POST /payments/confirm with payment_intent_id. A decline
answers 402 and charges nothing: the PaymentIntent is canceled, and
the next try is a new request. Sheet mode is refused with 409
sheet_disabled while features.donate_sheet_v2 is off for the
caller. reCAPTCHA, App Attest, Play Integrity and features.donations
apply to both modes.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)
or

Parameters​

Header Parameters

x-recaptcha-token

reCAPTCHA v3 token, action payment. Required unless supplied as recaptcha_token in the body, or the caller is a signed-in session with a verified email. Missing (guest or unverified) → 400; failing the score threshold → 403, whoever sent it.

Type
string
x-app-attest-key-id

iOS only. The App Attest key id (standard base64, as DCAppAttestService.generateKey returns it) of a key registered with POST /app-attest/attest. Send with x-app-attest-assertion.

Type
string
x-app-attest-assertion

iOS only. base64 of the assertion from generateAssertion(keyId, clientDataHash: SHA256(raw request body)). The body must carry a fresh app_attest_challenge. A valid assertion replaces the reCAPTCHA token; the headers alone never do. An invalid one answers 403 with code APP_ATTEST_INVALID, APP_ATTEST_KEY_UNKNOWN (attest a new key) or APP_ATTEST_CHALLENGE_INVALID (fetch a new challenge), unless the request passes reCAPTCHA some other way.

Type
string
x-play-integrity-token

Android only. A Google Play Integrity standard token, requested with requestHash = lowercase hex SHA-256 of the raw request body. The body must carry a fresh play_integrity_challenge from POST /play-integrity/challenge. A valid token replaces the reCAPTCHA token; the header alone never does. An invalid one answers 403 with code PLAY_INTEGRITY_INVALID, PLAY_INTEGRITY_CHALLENGE_INVALID (fetch a new challenge) or PLAY_INTEGRITY_UNAVAILABLE (Google could not be reached), unless the request passes reCAPTCHA some other way.

Type
string

Request Body​

application/json
JSON
{
"amount_cents": 5000,
"currency": "usd",
"fundraiser_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"tip_amount_cents": 500,
"tip_percent": 10,
"donor_email": "donor@example.com",
"donor_name": "Alex Rivera",
"is_anonymous": false
}

Responses​

PaymentIntent created. In sheet mode it has also been confirmed, and status says how that went.

application/json
JSON
{
"client_secret": "pi_3abc123def456_secret_Example",
"payment_intent_id": "pi_3abc123def456",
"amount_cents": 5500,
"stripe_fee_cents": 190,
"net_amount_cents": 4810,
"fee_kind": "card"
}

Playground​

Server
Authorization
Headers
Body

Samples​


Confirm payment​

POST
/payments/confirm

Confirm a PaymentIntent that Stripe reports as succeeded, or as
processing, and settle the donation record.

The field is payment_intent_id (snake_case) — the value returned as
payment_intent_id by POST /payments/create-intent.

A US bank debit is processing for about four business days. Its
gift is recorded paid now and shown and counted like a card gift, and
the answer says status: processing and clearing: true: the money
has not cleared yet. When Stripe reports the debit succeeded, the gift
stops clearing and its receipt is sent. If the bank returns the debit,
the gift is reversed: payment_status becomes failed and it no
longer counts.

Safe to retry: a PaymentIntent whose donation is already paid is
returned as-is rather than double-counted. Stripe webhooks reconcile the
same donation independently, so a client that never reaches this call
still ends up with a settled donation — calling it just makes the
receipt available immediately.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)
or

Request Body​

application/json
JSON
{
"payment_intent_id": "pi_3abc123def456"
}

Responses​

Payment confirmed; the settled donation is returned.

application/json
JSON
{
"data": {
"id": "string",
"fundraiser_id": "string",
"donor_user_id": "string",
"donor_name": "string",
"donor_avatar": "string",
"amount_cents": 5000,
"currency": "USD",
"tip_amount_cents": 500,
"fee_amount_cents": 175,
"net_amount_cents": 4825,
"payment_status": "string",
"payment_provider": "string",
"payment_intent_id": "string",
"receipt_id": "string",
"comment": "string",
"is_anonymous": true,
"anonymous_key": "string",
"created_at": "string",
"campaign_title": "string",
"campaign_slug": "string",
"card_brand": "string",
"card_last4": "string",
"payment_method_type": "string",
"bank_name": "string",
"bank_last4": "string",
"wallet_type": "string",
"fee_kind": "string",
"payment_clearing": true,
"status": "string",
"clearing": true
}
}

Playground​

Server
Authorization
Body

Samples​


Powered by VitePress OpenAPI

Built with VitePress