A PledgeCampaign is a way to request and track long-terms commitments to a particular goal or project.
| Property | Value |
|---|---|
| Product | Giving (pco.giving, API version 2019-10-18) |
| Resource type | PledgeCampaign |
| TypeScript | Giving.PledgeCampaign, attributes Giving.PledgeCampaignAttributes, schema Giving.PledgeCampaignSchema |
| Planning Center path | /giving/v2/pledge_campaigns |
| Planning Center docs | PledgeCampaign |
How to reach it
| Client path | Returns | Filters | Create |
|---|---|---|---|
pco.giving.pledge_campaigns |
Collection | Yes | |
pco.giving.people.id(personId).pledges.id(pledgeId).pledge_campaign |
Collection | No |
From a collection, .id(pledgeCampaignId) addresses one PledgeCampaign: pco.giving.pledge_campaigns.id(pledgeCampaignId). Collections support where, include, order, and pagination; single resources have get().
Attributes
On Giving.PledgeCampaignAttributes. Every resource also has id and type ('PledgeCampaign') next to its attributes.
| Name | Type | Description |
|---|---|---|
created_at |
string | null |
|
description |
string | null |
|
ends_at |
string | null |
|
goal_cents |
number | null |
Optional. During the donation period of this campaign, the running total of donations will be tracked against this number |
goal_currency |
string | null |
|
name |
string | null |
|
received_total_from_pledges_cents |
number | null |
|
received_total_outside_of_pledges_cents |
number | null |
|
show_goal_in_church_center |
boolean | null |
In addition to seeing their personal pledge progress within their donor profile, this option allows donors to see the the collective progress towards the campaign’s overall goal (if set). |
starts_at |
string | null |
|
updated_at |
string | null |
Relationships and includes
Side-load with include() (or get({ include })) and read with related(resource, name): fund.
| Relationship | Type | To | Includable |
|---|---|---|---|
fund |
To one | Fund | Yes |
Querying
Where
where(field, value) for equality; where(field, op, value) with the operators listed.
| Field | Value type | Operators |
|---|---|---|
ends_at |
string | Date |
gt, gte, lt, lte |
fund_id |
string | number |
Equality only |
starts_at |
string | Date |
gt, gte, lt, lte |
Order
order(...) accepts these fields, ascending, or descending with a - prefix: ends_at, starts_at.
Edges
Follow these from one PledgeCampaign, ref = pco.giving.pledge_campaigns.id(pledgeCampaignId):
Writing
| Property | Value |
|---|---|
| Create | Yes, create() on pco.giving.pledge_campaigns |
| Update | Yes, update() on a reference |
| Delete | Yes, delete() on a reference |
Create attributes
Typed as Giving.PledgeCampaignSchema['create'].
| Attribute | Type |
|---|---|
description |
string | null |
ends_at |
string | null |
fund_id |
string |
goal_cents |
number | null |
name |
string | null |
show_goal_in_church_center |
boolean | null |
starts_at |
string | null |
Update attributes
Typed as Giving.PledgeCampaignSchema['update'].
| Attribute | Type |
|---|---|
description |
string | null |
ends_at |
string | null |
fund_id |
string |
goal_cents |
number | null |
name |
string | null |
show_goal_in_church_center |
boolean | null |
starts_at |
string | null |
See Writing data.
Example
import type { Giving } from '@mackenly/planningcenterkit';
const page = await pco.giving.pledge_campaigns.order('ends_at').perPage(25).list();
const items: Giving.PledgeCampaign[] = page.data;