URL | https://api_url/v1/draft_transaction |
Supported Methods | GET POST PUT DELETE |
Description | Retrieves, creates, updates or deletes draft transactions |
GET /draft_transaction[.format] | retrieve all draft_transactions in specified format |
GET /draft_transaction/1[.format] | retrieve draft_transaction with ID = 1 in specified format |
POST /draft_transaction | Create a new draft_transaction |
PUT /draft_transaction/n[.format] | Update a draft_transaction ID=n, respond with updated record in specified format |
DELETE /draft_transaction/n | Delete draft_transaction ID=n |
Elements
id | Unique ID assigned to draft_transaction record |
transaction_date | The effective date of the transaction |
description | The description of the transaction (i.e. Payment of heating bill.") |
Examples
Create a new draft transaction:
$ curl -k -i -X POST -H "Content-Type: application/xml" --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" \ -d @new_draft_transaction.xml https://api_url/v1/draft_transaction.xml
With posted file new_draft_transaction.xml containing:
<?xml version="1.0" encoding="UTF-8"?> <draft_transaction> <transaction_date>2011-04-15 13:35:54 UTC</transaction_date> <description>Payment for heating bill.</description> </draft_transaction>
Returns the following:
<?xml version="1.0" encoding="UTF-8"?> <draft_transactions> <draft_transaction> <id>4</id> <transaction_date>2011-04-15 13:35:54 UTC</transaction_date> <description>Payment for heating bill.</description> </draft_transaction> </draft_transactions>
Update a draft transaction:
$ curl -i -X PUT -H "Content-Type: application/xml" --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" \ -d @update_draft_transaction.xml https://api_url/v1/draft_transaction/4.xml
With posted file update_draft_transaction.xml containing:
<?xml version="1.0" encoding="UTF-8"?> <draft_transaction> <transaction_date>2011-04-20 13:35:54 UTC</transaction_date> <description>Updated Experimental Transaction</description> </draft_transaction>
Returns the following:
<?xml version="1.0" encoding="UTF-8"?> <draft_transactions> <draft_transaction> <id>4</id> <transaction_date>2011-04-20 13:35:54 UTC</transaction_date> <description>Updated Experimental Transaction</description> </draft_transaction> </draft_transactions>
Retrieve Draft Transactions
$ curl -i --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" https://api_url/v1/draft_transaction
Returns the following:
<?xml version="1.0" encoding="UTF-8"?> <draft_transactions> <draft_transaction> <id>2</id> <transaction_date>2011-04-15 13:35:54 UTC</transaction_date> <description>Experimental Transaction</description> </draft_transaction> <draft_transaction> <id>3</id> <transaction_date>2011-04-15 13:35:54 UTC</transaction_date> <description>Experimental Transaction</description> </draft_transaction> <draft_transaction> <id>4</id> <transaction_date>2011-04-20 13:35:54 UTC</transaction_date> <description>Updated Experimental Transaction</description> </draft_transaction> </draft_transactions>
Another example:
$ curl -i --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" https://api_url/v1/draft_transaction/2
Returns the following:
<?xml version="1.0" encoding="UTF-8"?> <draft_transaction> <id>2</id> <description>Experimental Transaction</description> <transaction_date>2011-04-15 13:35:54 UTC</transaction_date> <draft_transaction_detail> <id>2</id> <organization_gl_account_id>37162</organization_gl_account_id> <debit_credit_flag>false</debit_credit_flag> <amount>100.0</amount> <currency_id>1</currency_id> <multiplier>1.0</multiplier> </draft_transaction_detail> </draft_transaction>
Deleting a Draft Transaction
$ curl -X DELETE -i --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" https://api_url/v1/draft_transaction/4
Comments and Suggestions
0 comments
Please sign in to leave a comment.
Related articles