The Import Batches service allows you to directly create batches with full transaction information in the Pushpay database. In order to import the batches, an XML file with the designated structure must be sent with the service call.
Service Name
import_batches
Parameters for Batch
| Name | Type | Description |
|---|---|---|
| name | string[50] | optional will be appended with API |
| campus id | int | XML attribute on <campus> element. Defaults to first campus if not provided. |
| post_date | date | if not valid will be set to today |
| begin_date | date | optional, defaults to earliest transaction date |
| end_date | date | optional, defaults to latest transaction date |
| batch_id | int | optional |
| in_accounting_package | boolean | optional |
| creator id | int | optional, XML attribute on <creator> element |
| modifier id | int | optional, XML attribute on <modifier> element |
| created | datetime | optional |
| modified | datetime | optional |
| transactions | see below |
Parameters for Transaction
| Name | Type | Description |
|---|---|---|
| merchant_transaction_id | string[75] | optional, XML attribute on <transaction> element |
| individual id | int | XML attribute on <individual> element. If not valid the entire import will stop. |
| date | date | if not valid will be set to post_date |
| grouping id | int | optional, XML attribute on <grouping> element |
| payment_type | string | Must be either cash, check, online, or other |
| check_number | int | optional |
| merchant_name | string[50] | optional |
| merchant_individual_id | string[75] | optional |
| creator id | int | optional, XML attribute on <creator> element. Inherits from batch if not provided. |
| modifier id | int | optional, XML attribute on <modifier> element. Inherits from batch if not provided. |
| created | datetime | optional |
| modified | datetime | optional |
| transaction_details | see below |
Parameters for Transaction Details (Split Payments)
| Name | Type | Description |
|---|---|---|
| transaction_detail_id | int | optional, XML attribute on <transaction_detail> element |
| coa id | int | XML attribute on <coa> element. Either coa id or fund_key is required. |
| coa fund_key | string[36] | XML attribute on <coa> element. Alternative to coa id. |
| amount | float | |
| tax_deductible | Deprecated — this will be set by COA category | |
| note | string[90] |
Example Curl
curl -u user:password -F filedata=@your_local_file_location "http://your_test_site/api.php?srv=import_batches"Example Input XML
<?xml version="1.0" encoding="UTF-8"?>
<ccb_api>
<batch id="19">
<campus id="1"></campus>
<post_date>2013-11-12</post_date>
<transactions>
<transaction id="44" merchant_transaction_id="abc-123">
<individual id="48"></individual>
<date>2006-05-04</date>
<grouping id="1"></grouping>
<payment_type>Cash</payment_type>
<check_number></check_number>
<merchant_name></merchant_name>
<merchant_individual_id></merchant_individual_id>
<transaction_details>
<transaction_detail id="44">
<coa id="1"></coa>
<amount>250.32</amount>
<note>note0</note>
</transaction_detail>
<transaction_detail id="45">
<coa id="2"></coa>
<amount>10.35</amount>
<note></note>
</transaction_detail>
</transaction_details>
</transaction>
<transaction id="45">
<campus id="2"></campus>
<individual id="50"></individual>
<date>2006-05-04</date>
<grouping id=""></grouping>
<payment_type>Check</payment_type>
<check_number>1234</check_number>
<merchant_name></merchant_name>
<merchant_individual_id></merchant_individual_id>
<transaction_details>
<transaction_detail id="46">
<coa id="2"></coa>
<amount>10</amount>
<note></note>
</transaction_detail>
</transaction_details>
</transaction>
</transactions>
</batch>
</ccb_api>Example Response XML
<?xml version="1.0" encoding="UTF-8"?>
<ccb_api>
<request>
<parameters>
<argument value="import_batches" name="srv"/>
</parameters>
</request>
<response>
<service>import_batches</service>
<service_action>execute</service_action>
<availability>public</availability>
<batches count="1">
<batch id="1410">
<campus id="1">User Experience Campus</campus>
<post_date>2013-11-12</post_date>
<begin_date>2016-03-04</begin_date>
<end_date>2016-03-04</end_date>
<in_accounting_package>false</in_accounting_package>
<status>Closed</status>
<source>Created through API</source>
<transactions>
<transaction id="2815">
<campus id="1">User Experience Campus</campus>
<individual id="48">Amy Arnold</individual>
<date>2006-05-04</date>
<grouping id="1">3rd</grouping>
<payment_type>Cash</payment_type>
<check_number></check_number>
<transaction_details>
<transaction_detail id="3271">
<coa id="1">Other</coa>
<amount>250.32</amount>
<tax_deductible>true</tax_deductible>
<note>note0</note>
<creator id="0">System User</creator>
<modifier id="0">System User</modifier>
<created>2016-03-04 01:25:04</created>
<modified>2016-03-04 01:25:04</modified>
</transaction_detail>
<transaction_detail id="3272">
<coa id="2">Benevolence</coa>
<amount>10.35</amount>
<tax_deductible>true</tax_deductible>
<note></note>
<creator id="0">System User</creator>
<modifier id="0">System User</modifier>
<created>2016-03-04 01:25:04</created>
<modified>2016-03-04 01:25:04</modified>
</transaction_detail>
</transaction_details>
<creator id="0">System User</creator>
<modifier id="0">System User</modifier>
<created>2016-03-04 01:25:04</created>
<modified>2016-03-04 01:25:04</modified>
</transaction>
<transaction id="2816">
<campus id="1">User Experience Campus</campus>
<individual id="50">Noell Arrington</individual>
<date>2006-05-04</date>
<grouping id=""></grouping>
<payment_type>Check</payment_type>
<check_number>1234</check_number>
<transaction_details>
<transaction_detail id="3273">
<coa id="2">Benevolence</coa>
<amount>10</amount>
<tax_deductible>true</tax_deductible>
<note></note>
<creator id="0">System User</creator>
<modifier id="0">System User</modifier>
<created>2016-03-04 01:25:04</created>
<modified>2016-03-04 01:25:04</modified>
</transaction_detail>
</transaction_details>
<creator id="0">System User</creator>
<modifier id="0">System User</modifier>
<created>2016-03-04 01:25:04</created>
<modified>2016-03-04 01:25:04</modified>
</transaction>
</transactions>
<creator id="0">System User</creator>
<modifier id="0">System User</modifier>
<created>2016-03-04 01:25:04</created>
<modified>2016-03-04 01:25:04</modified>
</batch>
</batches>
</response>
</ccb_api>