Sources
List All
GET
/settings/sources.xml
Returns a list of sources for the organization. The list is paginated using the
page
parameter. To specify a page number, request a url like /settings/sources.xml?page=2
.
Response
Status: 200 OK
<sources type="array"> <current_page type="integer">1</current_page> <per_page type="integer">30</per_page> <total_entries type="integer">7</total_entries> <source> <id type="integer">10003</id> <name>Fall Mailing</name> ... </source> <source> ... </source> </sources>
Show
GET
/settings/sources/1.xml
Response
Status: 200 OK
<source> <id type="integer">10003</id> <name>Fall Mailing</name> ... </source>
Meta
The source may also return a serialized element named "meta", which contains additional information about a source.
<meta type="yaml"> --- !map:HashWithIndifferentAccess quickbooks_item_name: "Item Name" quickbooks_income_account_name: "Income Account Name" </meta>
Update
PUT
/settings/sources/1.xml
<source> <id type='integer'>1</id> <archived type='boolean' nil='true'/> <description nil='true'/> <ends-on type='date' nil='true'/> <goal-in-cents type='integer' nil='true'/> <meta type='yaml' nil='true'/> <name>Individual Contributions</name> <starts-on type='date' nil='true'/> </source>
Response
Status: 200 OK
Create
POST
/settings/sources.xml
<source> <id type='integer'>1</id> <archived type='boolean' nil='true'/> <description nil='true'/> <ends-on type='date' nil='true'/> <goal-in-cents type='integer' nil='true'/> <meta type='yaml' nil='true'/> <name>Individual Contributions</name> <starts-on type='date' nil='true'/> </source>
Required Attributes
- name (must be unique)
- organization_id
Response
Status: 201 Created
Location: /settings/sources/1.xml
<source> <name>Fall Mailing</name> ... </source>
Delete
You must pass a replacement fund ID in order to delete a fund. All donations assigned to the fund being deleted will be reassigned to the replacement fund.
DELETE
/settings/sources/1.xml?replacement_source_id=2
Response
Status: 200 OK