|
LibOFX
|
An abstraction of a transaction in an account. More...
#include <libofx.h>
Data Fields | |
OFX mandatory elements | |
The OFX spec defines the following elements as mandatory. The associated variables should all contain valid data but you should not trust the servers. Check if the associated *_valid is true before using them. | |
| char | account_id [OFX_ACCOUNT_ID_LENGTH] |
| struct OfxAccountData * | account_ptr |
| int | account_id_valid |
| TransactionType | transactiontype |
| int | transactiontype_valid |
| InvTransactionType | invtransactiontype |
| int | invtransactiontype_valid |
| double | units |
| int | units_valid |
| double | unitprice |
| int | unitprice_valid |
| double | amount |
| int | amount_valid |
| char | fi_id [OFX_FITID_LENGTH] |
| int | fi_id_valid |
OFX optional elements | |
The OFX spec defines the following elements as optional. If the associated *_valid is true, the corresponding element is present and the associated variable contains valid data. | |
| char | unique_id [OFX_UNIQUE_ID_LENGTH] |
| int | unique_id_valid |
| char | unique_id_type [OFX_UNIQUE_ID_TYPE_LENGTH] |
| int | unique_id_type_valid |
| struct OfxSecurityData * | security_data_ptr |
| int | security_data_valid |
| time_t | date_posted |
| int | date_posted_valid |
| time_t | date_initiated |
| int | date_initiated_valid |
| time_t | date_funds_available |
| int | date_funds_available_valid |
| char | fi_id_corrected [OFX_FITID_LENGTH] |
| int | fi_id_corrected_valid |
| FiIdCorrectionAction | fi_id_correction_action |
| int | fi_id_correction_action_valid |
| char | server_transaction_id [OFX_SVRTID2_LENGTH] |
| int | server_transaction_id_valid |
| char | check_number [OFX_CHECK_NUMBER_LENGTH] |
| int | check_number_valid |
| char | reference_number [OFX_REFERENCE_NUMBER_LENGTH] |
| int | reference_number_valid |
| long int | standard_industrial_code |
| int | standard_industrial_code_valid |
| char | payee_id [OFX_SVRTID2_LENGTH] |
| int | payee_id_valid |
| char | name [OFX_TRANSACTION_NAME_LENGTH] |
| int | name_valid |
| char | memo [OFX_MEMO2_LENGTH] |
| int | memo_valid |
| double | commission |
| int | commission_valid |
| double | fees |
| int | fees_valid |
| double | oldunits |
| int | oldunits_valid |
| double | newunits |
| int | newunits_valid |
| double | market_value |
| int | market_value_valid |
| char | currency [OFX_CURRENCY_LENGTH] |
| int | currency_valid |
| double | currency_ratio |
| int | currency_ratio_valid |
| int | amounts_are_foreign_currency |
| int | amounts_are_foreign_currency_valid |
Other OFX elements for investment transactions | |
OFX spec 2.1.1 section 13.9.2.4.2 elements that are not already defined. | |
| enum | BuyType { OFX_BUY_TYPE_BUY , OFX_BUY_TYPE_BUYTOCOVER , OFX_BUY_TYPE_BUYTOOPEN , OFX_BUY_TYPE_BUYTOCLOSE } |
| enum | IncomeType { OFX_CGLONG , OFX_CGSHORT , OFX_DIVIDEND , OFX_INTEREST , OFX_MISC } |
| enum | Inv401kSource { OFX_401K_SOURCE_PRETAX , OFX_401K_SOURCE_AFTERTAX , OFX_401K_SOURCE_MATCH , OFX_401K_SOURCE_PROFITSHARING , OFX_401K_SOURCE_ROLLOVER , OFX_401K_SOURCE_OTHERVEST , OFX_401K_SOURCE_OTHERNONVEST } |
| enum | OptAction { OFX_OPTACTION_EXERCISE , OFX_OPTACTION_ASSIGN , OFX_OPTACTION_EXPIRE } |
| enum | PosType { OFX_POSTYPE_LONG , OFX_POSTYPE_SHORT } |
| enum | RelatedType { OFX_RELTYPE_SPREAD , OFX_RELTYPE_STRADDLE , OFX_RELTYPE_NONE , OFX_RELTYPE_OTHER } |
| enum | OptionSecured { OFX_SECURED_NAKED , OFX_SECURED_COVERED } |
| enum | SellReason { OFX_SELLREASON_CALL , OFX_SELLREASON_SELL , OFX_SELLREASON_MATURITY } |
| enum | SellType { OFX_SELL_TYPE_SELL , OFX_SELL_TYPE_SELLSHORT , OFX_SELL_TYPE_SELLTOOPEN , OFX_SELL_TYPE_SELLTOCLOSE } |
| enum | SubAcctType { OFX_SUBACCT_CASH , OFX_SUBACCT_MARGIN , OFX_SUBACCT_SHORT , OFX_SUBACCT_OTHER } |
| enum | TransferAction { OFX_TFERACTION_IN , OFX_TFERACTION_OUT } |
| enum | UnitType { OFX_UNITTYPE_SHARES , OFX_UNITTYPE_CURRENCY } |
| double | accrued_interest |
| int | accrued_interest_valid |
| double | avg_cost_basis |
| int | avg_cost_basis_valid |
| enum OfxTransactionData::BuyType | buy_type |
| int | buy_type_valid |
| double | denominator |
| int | denominator_valid |
| time_t | date_payroll |
| int | date_payroll_valid |
| time_t | date_purchase |
| int | date_purchase_valid |
| double | gain |
| int | gain_valid |
| double | cash_for_fractional |
| int | cash_for_fractional_valid |
| enum OfxTransactionData::IncomeType | income_type |
| int | income_type_valid |
| enum OfxTransactionData::Inv401kSource | inv_401k_source |
| int | inv_401k_source_valid |
| double | load |
| int | load_valid |
| char | loan_id [OFX_LOANID_LENGTH] |
| int | loan_id_valid |
| double | loan_interest |
| int | loan_interest_valid |
| double | loan_principal |
| int | loan_principal_valid |
| double | markdown |
| int | markdown_valid |
| double | markup |
| int | markup_valid |
| double | numerator |
| int | numerator_valid |
| enum OfxTransactionData::OptAction | opt_action |
| int | opt_action_valid |
| double | penalty |
| int | penalty_valid |
| enum OfxTransactionData::PosType | pos_type |
| int | pos_type_valid |
| int | prior_year_contrib |
| int | prior_year_contrib_valid |
| char | related_fi_tid [OFX_FITID_LENGTH] |
| int | related_fi_tid_valid |
| enum OfxTransactionData::RelatedType | related_type |
| int | related_type_valid |
| enum OfxTransactionData::OptionSecured | option_secured |
| int | option_secured_valid |
| enum OfxTransactionData::SellReason | sell_reason |
| int | sell_reason_valid |
| enum OfxTransactionData::SellType | sell_type |
| int | sell_type_valid |
| double | shares_per_cont |
| int | shares_per_cont_valid |
| double | state_withholding |
| int | state_withholding_valid |
| enum OfxTransactionData::SubAcctType | subacct_from |
| enum OfxTransactionData::SubAcctType | subacct_funding |
| enum OfxTransactionData::SubAcctType | subacct_security |
| enum OfxTransactionData::SubAcctType | subacct_to |
| int | subacct_from_valid |
| int | subacct_funding_valid |
| int | subacct_security_valid |
| int | subacct_to_valid |
| double | taxes |
| int | taxes_valid |
| int | tax_exempt |
| int | tax_exempt_valid |
| enum OfxTransactionData::TransferAction | transfer_action |
| int | transfer_action_valid |
| enum OfxTransactionData::UnitType | unit_type |
| int | unit_type_valid |
| double | withholding |
| int | withholding_valid |
An abstraction of a transaction in an account.
The OfxTransactionData structure contains all available information about an actual transaction in an account.
| char OfxTransactionData::account_id[OFX_ACCOUNT_ID_LENGTH] |
| struct OfxAccountData* OfxTransactionData::account_ptr |
Pointer to the full account structure, see OfxAccountData
| double OfxTransactionData::accrued_interest |
| double OfxTransactionData::amount |
| int OfxTransactionData::amounts_are_foreign_currency |
| double OfxTransactionData::avg_cost_basis |
| double OfxTransactionData::cash_for_fractional |
| char OfxTransactionData::check_number[OFX_CHECK_NUMBER_LENGTH] |
| double OfxTransactionData::commission |
| char OfxTransactionData::currency[OFX_CURRENCY_LENGTH] |
| double OfxTransactionData::currency_ratio |
| time_t OfxTransactionData::date_funds_available |
| time_t OfxTransactionData::date_initiated |
| time_t OfxTransactionData::date_payroll |
| time_t OfxTransactionData::date_posted |
| time_t OfxTransactionData::date_purchase |
| double OfxTransactionData::denominator |
| double OfxTransactionData::fees |
| char OfxTransactionData::fi_id[OFX_FITID_LENGTH] |
| char OfxTransactionData::fi_id_corrected[OFX_FITID_LENGTH] |
IMPORTANT: if fi_id_corrected is present, this transaction is meant to replace or delete the transaction with this fi_id. See OfxTransactionData::fi_id_correction_action to know what to do.
| FiIdCorrectionAction OfxTransactionData::fi_id_correction_action |
| InvTransactionType OfxTransactionData::invtransactiontype |
| double OfxTransactionData::load |
| char OfxTransactionData::loan_id[OFX_LOANID_LENGTH] |
| double OfxTransactionData::loan_interest |
| double OfxTransactionData::loan_principal |
| double OfxTransactionData::markdown |
| double OfxTransactionData::market_value |
| double OfxTransactionData::markup |
| char OfxTransactionData::memo[OFX_MEMO2_LENGTH] |
| char OfxTransactionData::name[OFX_TRANSACTION_NAME_LENGTH] |
| double OfxTransactionData::newunits |
| double OfxTransactionData::numerator |
| double OfxTransactionData::oldunits |
| char OfxTransactionData::payee_id[OFX_SVRTID2_LENGTH] |
| double OfxTransactionData::penalty |
| int OfxTransactionData::prior_year_contrib |
| char OfxTransactionData::reference_number[OFX_REFERENCE_NUMBER_LENGTH] |
| char OfxTransactionData::related_fi_tid[OFX_FITID_LENGTH] |
| struct OfxSecurityData* OfxTransactionData::security_data_ptr |
| int OfxTransactionData::security_data_valid |
| char OfxTransactionData::server_transaction_id[OFX_SVRTID2_LENGTH] |
| double OfxTransactionData::shares_per_cont |
| long int OfxTransactionData::standard_industrial_code |
| double OfxTransactionData::state_withholding |
| int OfxTransactionData::subacct_from_valid |
| int OfxTransactionData::subacct_funding_valid |
| int OfxTransactionData::subacct_security_valid |
| int OfxTransactionData::subacct_to_valid |
| TransactionType OfxTransactionData::transactiontype |
| int OfxTransactionData::transactiontype_valid |
| char OfxTransactionData::unique_id[OFX_UNIQUE_ID_LENGTH] |
| char OfxTransactionData::unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH] |
| double OfxTransactionData::unitprice |
| double OfxTransactionData::units |
Variation of the number of units of the commodity
Suppose units is -10, ave unitprice is 1. If the commodity is stock, you have 10 less stock, but 10 more dollars in you amccount (fees not considered, see amount). If commodity is money, you have 10 less dollars in your pocket, but 10 more in your account
| double OfxTransactionData::withholding |