Skip to content

Commit

Permalink
Merge pull request #199 from XeroAPI/finance-spec
Browse files Browse the repository at this point in the history
adds finance api to sdk
  • Loading branch information
rjaus authored Nov 16, 2021
2 parents 29d5197 + 3462d84 commit 6548f5b
Show file tree
Hide file tree
Showing 145 changed files with 22,048 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/test/tmp/
/test/version_tmp/
/tmp/
.ruby-gemset
.ruby-version
.ruby-gemset

# Used by dotenv library to load environment variables.
.env
Expand Down
24 changes: 17 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
PATH
remote: .
specs:
xero-ruby (3.0.0)
xero-ruby (3.4.0)
faraday (~> 1.0, >= 1.0.1)
json (~> 2.1, >= 2.1.0)
json-jwt (~> 1.5, >= 1.5.2)

GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.3.1)
activesupport (6.1.4.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand All @@ -20,17 +20,27 @@ GEM
bindata (2.4.10)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.1.8)
concurrent-ruby (1.1.9)
diff-lcs (1.4.4)
faraday (1.4.1)
faraday (1.8.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.1.0)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.4)
Expand Down Expand Up @@ -76,7 +86,7 @@ GEM
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.6)
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.4)
ruby2_keywords (0.0.5)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
unicode-display_width (1.5.0)
Expand All @@ -93,4 +103,4 @@ DEPENDENCIES
xero-ruby!

