URL | https://api_url/v1/draft_transaction/n/draft_transaction_detail |
Supported Methods | GET POST PUT DELETE |
Description | Retrieves, creates, updates or deletes a set of, or a designated, draft transaction detail |
Create a New Draft Transaction Detail for a Draft Transaction
$ curl -i -X POST -H "Content-Type: application/xml" --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" \ -d @new_draft_transaction_detail_line_2.xml https://api_url/v1/draft_transaction/3/draft_transaction_detail.xml
Where the posted file new_draft_transction_detail_line_2.xml contains:
<?xml version="1.0" encoding="UTF-8"?> <draft_transaction_detail> <organization_gl_account_id type='integer'>37037</organization_gl_account_id> <debit_credit_flag type='boolean'>true</debit_credit_flag> <amount type='decimal'>100.00</amount> <multiplier type='decimal'>1</multiplier> <currency_id type='integer'>1</currency_id> </draft_transaction_detail>
Returns the following:
<?xml version="1.0" encoding="UTF-8"?> <draft_transaction> <id>3</id> <transaction_date>2011-04-15 13:35:54 UTC</transaction_date> <description>Experimental Transaction</description> <draft_transaction_details> <draft_transaction_detail> <id>3</id> <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> <description></description> </draft_transaction_detail> <draft_transaction_detail> <id>4</id> <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> <description></description> </draft_transaction_detail> </draft_transaction_details> </draft_transaction>
Retrieve all Draft Transaction Details for a Draft Transaction
$ curl -i --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" https://api_url/v1/draft_transaction/2/draft_transaction_detail
Returns the following:
<?xml version="1.0" encoding="UTF-8"?> <draft_transaction_details> <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> <description></description> </draft_transaction_detail> </draft_transaction_details>
Create Multiple Draft Transaction Details for a Draft Transaction
$ curl -i -X POST -H "Content-Type: application/xml" --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" \ -d @new_draft_multiline_transaction_details.xml https://api_url/v1/draft_transaction/3/draft_transaction_detail.xml
Note that the posted XML file has two extra levels of indentation:
- TAG: draft_transaction_details
- TAG: lineIdentifier
- This tag can have any valid XML name. It is purely arbitrary, but it must be unique within the scope of the file.
<?xml version="1.0" encoding="UTF-8"?> <draft_transaction_details> <line_1> <draft_transaction_detail> <organization_gl_account_id type='integer'>1430</organization_gl_account_id> <debit_credit_flag type='boolean'>false</debit_credit_flag> <amount type='decimal'>100.00</amount> <multiplier type='decimal'>1</multiplier> <currency_id type='integer'>1</currency_id> </draft_transaction_detail> </line_1> <line_2> <draft_transaction_detail> <organization_gl_account_id type='integer'>1430</organization_gl_account_id> <debit_credit_flag type='boolean'>true</debit_credit_flag> <amount type='decimal'>100.00</amount> <multiplier type='decimal'>1</multiplier> <currency_id type='integer'>1</currency_id> </draft_transaction_detail> </line_2> <line_3> <draft_transaction_detail> <organization_gl_account_id type='integer'>1430</organization_gl_account_id> <debit_credit_flag type='boolean'>false</debit_credit_flag> <amount type='decimal'>120.00</amount> <multiplier type='decimal'>1</multiplier> <currency_id type='integer'>1</currency_id> </draft_transaction_detail> </line_3> <line_4> <draft_transaction_detail> <organization_gl_account_id type='integer'>1430</organization_gl_account_id> <debit_credit_flag type='boolean'>true</debit_credit_flag> <amount type='decimal'>120.00</amount> <multiplier type='decimal'>1</multiplier> <currency_id type='integer'>1</currency_id> </draft_transaction_detail> </line_4> <line_5> <draft_transaction_detail> <organization_gl_account_id type='integer'>1430</organization_gl_account_id> <debit_credit_flag type='boolean'>false</debit_credit_flag> <amount type='decimal'>150.00</amount> <multiplier type='decimal'>1</multiplier> <currency_id type='integer'>1</currency_id> </draft_transaction_detail> </line_5> <line_6> <draft_transaction_detail> <organization_gl_account_id type='integer'>1430</organization_gl_account_id> <debit_credit_flag type='boolean'>true</debit_credit_flag> <amount type='decimal'>150.00</amount> <multiplier type='decimal'>1</multiplier> <currency_id type='integer'>1</currency_id> </draft_transaction_detail> </line_6> <line_7> <draft_transaction_detail> <organization_gl_account_id type='integer'>1430</organization_gl_account_id> <debit_credit_flag type='boolean'>false</debit_credit_flag> <amount type='decimal'>170.00</amount> <multiplier type='decimal'>1</multiplier> <currency_id type='integer'>1</currency_id> </draft_transaction_detail> </line_7> <line_8> <draft_transaction_detail> <organization_gl_account_id type='integer'>1430</organization_gl_account_id> <debit_credit_flag type='boolean'>true</debit_credit_flag> <amount type='decimal'>170.00</amount> <multiplier type='decimal'>1</multiplier> <currency_id type='integer'>1</currency_id> </draft_transaction_detail> </line_8> <line_9> <draft_transaction_detail> <organization_gl_account_id type='integer'>1430</organization_gl_account_id> <debit_credit_flag type='boolean'>false</debit_credit_flag> <amount type='decimal'>400.00</amount> <multiplier type='decimal'>1</multiplier> <currency_id type='integer'>1</currency_id> </draft_transaction_detail> </line_9> <line_10> <draft_transaction_detail> <organization_gl_account_id type='integer'>1430</organization_gl_account_id> <debit_credit_flag type='boolean'>true</debit_credit_flag> <amount type='decimal'>400.00</amount> <multiplier type='decimal'>1</multiplier> <currency_id type='integer'>1</currency_id> </draft_transaction_detail> </line_10> </draft_transaction_details>
Comments and Suggestions
0 comments
Please sign in to leave a comment.
Related articles