Hosted PayPal donation
When an identified supporter completes checkout in the campaign widget, Our Impact records
donation.completed after PayPal capture succeeds.Guide · Events
Server onlyEvents are the evidence entitlement rules evaluate. Our Impact automatically records completed donations from its widget; use the API for trusted activity completed elsewhere.
donation.completed after PayPal capture succeeds.client.events.createVerifiedEvent().Use the project secret from a trusted server. The SDK maps camelCase input to the API’s snake_case wire format.
import { OurImpactClient } from "@our-impact/node";
const ourImpact = new OurImpactClient({
secretApiKey: process.env.OUR_IMPACT_SECRET_KEY,
});
const result = await ourImpact.events.createVerifiedEvent({
body: {
id: "donation_01JABC123",
type: "donation.completed",
externalUserId: "storefront:user_01JABC",
displayName: "Avery",
occurredAt: new Date("2026-11-06T12:00:00Z"),
properties: {
amount_minor: 5000,
currency: "USD",
organization_id: 42,
},
},
});curl https://our-impact.vercel.app/api/v1/events \
--request POST \
--header "Authorization: Bearer $OUR_IMPACT_SECRET_KEY" \
--header "Content-Type: application/json" \
--data '{
"id": "donation_01JABC123",
"type": "donation.completed",
"external_user_id": "storefront:user_01JABC",
"occurred_at": "2026-11-06T12:00:00Z",
"properties": {
"amount_minor": 5000,
"currency": "USD",
"organization_id": 42
}
}'idRequiredtypeRequireddonation.completed. Entitlement definitions match this value exactly.externalUserIdRequiredoccurredAtOptionalpropertiesOptional{
"id": "d85b1407-351d-4694-9ac2-9c88b415c8c6",
"replayed": false,
"entitlements": [
{
"entitlement_key": "community_champion",
"state": "active",
"qualifying_count": 1,
"progress_value": 5000,
"progress_unit": "usd",
"qualified_at": "2026-11-06T12:00:01Z",
"valid_until": null,
"updated_at": "2026-11-06T12:00:01Z"
}
]
}The response is useful for immediate server reactions. Monetary progress remains an integer in minor units: 5000 with usd means $50.00. Browser experiences should still fetch the current entitlement view using a fresh identity token.