URL |
https://api_host/v1/transaction Note: Your API host name might be different depending on your account. |
Supported Methods | GET POST |
Description | Retrieve Posted Transactions or create GL entries from Draft Transactions (Posted transactions are permanent and cannot be changed or deleted.) |
Note: Only balanced Draft Transactions may be posted. Attempts to post unbalanced Draft Transactions will fail.
Accepted Query Formats
GET /transaction[.format] |
retrieve all transactions for a firm. Allowed filter parameters: since_date: Include transaction that are after or on the since date. More than one filers can be used together. |
GET /transaction/1[.format] | retrieve transaction with ID = 1 |
POST /transaction | Create a new transaction |
Elements
id | Unique ID assigned to transaction record |
transaction_date | effective date of transaction |
description | description of transaction purpose |
Examples
Retrieve all transactions in XML format:
$ curl -i --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" https://api_host/v1/transaction
<?xml version="1.0" encoding="UTF-8"?> <transactions> <transaction> <id>1</id> <transaction_date>2008-12-30 00:00:00 UTC</transaction_date> <description>Post Bill</description> <transaction_details> <transaction_detail> <organization_gl_account_id>594</organization_gl_account_id> <debit_credit_flag>false</debit_credit_flag> <amount>25.64</amount> <multiplier>1.0</multiplier> <currency_id>1</currency_id> </transaction_detail> <transaction_detail> <organization_gl_account_id>599</organization_gl_account_id> <debit_credit_flag>true</debit_credit_flag> <amount>25.64</amount> <multiplier>1.0</multiplier> <currency_id>1</currency_id> </transaction_detail> . . . <transaction_detail> <organization_gl_account_id>599</organization_gl_account_id> <debit_credit_flag>true</debit_credit_flag> <amount>1402.47</amount> <multiplier>1.0</multiplier> <currency_id>1</currency_id> </transaction_detail> </transaction_details> </transaction> . . . <id>768</id> <transaction_date>2011-12-06 00:00:00 UTC</transaction_date> <description>Post Invoice</description> <transaction_details> <transaction_detail> <organization_gl_account_id>34258</organization_gl_account_id> <debit_credit_flag>false</debit_credit_flag> <amount>337.5</amount> <multiplier>1.0</multiplier> <currency_id>1</currency_id> </transaction_detail> <transaction_detail> <organization_gl_account_id>8325</organization_gl_account_id> <debit_credit_flag>true</debit_credit_flag> <amount>337.5</amount> <multiplier>1.0</multiplier> <currency_id>1</currency_id> </transaction_detail> . . . <transaction_detail> <organization_gl_account_id>34258</organization_gl_account_id> <debit_credit_flag>false</debit_credit_flag> <amount>78.0</amount> <multiplier>1.0</multiplier> <currency_id>1</currency_id> </transaction_detail> <transaction_detail> <organization_gl_account_id>8116</organization_gl_account_id> <debit_credit_flag>true</debit_credit_flag> <amount>78.0</amount> <multiplier>1.0</multiplier> <currency_id>1</currency_id> </transaction_detail> </transaction_details> </transaction> </transactions>
Retrieve transactions in XML format with filters.
Accepted filters are start_date, end_date, and since_id. since_id is used to find transactions with an id that is larger than the passed in id. start_date and end_date are to find transactions with date in a certain date range.
$ curl -i --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" https://api_host/v1/transaction?since_id=123&start_date=2010-01-01&end_date=2030-0101
Create a New Transaction from a Draft Transaction
$ curl -i -X POST -H "Content-Type: application/xml" --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" \ -d @post_transaction_from_draft.xml https://api_host/v1/transaction.xml
Where the file post_transaction_from_draft.xml contains:
<?xml version="1.0" encoding="UTF-8"?> <draft_transaction> <id>3</id> </draft_transaction>
Returns:
<?xml version="1.0" encoding="UTF-8"?> <transaction> <id>770</id> <transaction_date>2011-04-15 13:35:54 UTC</transaction_date> <description>Experimental Transaction</description> <transaction_details> <transaction_detail> <organization_gl_account_id>37162</organization_gl_account_id> <debit_credit_flag>false</debit_credit_flag> <amount>100.0</amount> <multiplier>1.0</multiplier> <currency_id>1</currency_id> </transaction_detail> <transaction_detail> <organization_gl_account_id>37037</organization_gl_account_id> <debit_credit_flag>true</debit_credit_flag> <amount>100.0</amount> <multiplier>1.0</multiplier> <currency_id>1</currency_id> </transaction_detail> </transaction_details> </transaction>
Reverse a transaction:
use HTTP post to reverse a transaction
curl -i -X POST --header "VERSACCOUNTS_AUTHORIZATION:xxx" https://api_host/v1/transaction/123/reverse
Reverse a transaction with a custom reversal date. Default is to use the same date as the original transaction.
curl -i -X POST --header "VERSACCOUNTS_AUTHORIZATION:xxx" https://api_host/v1/transaction/123/reverse?effective_date=2021-01-01
Comments and Suggestions
0 comments
Please sign in to leave a comment.
Related articles