GET /api/Gift/list with query-parameter filters, and a more powerful POST /api/Gift/query with a structured request body. This workflow page covers both and shows when to use each.
For the resource-level reference of the Gift record itself, see Gifts.
When to use this workflow
| Scenario | Approach |
|---|---|
| Pulling a quick list of recent gifts for display | GET /api/Gift/list with Take and a sort |
| Free-text search across gift fields | GET /api/Gift/list with the Filter parameter |
| Exporting all gifts within a date range | POST /api/Gift/query with a date condition |
| Filtering by donor, campaign, designation, or status | POST /api/Gift/query with structured conditions |
| Streaming gifts for a downstream sync | POST /api/Gift/query with ID-cursor iteration |
| Getting all gifts for a specific donor | GET /api/Donor/{donorId}/gifts — cheaper than a Query with a donorId filter |
Pattern 1: simple list with GET /api/Gift/list
The simplest read. Documented parameters:
| Parameter | Type | Description |
|---|---|---|
Filter | string | Free-text filter |
Skip | integer | Records to skip |
Take | integer | Records to return per page |
SortBy | string | One of: amount, date, donorname, id, status (case-insensitive) |
Descending | boolean | Sort direction |
IncludeDetails | boolean | Include related entities (Donor, Gateway, Segment, etc.) |
Recent gifts for a dashboard
cURL
When IncludeDetails is worth the cost
IncludeDetails=true adds the Donor record, gateway details, segment context, and other related entities to each item in the response. Useful when:
- You’re displaying gifts with donor info in a single UI view (avoids a follow-up lookup per gift).
- You’re exporting gifts to an external system that needs the full context per record.
- You only need summary fields (amount, date, donor ID) for aggregation.
- You’re streaming large result sets — the extra payload per record adds up.
IncludeDetails=false and fetch related records only when needed.
Sort fields available
The Gift/list endpoint documents five sortable fields:
| Field | Sorts by |
|---|---|
amount | Donation amount |
date | Gift date |
donorname | Donor’s display name |
id | Gift’s internal ID — best for stable iteration |
status | Gift’s status integer |
id — it’s the only field guaranteed to be stable across pages even if records are inserted or updated concurrently.
Pattern 2: structured filter with POST /api/Gift/query
For anything beyond free-text search, use the structured query body. The body fields:
| Field | Type | Description |
|---|---|---|
skip | integer | Records to skip |
take | integer | Records per page |
sortBy | string | Same options as /list (amount, date, donorname, id, status) |
descending | boolean | Sort direction |
includeDetails | boolean | Include related entities |
queryType | integer | Required — the integer for the Gift query type. Discover via GET /api/Query/options/{queryType}. |
groups | array of QueryGroupModel | The filter structure |
selectedColumns | array of strings | Subset of fields to return per item |
filter | string | Free-text filter (same role as Filter on /list) |
Common filter scenarios
Gifts within a date range
cURL
The
operator integers (10, 11 used here as placeholders for “greater than or equal” and “less than or equal”) and the conjunct integer (0 for AND) need to be discovered via GET /api/Query/options/{queryType}. The spec doesn’t label the QueryOperator enum’s 30 integer values or the ConjunctOperator enum’s 2 values. See Pagination and Filtering: Discovering query options.Gifts above a certain amount
cURL
Gifts for a specific campaign
cURL
campaignId here) may vary — confirm via GET /api/Query/options/{queryType} for the Gift query type.
Gifts in a non-final status
cURL
Combining filters with AND / OR
A common combined query: recent gifts above a threshold from a specific Campaign:conjunct integer (0 or 1, mapping to AND or OR — confirm via discovery). For complex multi-criteria filters, prototype against the live API to confirm the resulting logic matches your intent.
Reducing payload size
For bulk reads where you don’t need every field,selectedColumns reduces the per-item payload:
cURL
id, amount, date, donorId, and status — much smaller per record than the default full payload. For workflows that aggregate millions of gifts, this can be the difference between a 10-minute query and a one-hour query.
The set of selectable columns is discovered via GET /api/Query/options/{queryType}.
Iteration patterns for bulk reads
Standard skip/take loop
For result sets in the hundreds or low thousands:JavaScript
ID-cursor iteration for very large sets
For result sets in the tens of thousands or larger, theskip-based loop becomes inefficient at high offsets and is vulnerable to inserts shifting the page boundaries. ID-cursor iteration handles both:
JavaScript
GT_OPERATOR constant comes from discovery via GET /api/Query/options/{queryType} at integration startup. See Pagination and Filtering: ID-cursor iteration.
A common pattern: incremental sync
For partner integrations that periodically pull new gifts since the last run:JavaScript
- Advance the checkpoint to the last successful record’s timestamp, not to the current time. If the sync run crashes mid-stream, the next run resumes from the last actually-processed record.
- Sort by
idascending within the cursor loop so each page’s last record is the highest ID seen so far. - Skip an explicit total check — the cursor loop naturally terminates when a page is empty.
Performance considerations
| Pattern | Why it matters |
|---|---|
Use Take=1000 for bulk reads | Each request consumes one rate-limit slot; larger pages mean fewer requests. |
Sort by id for stable iteration | Other sort fields can shift pages if records change during iteration. |
Use IncludeDetails=false for bulk reads | The default summary representation is smaller per record. |
Use selectedColumns when you don’t need every field | Reduces payload size significantly for queries that only need a few columns. |
| Filter aggressively in the request | A query that returns 500 records after filtering is much cheaper than one that returns 50,000 you discard client-side. |
| Cache the QueryOptions discovery result | The integer-to-label mapping doesn’t change often. Cache it at integration startup. |
Where to go next
Query Donors by Filters
The Donor-specific version of these patterns.
Pagination and Filtering
The reference-level documentation of both endpoint surfaces and the integer-enum discovery patterns.
Gifts
The Gift resource reference — the fields you’re querying and selecting.
Reconcile with CRM+
Apply these query patterns to the cross-product reconciliation workflow.