Environment configuration
Keep base URLs in config and swap by environment:Backend proxy
Endaoment user access tokens must stay on your server. Your frontend calls your backend; your backend calls Endaoment with the user’s Bearer token.OAuth with PKCE
Standard donor integrations authenticate users with OAuth 2.0 Authorization Code + PKCE:- Your backend creates
code_verifier,code_challenge, andstate. - Redirect the user to
{AUTH_URL}/authwithclient_id,redirect_uri, PKCE params, scopes, andprompt=consentwhen you need refresh tokens. - User logs in; Endaoment redirects back with
codeandstate. - Your backend exchanges the code at
POST {AUTH_URL}/tokenusingAuthorization: Basic base64(clientId:clientSecret)and the storedcode_verifier. - Store
access_token(and optionallyrefresh_token) for subsequent API calls.
Common quickstart combination:
openid accounts transactions profile email address. Add offline_access only when you need refresh tokens — and include prompt=consent on the /auth redirect or refresh tokens are silently omitted.
Redirect URIs: Local dev commonly uses http://localhost:5454. Register all redirect URLs with Endaoment before testing.
Full PKCE implementation: GitHub quickstart sample.
Dev token shortcut
While OAuth is in progress, issue test tokens with the Access Token Issuer Tool. Development only—not for production.Bearer authentication
Authenticated Endaoment API calls use the user’s access token:GET /v1/auth/whoami.
Partner auth options
Most partner endpoints requirex-api-key. Acting-user context varies by endpoint — check the specific API reference page before integrating.
POST /v1/funds/partner accepts either a registered OAuth user Bearer token or partner server-to-server credentials (x-api-key, optionally with impersonation headers or body partnerUserIdentifier).
Partner fund creation (POST /v1/funds/partner)
Pick the path that matches your integration preference:
When both a header/OIDC user and body
partnerUserIdentifier are supplied, they must resolve to the same user.
Partner settled donations (POST /v1/donation-pledges/partner/*-settled)
Other partner endpoints
See Partner Journey and Partner Endpoints.
Idempotency
Donation pledges and grant submissions require anidempotencyKey in the request body. Generate a new UUID per user action, and reuse that same key for every retry of that action.
- An identical replay returns the original record instead of creating a second one. This is what makes retrying safe.
- A changed payload under the same key is rejected, almost always as
409 Conflict. Either way your change is not applied and the original record is untouched. The rejection is what you can rely on, not the exact status. - A settled pledge cannot be amended by replaying it. Settled routes record money that has already moved, so a corrected amount sent under the same key is rejected rather than applied. Reaching for a new key does not get the correction in either: keep the same
partnerOperationIdand you get another409, because that is the pair we record against. Change thepartnerOperationIdas well and it does go through, as a second and separate donation for money that moved once. Ask us to correct the record instead.
Amounts in microdollars
Monetary fields use microdollars (1 USD =1_000_000):
Public vs authenticated endpoints
Some endpoints do not require a Bearer token:
You may call these from your backend or directly from a client. Authenticated flows should still prefer a backend proxy for consistency.