BUNDLED WITH
2.1.4
2.2.26
8 changes: 8 additions & 0 deletions docs/accounting/Contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**contact_id** | **String** | Xero identifier | [optional]
**merged_to_contact_id** | **String** | ID for the destination of a merged contact. Only returned when using paging or when fetching a contact by ContactId or ContactNumber. | [optional]
**contact_number** | **String** | This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length &#x3D; 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. | [optional]
**account_number** | **String** | A user defined account number. This can be updated via the API and the Xero UI (max length &#x3D; 50) | [optional]
**contact_status** | **String** | Current status of a contact – see contact status types | [optional]
**name** | **String** | Full name of contact/organisation (max length &#x3D; 255) | [optional]
**first_name** | **String** | First name of contact person (max length &#x3D; 255) | [optional]
**last_name** | **String** | Last name of contact person (max length &#x3D; 255) | [optional]
**company_number** | **String** | Company registration number (max length &#x3D; 50) | [optional]
**email_address** | **String** | Email address of contact person (umlauts not supported) (max length &#x3D; 255) | [optional]
**skype_user_name** | **String** | Skype user name of contact | [optional]
**contact_persons** | [**Array&lt;ContactPerson&gt;**](ContactPerson.md) | See contact persons | [optional]
Expand All @@ -22,6 +24,8 @@ Name | Type | Description | Notes
**phones** | [**Array&lt;Phone&gt;**](Phone.md) | Store certain phone types for a contact – see phone types | [optional]
**is_supplier** | **Boolean** | true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact. | [optional]
**is_customer** | **Boolean** | true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact. | [optional]
**sales_default_line_amount_type** | **String** | The default sales line amount type for a contact. Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. | [optional]
**purchases_default_line_amount_type** | **String** | The default purchases line amount type for a contact Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber. | [optional]
**default_currency** | [**CurrencyCode**](CurrencyCode.md) | | [optional]
**xero_network_key** | **String** | Store XeroNetworkKey for contacts. | [optional]
**sales_default_account_code** | **String** | The default sales account code for contacts | [optional]
Expand Down Expand Up @@ -50,12 +54,14 @@ Name | Type | Description | Notes
require 'XeroRuby::Accounting'

instance = XeroRuby::Accounting::Contact.new(contact_id: null,
merged_to_contact_id: null,
contact_number: null,
account_number: null,
contact_status: null,
name: null,
first_name: null,
last_name: null,
company_number: null,
email_address: null,
skype_user_name: null,
contact_persons: null,
Expand All @@ -67,6 +73,8 @@ instance = XeroRuby::Accounting::Contact.new(contact_id: null,
phones: null,
is_supplier: null,
is_customer: null,
sales_default_line_amount_type: null,
purchases_default_line_amount_type: null,
default_currency: null,
xero_network_key: null,
sales_default_account_code: null,
Expand Down
21 changes: 21 additions & 0 deletions docs/accounting/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1984,6 +1984,11 @@
"description" : "Xero identifier",
"format" : "uuid"
},
"MergedToContactID" : {
"type" : "string",
"description" : "ID for the destination of a merged contact. Only returned when using paging or when fetching a contact by ContactId or ContactNumber.",
"format" : "uuid"
},
"ContactNumber" : {
"maxLength" : 50,
"type" : "string",
Expand Down Expand Up @@ -2014,6 +2019,11 @@
"type" : "string",
"description" : "Last name of contact person (max length = 255)"
},
"CompanyNumber" : {
"maxLength" : 50,
"type" : "string",
"description" : "Company registration number (max length = 50)"
},
"EmailAddress" : {
"maxLength" : 255,
"type" : "string",
Expand Down Expand Up @@ -2069,6 +2079,16 @@
"type" : "boolean",
"description" : "true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact."
},
"SalesDefaultLineAmountType" : {
"type" : "string",
"description" : "The default sales line amount type for a contact. Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber.",
"enum" : [ "INCLUSIVE", "EXCLUSIVE", "NONE" ]
},
"PurchasesDefaultLineAmountType" : {
"type" : "string",
"description" : "The default purchases line amount type for a contact Only available when summaryOnly parameter or paging is used, or when fetch by ContactId or ContactNumber.",
"enum" : [ "INCLUSIVE", "EXCLUSIVE", "NONE" ]
},
"DefaultCurrency" : {
"$ref" : "#/components/schemas/CurrencyCode"
},
Expand Down Expand Up @@ -5922,6 +5942,7 @@
<option data-url="https://xeroapi.github.io/xero-ruby/payroll_uk/index.html" value="PayrollUk">Payroll (UK)</option>
<option data-url="https://xeroapi.github.io/xero-ruby/payroll_nz/index.html" value="PayrollNz">Payroll (NZ)</option>
<option data-url="https://xeroapi.github.io/xero-ruby/app_store/index.html" value="AppStore">App Store</option>
<option data-url="https://xeroapi.github.io/xero-ruby/finance/index.html" value="Finance">Finance</option>
</select>
</fieldset>
<div class='api-set-wrapper'>
Expand Down
1 change: 1 addition & 0 deletions docs/app_store/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@
<option data-url="https://xeroapi.github.io/xero-ruby/payroll_uk/index.html" value="PayrollUk">Payroll (UK)</option>
<option data-url="https://xeroapi.github.io/xero-ruby/payroll_nz/index.html" value="PayrollNz">Payroll (NZ)</option>
<option data-url="https://xeroapi.github.io/xero-ruby/app_store/index.html" value="AppStore">App Store</option>
<option data-url="https://xeroapi.github.io/xero-ruby/finance/index.html" value="Finance">Finance</option>
</select>
</fieldset>
<div class='api-set-wrapper'>
Expand Down
1 change: 1 addition & 0 deletions docs/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,7 @@
<option data-url="https://xeroapi.github.io/xero-ruby/payroll_uk/index.html" value="PayrollUk">Payroll (UK)</option>
<option data-url="https://xeroapi.github.io/xero-ruby/payroll_nz/index.html" value="PayrollNz">Payroll (NZ)</option>
<option data-url="https://xeroapi.github.io/xero-ruby/app_store/index.html" value="AppStore">App Store</option>
<option data-url="https://xeroapi.github.io/xero-ruby/finance/index.html" value="Finance">Finance</option>
</select>
</fieldset>
<div class='api-set-wrapper'>
Expand Down
1 change: 1 addition & 0 deletions docs/files/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,7 @@
<option data-url="https://xeroapi.github.io/xero-ruby/payroll_uk/index.html" value="PayrollUk">Payroll (UK)</option>
<option data-url="https://xeroapi.github.io/xero-ruby/payroll_nz/index.html" value="PayrollNz">Payroll (NZ)</option>
<option data-url="https://xeroapi.github.io/xero-ruby/app_store/index.html" value="AppStore">App Store</option>
<option data-url="https://xeroapi.github.io/xero-ruby/finance/index.html" value="Finance">Finance</option>
</select>
</fieldset>
<div class='api-set-wrapper'>
Expand Down
41 changes: 41 additions & 0 deletions docs/finance/AccountUsage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# XeroRuby::Finance::AccountUsage

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**month** | **String** | The month this usage item contains data for | [optional]
**account_id** | **String** | The account this usage item contains data for | [optional]
**currency_code** | **String** | The currency code this usage item contains data for | [optional]
**total_received** | **BigDecimal** | Total received | [optional]
**count_received** | **Integer** | Count of received | [optional]
**total_paid** | **BigDecimal** | Total paid | [optional]
**count_paid** | **Integer** | Count of paid | [optional]
**total_manual_journal** | **BigDecimal** | Total value of manual journals | [optional]
**count_manual_journal** | **Integer** | Count of manual journals | [optional]
**account_name** | **String** | The name of the account | [optional]
**reporting_code** | **String** | Shown if set | [optional]
**reporting_code_name** | **String** | Shown if set | [optional]
**report_code_updated_date_utc** | **DateTime** | Last modified date UTC format | [optional]

## Code Sample

```ruby
require 'XeroRuby::Finance'

instance = XeroRuby::Finance::AccountUsage.new(month: null,
account_id: null,
currency_code: null,
total_received: null,
count_received: null,
total_paid: null,
count_paid: null,
total_manual_journal: null,
count_manual_journal: null,
account_name: null,
reporting_code: null,
reporting_code_name: null,
report_code_updated_date_utc: null)
```


23 changes: 23 additions & 0 deletions docs/finance/AccountUsageResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# XeroRuby::Finance::AccountUsageResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**organisation_id** | **String** | The requested Organisation to which the data pertains | [optional]
**start_month** | **String** | The start month of the report | [optional]
**end_month** | **String** | The end month of the report | [optional]
**account_usage** | [**Array&lt;AccountUsage&gt;**](AccountUsage.md) | | [optional]

## Code Sample

```ruby
require 'XeroRuby::Finance'

instance = XeroRuby::Finance::AccountUsageResponse.new(organisation_id: null,
start_month: null,
end_month: null,
account_usage: null)
```


25 changes: 25 additions & 0 deletions docs/finance/BalanceSheetAccountDetail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# XeroRuby::Finance::BalanceSheetAccountDetail

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **String** | Accounting code | [optional]
**account_id** | **String** | ID of the account | [optional]
**name** | **String** | Account name | [optional]
**reporting_code** | **String** | Reporting code | [optional]
**total** | **BigDecimal** | Total movement on this account | [optional]

## Code Sample

```ruby
require 'XeroRuby::Finance'

instance = XeroRuby::Finance::BalanceSheetAccountDetail.new(code: null,
account_id: null,
name: null,
reporting_code: null,
total: null)
```


19 changes: 19 additions & 0 deletions docs/finance/BalanceSheetAccountGroup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# XeroRuby::Finance::BalanceSheetAccountGroup

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**account_types** | [**Array&lt;BalanceSheetAccountType&gt;**](BalanceSheetAccountType.md) | | [optional]
**total** | **BigDecimal** | Total value of all the accounts in this type | [optional]

## Code Sample

```ruby
require 'XeroRuby::Finance'

instance = XeroRuby::Finance::BalanceSheetAccountGroup.new(account_types: null,
total: null)
```


21 changes: 21 additions & 0 deletions docs/finance/BalanceSheetAccountType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# XeroRuby::Finance::BalanceSheetAccountType

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**account_type** | **String** | The type of the account. See &lt;a href&#x3D;&#39;https://developer.xero.com/documentation/api/types#AccountTypes&#39;&gt;Account Types&lt;/a&gt; | [optional]
**accounts** | [**Array&lt;BalanceSheetAccountDetail&gt;**](BalanceSheetAccountDetail.md) | A list of all accounts of this type. Refer to the Account section below for each account element detail. | [optional]
**total** | **BigDecimal** | Total value of all the accounts in this type | [optional]

## Code Sample

```ruby
require 'XeroRuby::Finance'

instance = XeroRuby::Finance::BalanceSheetAccountType.new(account_type: null,
accounts: null,
total: null)
```


23 changes: 23 additions & 0 deletions docs/finance/BalanceSheetResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# XeroRuby::Finance::BalanceSheetResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**balance_date** | **Date** | Balance date of the report | [optional]
**asset** | [**BalanceSheetAccountGroup**](BalanceSheetAccountGroup.md) | | [optional]
**liability** | [**BalanceSheetAccountGroup**](BalanceSheetAccountGroup.md) | | [optional]
**equity** | [**BalanceSheetAccountGroup**](BalanceSheetAccountGroup.md) | | [optional]

## Code Sample

```ruby
require 'XeroRuby::Finance'

instance = XeroRuby::Finance::BalanceSheetResponse.new(balance_date: null,
asset: null,
liability: null,
equity: null)
```


19 changes: 19 additions & 0 deletions docs/finance/BankStatementResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# XeroRuby::Finance::BankStatementResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**statement_lines** | [**StatementLinesResponse**](StatementLinesResponse.md) | | [optional]
**current_statement** | [**CurrentStatementResponse**](CurrentStatementResponse.md) | | [optional]

## Code Sample

```ruby
require 'XeroRuby::Finance'

instance = XeroRuby::Finance::BankStatementResponse.new(statement_lines: null,
current_statement: null)
```


25 changes: 25 additions & 0 deletions docs/finance/CashAccountResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# XeroRuby::Finance::CashAccountResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**unreconciled_amount_pos** | **BigDecimal** | Total value of transactions in the journals which are not reconciled to bank statement lines, and have a positive (debit) value. | [optional]
**unreconciled_amount_neg** | **BigDecimal** | Total value of transactions in the journals which are not reconciled to bank statement lines, and have a negative (credit) value. | [optional]
**starting_balance** | **BigDecimal** | Starting (or historic) balance from the journals (manually keyed in by users on account creation - unverified). | [optional]
**account_balance** | **BigDecimal** | Current cash at bank accounting value from the journals. | [optional]
**balance_currency** | **String** | Currency which the cashAccount transactions relate to. | [optional]

## Code Sample

```ruby
require 'XeroRuby::Finance'

instance = XeroRuby::Finance::CashAccountResponse.new(unreconciled_amount_pos: null,
unreconciled_amount_neg: null,
starting_balance: null,
account_balance: null,
balance_currency: null)
```


Loading

0 comments on commit 6548f5b

Please sign in to comment.