Overview
Calculate and return various metrics for a church's contributions.
This function computes key metrics related to contributions for a specific church, including: - Total completed contributions. - Total and percentage change for recurring monthly contributions. - Total and percentage change for recurring weekly contributions. - Average contribution amount.
The metrics are calculated by filtering and aggregating data from the church's contributions and related transactions.
:param request: The HTTP request object containing user and church information. :return: JSON response with the calculated metrics.
GET /api/give/contributions/overview HTTP/1.1
Host: prosper-api-test.churchpad.com
Authorization: Bearer JWT
Accept: */*
{
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"contributions": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"description": "text",
"interval_length": 1,
"interval_unit": "text",
"total_occurrences": 1,
"frequency": "text",
"start_date": "2025-07-23",
"amount": "text",
"legacy_id": "text",
"nextgen_legacy_id": "text",
"created_at": "2025-07-23T12:18:03.253Z",
"updated_at": "2025-07-23T12:18:03.253Z",
"processor": "stripe",
"payment_id": "text",
"status": "PENDING",
"memo": "text",
"date": "2025-07-23T12:18:03.253Z",
"user": "123e4567-e89b-12d3-a456-426614174000",
"type": "123e4567-e89b-12d3-a456-426614174000",
"church": "123e4567-e89b-12d3-a456-426614174000",
"guest": "123e4567-e89b-12d3-a456-426614174000"
}
],
"church_id": "123e4567-e89b-12d3-a456-426614174000",
"about_user": {
"first_name": "text",
"last_name": "text",
"email": "[email protected]",
"phone_number": "text"
},
"start_date": "2025-07-23",
"payment_method": "text",
"card_token": "text",
"cvv": "text",
"customer_acceptance": {
"ip_address": "text",
"user_agent": "text"
},
"card_details": {
"cc_number": "text",
"cc_expiration": "text",
"cvv": "text"
},
"bank_details": {
"account_number": "text",
"routing_number": "text"
},
"processor_id": "text"
}
Generate detailed contribution reports based on the specified action.
Actions include: - category-types: Contribution percentage per type for a given year. - sources: Contribution percentage per source for a given year. - last-year: Monthly contribution breakdown by type for the past 12 months. - past-years: Contribution breakdown by year and month for the church's existence.
:param request: The HTTP request object containing user and church information. :param route_action: The specific report action to generate. :return: JSON response with the report data.
^(category-types|sources|last-year|past-years)$
GET /api/give/contributions/overview/{route_action} HTTP/1.1
Host: prosper-api-test.churchpad.com
Authorization: Bearer JWT
Accept: */*
{
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"contributions": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"description": "text",
"interval_length": 1,
"interval_unit": "text",
"total_occurrences": 1,
"frequency": "text",
"start_date": "2025-07-23",
"amount": "text",
"legacy_id": "text",
"nextgen_legacy_id": "text",
"created_at": "2025-07-23T12:18:03.253Z",
"updated_at": "2025-07-23T12:18:03.253Z",
"processor": "stripe",
"payment_id": "text",
"status": "PENDING",
"memo": "text",
"date": "2025-07-23T12:18:03.253Z",
"user": "123e4567-e89b-12d3-a456-426614174000",
"type": "123e4567-e89b-12d3-a456-426614174000",
"church": "123e4567-e89b-12d3-a456-426614174000",
"guest": "123e4567-e89b-12d3-a456-426614174000"
}
],
"church_id": "123e4567-e89b-12d3-a456-426614174000",
"about_user": {
"first_name": "text",
"last_name": "text",
"email": "[email protected]",
"phone_number": "text"
},
"start_date": "2025-07-23",
"payment_method": "text",
"card_token": "text",
"cvv": "text",
"customer_acceptance": {
"ip_address": "text",
"user_agent": "text"
},
"card_details": {
"cc_number": "text",
"cc_expiration": "text",
"cvv": "text"
},
"bank_details": {
"account_number": "text",
"routing_number": "text"
},
"processor_id": "text"
}