Skip to content

Latest commit

 

History

History
343 lines (244 loc) · 12.4 KB

AccountsApi.md

File metadata and controls

343 lines (244 loc) · 12.4 KB

MergeAccountingClient::AccountsApi

All URIs are relative to https://api.merge.dev/api/accounting/v1

Method HTTP request Description
accounts_create POST /accounts
accounts_list GET /accounts
accounts_meta_post_retrieve GET /accounts/meta/post
accounts_retrieve GET /accounts/{id}

accounts_create

accounts_create(x_account_token, account_endpoint_request, opts)

Creates an Account object with the given values.

Examples

require 'time'
require 'merge_accounting_client'
# setup authorization
MergeAccountingClient.configure do |config|
  # Configure API key authorization: tokenAuth
  config.api_key['tokenAuth'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['tokenAuth'] = 'Bearer'
end

api_instance = MergeAccountingClient::AccountsApi.new
x_account_token = 'x_account_token_example' # String | Token identifying the end user.
account_endpoint_request = MergeAccountingClient::AccountEndpointRequest.new({model: MergeAccountingClient::AccountRequest.new}) # AccountEndpointRequest | 
opts = {
  is_debug_mode: true, # Boolean | Whether to include debug fields (such as log file links) in the response.
  run_async: true # Boolean | Whether or not third-party updates should be run asynchronously.
}

begin
  
  result = api_instance.accounts_create(x_account_token, account_endpoint_request, opts)
  p result
rescue MergeAccountingClient::ApiError => e
  puts "Error when calling AccountsApi->accounts_create: #{e}"
end

Using the accounts_create_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> accounts_create_with_http_info(x_account_token, account_endpoint_request, opts)

begin
  
  data, status_code, headers = api_instance.accounts_create_with_http_info(x_account_token, account_endpoint_request, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <AccountResponse>
rescue MergeAccountingClient::ApiError => e
  puts "Error when calling AccountsApi->accounts_create_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_account_token String Token identifying the end user.
account_endpoint_request AccountEndpointRequest
is_debug_mode Boolean Whether to include debug fields (such as log file links) in the response. [optional]
run_async Boolean Whether or not third-party updates should be run asynchronously. [optional]

Return type

AccountResponse

Authorization

tokenAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

accounts_list

accounts_list(x_account_token, opts)

Returns a list of Account objects.

Examples

require 'time'
require 'merge_accounting_client'
# setup authorization
MergeAccountingClient.configure do |config|
  # Configure API key authorization: tokenAuth
  config.api_key['tokenAuth'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['tokenAuth'] = 'Bearer'
end

api_instance = MergeAccountingClient::AccountsApi.new
x_account_token = 'x_account_token_example' # String | Token identifying the end user.
opts = {
  company_id: 'company_id_example', # String | If provided, will only return accounts for this company.
  created_after: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return objects created after this datetime.
  created_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return objects created before this datetime.
  cursor: 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw', # String | The pagination cursor value.
  expand: 'company', # String | Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
  include_deleted_data: true, # Boolean | Whether to include data that was marked as deleted by third party webhooks.
  include_remote_data: true, # Boolean | Whether to include the original data Merge fetched from the third-party to produce these models.
  modified_after: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, only objects synced by Merge after this date time will be returned.
  modified_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, only objects synced by Merge before this date time will be returned.
  page_size: 56, # Integer | Number of results to return per page.
  remote_fields: 'classification', # String | Deprecated. Use show_enum_origins.
  remote_id: 'remote_id_example', # String | The API provider's ID for the given object.
  show_enum_origins: 'classification' # String | Which fields should be returned in non-normalized form.
}

begin
  
  result = api_instance.accounts_list(x_account_token, opts)
  p result
rescue MergeAccountingClient::ApiError => e
  puts "Error when calling AccountsApi->accounts_list: #{e}"
end

Using the accounts_list_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> accounts_list_with_http_info(x_account_token, opts)

begin
  
  data, status_code, headers = api_instance.accounts_list_with_http_info(x_account_token, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <PaginatedAccountList>
rescue MergeAccountingClient::ApiError => e
  puts "Error when calling AccountsApi->accounts_list_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_account_token String Token identifying the end user.
company_id String If provided, will only return accounts for this company. [optional]
created_after Time If provided, will only return objects created after this datetime. [optional]
created_before Time If provided, will only return objects created before this datetime. [optional]
cursor String The pagination cursor value. [optional]
expand String Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. [optional]
include_deleted_data Boolean Whether to include data that was marked as deleted by third party webhooks. [optional]
include_remote_data Boolean Whether to include the original data Merge fetched from the third-party to produce these models. [optional]
modified_after Time If provided, only objects synced by Merge after this date time will be returned. [optional]
modified_before Time If provided, only objects synced by Merge before this date time will be returned. [optional]
page_size Integer Number of results to return per page. [optional]
remote_fields String Deprecated. Use show_enum_origins. [optional]
remote_id String The API provider's ID for the given object. [optional]
show_enum_origins String Which fields should be returned in non-normalized form. [optional]

Return type

PaginatedAccountList

Authorization

tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

accounts_meta_post_retrieve

accounts_meta_post_retrieve(x_account_token)

Returns metadata for Account POSTs.

Examples

require 'time'
require 'merge_accounting_client'
# setup authorization
MergeAccountingClient.configure do |config|
  # Configure API key authorization: tokenAuth
  config.api_key['tokenAuth'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['tokenAuth'] = 'Bearer'
end

api_instance = MergeAccountingClient::AccountsApi.new
x_account_token = 'x_account_token_example' # String | Token identifying the end user.

begin
  
  result = api_instance.accounts_meta_post_retrieve(x_account_token)
  p result
rescue MergeAccountingClient::ApiError => e
  puts "Error when calling AccountsApi->accounts_meta_post_retrieve: #{e}"
end

Using the accounts_meta_post_retrieve_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> accounts_meta_post_retrieve_with_http_info(x_account_token)

begin
  
  data, status_code, headers = api_instance.accounts_meta_post_retrieve_with_http_info(x_account_token)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <MetaResponse>
rescue MergeAccountingClient::ApiError => e
  puts "Error when calling AccountsApi->accounts_meta_post_retrieve_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_account_token String Token identifying the end user.

Return type

MetaResponse

Authorization

tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

accounts_retrieve

accounts_retrieve(x_account_token, id, opts)

Returns an Account object with the given id.

Examples

require 'time'
require 'merge_accounting_client'
# setup authorization
MergeAccountingClient.configure do |config|
  # Configure API key authorization: tokenAuth
  config.api_key['tokenAuth'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['tokenAuth'] = 'Bearer'
end

api_instance = MergeAccountingClient::AccountsApi.new
x_account_token = 'x_account_token_example' # String | Token identifying the end user.
id = TODO # String | 
opts = {
  expand: 'company', # String | Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
  include_remote_data: true, # Boolean | Whether to include the original data Merge fetched from the third-party to produce these models.
  remote_fields: 'classification', # String | Deprecated. Use show_enum_origins.
  show_enum_origins: 'classification' # String | Which fields should be returned in non-normalized form.
}

begin
  
  result = api_instance.accounts_retrieve(x_account_token, id, opts)
  p result
rescue MergeAccountingClient::ApiError => e
  puts "Error when calling AccountsApi->accounts_retrieve: #{e}"
end

Using the accounts_retrieve_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> accounts_retrieve_with_http_info(x_account_token, id, opts)

begin
  
  data, status_code, headers = api_instance.accounts_retrieve_with_http_info(x_account_token, id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Account>
rescue MergeAccountingClient::ApiError => e
  puts "Error when calling AccountsApi->accounts_retrieve_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_account_token String Token identifying the end user.
id String
expand String Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. [optional]
include_remote_data Boolean Whether to include the original data Merge fetched from the third-party to produce these models. [optional]
remote_fields String Deprecated. Use show_enum_origins. [optional]
show_enum_origins String Which fields should be returned in non-normalized form. [optional]

Return type

Account

Authorization

tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json