nordlet 0.6.6 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nordlet/account/client.rb +89 -6
  3. data/lib/nordlet/account/types/brand_get_account_request.rb +9 -0
  4. data/lib/nordlet/account/types/brand_get_account_response.rb +17 -0
  5. data/lib/nordlet/account/types/brand_update_account_request.rb +17 -0
  6. data/lib/nordlet/account/types/brand_update_account_response.rb +17 -0
  7. data/lib/nordlet/account/types/companies_create_account_response.rb +10 -0
  8. data/lib/nordlet/account/types/companies_create_account_response_vat_period.rb +17 -0
  9. data/lib/nordlet/account/types/me_account_response_companies_item.rb +10 -0
  10. data/lib/nordlet/account/types/me_account_response_companies_item_vat_period.rb +17 -0
  11. data/lib/nordlet/account/types/me_account_response_user.rb +2 -0
  12. data/lib/nordlet/bank/client.rb +183 -14
  13. data/lib/nordlet/bank/types/reconciliation_get_bank_request.rb +15 -0
  14. data/lib/nordlet/bank/types/reconciliation_get_bank_response.rb +35 -0
  15. data/lib/nordlet/bank/types/reconciliation_get_bank_response_statement_balance_source.rb +14 -0
  16. data/lib/nordlet/bank/types/reconciliation_get_bank_response_unbooked_lines_item.rb +39 -0
  17. data/lib/nordlet/bank/types/reconciliation_get_bank_response_unbooked_lines_item_status.rb +15 -0
  18. data/lib/nordlet/bank/types/transactions_ignore_bank_request.rb +13 -0
  19. data/lib/nordlet/bank/types/transactions_ignore_bank_response.rb +39 -0
  20. data/lib/nordlet/bank/types/transactions_ignore_bank_response_status.rb +15 -0
  21. data/lib/nordlet/bank/types/transactions_import_bank_request.rb +4 -0
  22. data/lib/nordlet/bank/types/transactions_import_bank_response.rb +2 -0
  23. data/lib/nordlet/bank/types/transactions_import_bank_response_duplicates_item.rb +17 -0
  24. data/lib/nordlet/bank/types/transactions_list_bank_response_rows_item.rb +2 -0
  25. data/lib/nordlet/bank/types/transactions_list_bank_response_rows_item_status.rb +1 -0
  26. data/lib/nordlet/bank/types/transactions_match_bank_request.rb +2 -0
  27. data/lib/nordlet/bank/types/transactions_match_bank_request_remainder.rb +13 -0
  28. data/lib/nordlet/bank/types/transactions_match_bank_request_remainder_treatment.rb +15 -0
  29. data/lib/nordlet/bank/types/transactions_match_bank_response.rb +2 -0
  30. data/lib/nordlet/bank/types/transactions_match_bank_response_status.rb +1 -0
  31. data/lib/nordlet/bank/types/transactions_match_many_bank_response.rb +2 -0
  32. data/lib/nordlet/bank/types/transactions_match_many_bank_response_status.rb +1 -0
  33. data/lib/nordlet/bank/types/transactions_post_bank_request.rb +25 -0
  34. data/lib/nordlet/bank/types/transactions_post_bank_response.rb +39 -0
  35. data/lib/nordlet/bank/types/transactions_post_bank_response_status.rb +15 -0
  36. data/lib/nordlet/bank/types/transactions_record_bank_response.rb +2 -0
  37. data/lib/nordlet/bank/types/transactions_record_bank_response_status.rb +1 -0
  38. data/lib/nordlet/bank/types/transactions_unignore_bank_request.rb +11 -0
  39. data/lib/nordlet/bank/types/transactions_unignore_bank_response.rb +39 -0
  40. data/lib/nordlet/bank/types/transactions_unignore_bank_response_status.rb +15 -0
  41. data/lib/nordlet/bank/types/transactions_unmatch_bank_response.rb +2 -0
  42. data/lib/nordlet/bank/types/transactions_unmatch_bank_response_status.rb +1 -0
  43. data/lib/nordlet/billing/client.rb +3 -2
  44. data/lib/nordlet/billing/types/account_get_billing_response_month_to_date.rb +0 -2
  45. data/lib/nordlet/billing/types/account_set_account_type_billing_response_month_to_date.rb +0 -2
  46. data/lib/nordlet/billing/types/account_set_auto_top_up_billing_response_month_to_date.rb +0 -2
  47. data/lib/nordlet/billing/types/account_set_overdraft_cap_billing_response_month_to_date.rb +0 -2
  48. data/lib/nordlet/billing/types/account_set_plan_billing_response_month_to_date.rb +0 -2
  49. data/lib/nordlet/billing/types/flat_rate_confirm_billing_response_month_to_date.rb +0 -2
  50. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_month_to_date.rb +0 -2
  51. data/lib/nordlet/billing/types/subscription_cancel_billing_response_month_to_date.rb +0 -2
  52. data/lib/nordlet/billing/types/topup_confirm_billing_response_month_to_date.rb +0 -2
  53. data/lib/nordlet/calendar/client.rb +3 -1
  54. data/lib/nordlet/capture/client.rb +6 -188
  55. data/lib/nordlet/capture/types/documents_confirm_capture_response_invoice.rb +6 -0
  56. data/lib/nordlet/capture/types/documents_confirm_capture_response_invoice_status.rb +1 -0
  57. data/lib/nordlet/capture/types/documents_confirm_capture_response_opposite_invoice.rb +6 -0
  58. data/lib/nordlet/capture/types/documents_confirm_capture_response_opposite_invoice_status.rb +1 -0
  59. data/lib/nordlet/cash/client.rb +11 -10
  60. data/lib/nordlet/declarations/client.rb +7 -3
  61. data/lib/nordlet/declarations/types/configs_list_declarations_response_rows_item_fields_item.rb +2 -0
  62. data/lib/nordlet/declarations/types/configs_update_declarations_response_fields_item.rb +2 -0
  63. data/lib/nordlet/hr/client.rb +3 -2
  64. data/lib/nordlet/ledger/client.rb +46 -5
  65. data/lib/nordlet/ledger/types/journal_transactions_get_ledger_response.rb +2 -0
  66. data/lib/nordlet/ledger/types/journal_transactions_reverse_ledger_request.rb +15 -0
  67. data/lib/nordlet/ledger/types/journal_transactions_reverse_ledger_response.rb +27 -0
  68. data/lib/nordlet/ledger/types/journal_transactions_reverse_ledger_response_status.rb +14 -0
  69. data/lib/nordlet/ledger/types/periods_lock_ledger_response.rb +2 -0
  70. data/lib/nordlet/ledger/types/periods_lock_ledger_response_warnings_item.rb +17 -0
  71. data/lib/nordlet/ledger/types/periods_lock_ledger_response_warnings_item_code.rb +21 -0
  72. data/lib/nordlet/partners/client.rb +10 -8
  73. data/lib/nordlet/public/types/invoices_get_public_response.rb +2 -0
  74. data/lib/nordlet/purchases/client.rb +77 -20
  75. data/lib/nordlet/purchases/types/invoices_create_purchases_request.rb +6 -0
  76. data/lib/nordlet/purchases/types/invoices_create_purchases_response.rb +8 -0
  77. data/lib/nordlet/purchases/types/invoices_create_purchases_response_status.rb +1 -0
  78. data/lib/nordlet/purchases/types/invoices_create_purchases_response_warnings_item.rb +13 -0
  79. data/lib/nordlet/purchases/types/invoices_get_purchases_response.rb +6 -0
  80. data/lib/nordlet/purchases/types/invoices_get_purchases_response_status.rb +1 -0
  81. data/lib/nordlet/purchases/types/invoices_list_purchases_response_rows_item.rb +6 -0
  82. data/lib/nordlet/purchases/types/invoices_list_purchases_response_rows_item_status.rb +1 -0
  83. data/lib/nordlet/purchases/types/invoices_register_purchases_response.rb +8 -0
  84. data/lib/nordlet/purchases/types/invoices_register_purchases_response_status.rb +1 -0
  85. data/lib/nordlet/purchases/types/invoices_register_purchases_response_warnings_item.rb +13 -0
  86. data/lib/nordlet/purchases/types/invoices_reverse_purchases_request.rb +15 -0
  87. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response.rb +71 -0
  88. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response_lines_item.rb +53 -0
  89. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response_payment_status.rb +15 -0
  90. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response_status.rb +15 -0
  91. data/lib/nordlet/{capture/types/documents_upload_capture_response_extraction_document_type.rb → purchases/types/invoices_reverse_purchases_response_type.rb} +2 -2
  92. data/lib/nordlet/purchases/types/invoices_update_purchases_request.rb +6 -0
  93. data/lib/nordlet/purchases/types/invoices_update_purchases_response.rb +6 -0
  94. data/lib/nordlet/purchases/types/invoices_update_purchases_response_status.rb +1 -0
  95. data/lib/nordlet/reference/client.rb +8 -2
  96. data/lib/nordlet/reference/types/vat_resolve_reference_request.rb +2 -0
  97. data/lib/nordlet/reference/types/vat_resolve_reference_request_side.rb +14 -0
  98. data/lib/nordlet/reference/types/vat_resolve_reference_response.rb +2 -0
  99. data/lib/nordlet/reports/client.rb +42 -0
  100. data/lib/nordlet/reports/types/period_checklist_reports_request.rb +11 -0
  101. data/lib/nordlet/reports/types/period_checklist_reports_response.rb +17 -0
  102. data/lib/nordlet/reports/types/period_checklist_reports_response_items_item.rb +17 -0
  103. data/lib/nordlet/reports/types/period_checklist_reports_response_items_item_code.rb +21 -0
  104. data/lib/nordlet/sales/client.rb +19 -8
  105. data/lib/nordlet/sales/types/invoices_create_sales_response.rb +2 -0
  106. data/lib/nordlet/sales/types/invoices_create_sales_response_warnings_item.rb +13 -0
  107. data/lib/nordlet/sales/types/invoices_issue_sales_response.rb +2 -0
  108. data/lib/nordlet/sales/types/invoices_issue_sales_response_warnings_item.rb +13 -0
  109. data/lib/nordlet/sales/types/invoices_view_sales_response.rb +2 -0
  110. data/lib/nordlet/version.rb +1 -1
  111. data/lib/nordlet.rb +43 -19
  112. data/reference.md +863 -468
  113. metadata +45 -21
  114. data/lib/nordlet/capture/types/documents_upload_capture_request.rb +0 -15
  115. data/lib/nordlet/capture/types/documents_upload_capture_response.rb +0 -43
  116. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction.rb +0 -33
  117. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction_lines_item.rb +0 -25
  118. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction_opposite_lines_item.rb +0 -25
  119. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction_supplier.rb +0 -19
  120. data/lib/nordlet/capture/types/documents_upload_capture_response_status.rb +0 -16
  121. data/lib/nordlet/capture/types/inbound_email_capture_request.rb +0 -27
  122. data/lib/nordlet/capture/types/inbound_email_capture_request_attachments_item.rb +0 -21
  123. data/lib/nordlet/capture/types/inbound_email_capture_request_to.rb +0 -15
  124. data/lib/nordlet/capture/types/inbound_email_capture_request_to_full_item.rb +0 -11
  125. data/lib/nordlet/capture/types/inbound_email_capture_response.rb +0 -15
  126. data/lib/nordlet/capture/types/settings_get_capture_request.rb +0 -9
  127. data/lib/nordlet/capture/types/settings_get_capture_response.rb +0 -17
  128. data/lib/nordlet/capture/types/settings_regenerate_intake_capture_request.rb +0 -9
  129. data/lib/nordlet/capture/types/settings_regenerate_intake_capture_response.rb +0 -17
  130. data/lib/nordlet/capture/types/settings_update_capture_request.rb +0 -13
  131. data/lib/nordlet/capture/types/settings_update_capture_response.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eedd5efc8df32359e54a246907c9a3b325d2e9dffa7d452b9752c9eb8f745274
4
- data.tar.gz: 835276e28ec2eb23311f6f7d0ea94e2e6b3a5eff234ef55336d725b2a2dd87e4
3
+ metadata.gz: 6ed0244f834f6ff99e80367cf3a504a542db54928fbcf5670f841580613f66b3
4
+ data.tar.gz: 9bd52d990d28b249dd1cf6b46c1fa28aa4e7fc4a84d1c03ebe4911141147b97f
5
5
  SHA512:
6
- metadata.gz: d449387fa1acf0a830054dde08f75fca36b31437c95786111823e0af5a5b61be6e75e3a690af72c36291824ef898774df9be3e45ce8e4adf22f3de7a4966a764
7
- data.tar.gz: e2b7200ef78d6055fc2b4f6a4e7f878b28b53bf0e4fc44dda77ed70f4905668d58fd14c82141eac4bdb13bd2210585f1ba7546a5d1d89179bc6f7f6be0ee6e02
6
+ metadata.gz: 9e515850247e1dc2a6938da6148af9021ce52372a0d312fdda29c5f67612b63533822cf074775ae8bdc542521757744f39172ca69d57ddf338b9e490269ced23
7
+ data.tar.gz: 5df88e0194da9f10b7aef21dfe09ca1eafda1cbfd96b8f0f68615d98fcf12982c5022fbec21972c930cc8a56cb9810f0a4c63f47817eb324f2bb6e646ef63ae1
@@ -130,9 +130,11 @@ module Nordlet
130
130
  # Return the signed-in user, their active company and role in it, the companies they belong to and their consent
131
131
  # state. `billing` is the billing account of the request's site (the `x-nordlet-site` header, `app` when absent)
132
132
  # that pays for the active company (its payer, or the user when there is none or no company), with `isPayer`
133
- # saying whether that is the user; `referralPoints` is the user's current points balance. An API key may call it
134
- # too: the active company is then the one named in the `x-nordlet-company` header, and `companies` lists every
135
- # company the key works in.
133
+ # saying whether that is the user; `referralPoints` is the user's current points balance; `user.whiteLabel` says
134
+ # the user is a white-label partner, who may call `account/brand/get` and `account/brand/update`. An API key may
135
+ # call it too: the active company is then the one named in the `x-nordlet-company` header, and `companies` lists
136
+ # every company the key works in, each with its country, base currency, VAT payer flag, VAT period and the month
137
+ # its fiscal year ends in.
136
138
  #
137
139
  # @param request_options [Hash]
138
140
  # @param params [Nordlet::Account::Types::MeAccountRequest]
@@ -525,7 +527,8 @@ module Nordlet
525
527
  # to true and `defaultInvoiceCurrency` to the base currency. Without a paid plan the caller may create only one
526
528
  # sandbox company, which starts the free sandbox plan; a live company, a second sandbox company, or a sandbox
527
529
  # company after the free sandbox has ended is refused with 402. Refused with 422 when `baseCurrency` is not a
528
- # supported currency.
530
+ # supported currency. An API key may call it when it holds the `account:write` scope (403 otherwise): the company
531
+ # is created for the person the key belongs to, and the key works in it like in their other companies.
529
532
  #
530
533
  # @param request_options [Hash]
531
534
  # @param params [Nordlet::Account::Types::CompaniesCreateAccountRequest]
@@ -595,7 +598,8 @@ module Nordlet
595
598
  end
596
599
  end
597
600
 
598
- # Return the profile of the active company.
601
+ # Return the profile of the active company. An API key reads the company named in the `x-nordlet-company` header
602
+ # and needs the `account:read` scope.
599
603
  #
600
604
  # @param request_options [Hash]
601
605
  # @param params [Nordlet::Account::Types::CompaniesProfileAccountRequest]
@@ -632,7 +636,11 @@ module Nordlet
632
636
  # Change the profile of the active company; owners and admins may call it. Only the fields sent are changed, and
633
637
  # the nullable ones can be sent as null to clear them. `logo` stores a base64-encoded image as a file of the
634
638
  # company and sets `logoFileId`. The country, base currency, sandbox flag and cash-basis flag are fixed at
635
- # creation.
639
+ # creation. An API key changes the company named in the `x-nordlet-company` header, needs the `account:write`
640
+ # scope and the owner or admin role there, and may send only `code`, `vatCode`, `smeExemptionNumber`, `legalForm`,
641
+ # `registryName`, `incorporatedOn`, `shareCapital`, `address`, `email`, `phone`, `accountsKeptBy`,
642
+ # `bookkeeperName`, `auditorName`, `auditorRegistrationNumber`, `auditRequired`; any other field is refused with
643
+ # 403.
636
644
  #
637
645
  # @param request_options [Hash]
638
646
  # @param params [Nordlet::Account::Types::CompaniesUpdateAccountRequest]
@@ -1026,6 +1034,81 @@ module Nordlet
1026
1034
  end
1027
1035
  end
1028
1036
 
1037
+ # Return the brand settings of the signed-in white-label partner: `name`, `logoUrl`, `color` and `footer`, each
1038
+ # null when not set. Refused with 403 when the user is not a white-label partner.
1039
+ #
1040
+ # @param request_options [Hash]
1041
+ # @param params [Nordlet::Account::Types::BrandGetAccountRequest]
1042
+ # @option request_options [String] :base_url
1043
+ # @option request_options [Hash{String => Object}] :additional_headers
1044
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1045
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1046
+ # @option request_options [Integer] :timeout_in_seconds
1047
+ #
1048
+ # @return [Nordlet::Account::Types::BrandGetAccountResponse]
1049
+ def brand_get(request_options: {}, **params)
1050
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
1051
+ request = Nordlet::Internal::JSON::Request.new(
1052
+ base_url: request_options[:base_url],
1053
+ method: "POST",
1054
+ path: "v1/account/brand/get",
1055
+ body: Nordlet::Account::Types::BrandGetAccountRequest.new(params).to_h,
1056
+ request_options: request_options
1057
+ )
1058
+ begin
1059
+ response = @client.send(request)
1060
+ rescue Net::HTTPRequestTimeout
1061
+ raise Nordlet::Errors::TimeoutError
1062
+ end
1063
+ code = response.code.to_i
1064
+ if code.between?(200, 299)
1065
+ Nordlet::Account::Types::BrandGetAccountResponse.load(response.body)
1066
+ else
1067
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
1068
+ raise error_class.new(response.body, code: code)
1069
+ end
1070
+ end
1071
+
1072
+ # Set the brand settings of the signed-in white-label partner; all four fields are sent and null clears one. They
1073
+ # apply to every company the user pays for: the invoice, quote and payment reminder e-mails show `logoUrl` (an
1074
+ # https address of an image) in the header, use `color` (`#rrggbb`) for the top line, the brand name and the
1075
+ # buttons, and print `footer`, or `name` when there is no footer, in place of the Nordlet footer line; the public
1076
+ # invoice page prints `name` in its "Sent with" line and leaves the line out when there is no name (`sentWith` of
1077
+ # `public/invoices/get`); filled official form PDFs carry `name` as their producer and creator. Refused with 403
1078
+ # when the user is not a white-label partner.
1079
+ #
1080
+ # @param request_options [Hash]
1081
+ # @param params [Nordlet::Account::Types::BrandUpdateAccountRequest]
1082
+ # @option request_options [String] :base_url
1083
+ # @option request_options [Hash{String => Object}] :additional_headers
1084
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1085
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1086
+ # @option request_options [Integer] :timeout_in_seconds
1087
+ #
1088
+ # @return [Nordlet::Account::Types::BrandUpdateAccountResponse]
1089
+ def brand_update(request_options: {}, **params)
1090
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
1091
+ request = Nordlet::Internal::JSON::Request.new(
1092
+ base_url: request_options[:base_url],
1093
+ method: "POST",
1094
+ path: "v1/account/brand/update",
1095
+ body: Nordlet::Account::Types::BrandUpdateAccountRequest.new(params).to_h,
1096
+ request_options: request_options
1097
+ )
1098
+ begin
1099
+ response = @client.send(request)
1100
+ rescue Net::HTTPRequestTimeout
1101
+ raise Nordlet::Errors::TimeoutError
1102
+ end
1103
+ code = response.code.to_i
1104
+ if code.between?(200, 299)
1105
+ Nordlet::Account::Types::BrandUpdateAccountResponse.load(response.body)
1106
+ else
1107
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
1108
+ raise error_class.new(response.body, code: code)
1109
+ end
1110
+ end
1111
+
1029
1112
  # Send a confirmation link for the change to `newEmail` to the user's current address. When it is consumed with
1030
1113
  # `account/login-link/consume`, a second link goes to `newEmail`, and the address changes when that one is
1031
1114
  # consumed. When an unused link for `newEmail` was created within the last minute, the call answers `sent` without
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class BrandGetAccountRequest < Internal::Types::Model; end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class BrandGetAccountResponse < Internal::Types::Model
7
+ field :name, -> { String }, optional: false, nullable: true
8
+
9
+ field :logo_url, -> { String }, optional: false, nullable: true, api_name: "logoUrl"
10
+
11
+ field :color, -> { String }, optional: false, nullable: true
12
+
13
+ field :footer, -> { String }, optional: false, nullable: true
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class BrandUpdateAccountRequest < Internal::Types::Model
7
+ field :name, -> { String }, optional: false, nullable: true
8
+
9
+ field :logo_url, -> { String }, optional: false, nullable: true, api_name: "logoUrl"
10
+
11
+ field :color, -> { String }, optional: false, nullable: true
12
+
13
+ field :footer, -> { String }, optional: false, nullable: true
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class BrandUpdateAccountResponse < Internal::Types::Model
7
+ field :name, -> { String }, optional: false, nullable: true
8
+
9
+ field :logo_url, -> { String }, optional: false, nullable: true, api_name: "logoUrl"
10
+
11
+ field :color, -> { String }, optional: false, nullable: true
12
+
13
+ field :footer, -> { String }, optional: false, nullable: true
14
+ end
15
+ end
16
+ end
17
+ end
@@ -17,6 +17,16 @@ module Nordlet
17
17
  field :is_sandbox, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isSandbox"
18
18
 
19
19
  field :cash_basis, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "cashBasis"
20
+
21
+ field :country_code, -> { String }, optional: false, nullable: false, api_name: "countryCode"
22
+
23
+ field :base_currency, -> { String }, optional: false, nullable: false, api_name: "baseCurrency"
24
+
25
+ field :is_vat_payer, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isVatPayer"
26
+
27
+ field :vat_period, -> { Nordlet::Account::Types::CompaniesCreateAccountResponseVatPeriod }, optional: false, nullable: true, api_name: "vatPeriod"
28
+
29
+ field :fiscal_year_end_month, -> { Integer }, optional: false, nullable: true, api_name: "fiscalYearEndMonth"
20
30
  end
21
31
  end
22
32
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ module CompaniesCreateAccountResponseVatPeriod
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ MONTHLY = "monthly"
10
+ BIMONTHLY = "bimonthly"
11
+ QUARTERLY = "quarterly"
12
+ SEMIANNUAL = "semiannual"
13
+ ANNUAL = "annual"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -18,6 +18,16 @@ module Nordlet
18
18
 
19
19
  field :cash_basis, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "cashBasis"
20
20
 
21
+ field :country_code, -> { String }, optional: false, nullable: false, api_name: "countryCode"
22
+
23
+ field :base_currency, -> { String }, optional: false, nullable: false, api_name: "baseCurrency"
24
+
25
+ field :is_vat_payer, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isVatPayer"
26
+
27
+ field :vat_period, -> { Nordlet::Account::Types::MeAccountResponseCompaniesItemVatPeriod }, optional: false, nullable: true, api_name: "vatPeriod"
28
+
29
+ field :fiscal_year_end_month, -> { Integer }, optional: false, nullable: true, api_name: "fiscalYearEndMonth"
30
+
21
31
  field :status, -> { Nordlet::Account::Types::MeAccountResponseCompaniesItemStatus }, optional: false, nullable: false
22
32
 
23
33
  field :deleted_at, -> { String }, optional: false, nullable: true, api_name: "deletedAt"
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ module MeAccountResponseCompaniesItemVatPeriod
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ MONTHLY = "monthly"
10
+ BIMONTHLY = "bimonthly"
11
+ QUARTERLY = "quarterly"
12
+ SEMIANNUAL = "semiannual"
13
+ ANNUAL = "annual"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -15,6 +15,8 @@ module Nordlet
15
15
  field :plan, -> { String }, optional: false, nullable: false
16
16
 
17
17
  field :is_super_admin, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isSuperAdmin"
18
+
19
+ field :white_label, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "whiteLabel"
18
20
  end
19
21
  end
20
22
  end
@@ -119,8 +119,13 @@ module Nordlet
119
119
 
120
120
  # Insert statement lines (up to 1000 per call) into a bank account as new transactions. A line without `currency`
121
121
  # takes the account currency; a line in another currency is refused with 422. A line whose `externalId` is already
122
- # on the account is skipped and counted in `skipped`. An incoming line that an active match rule
123
- # (`bank/match-rules/create`) recognises is linked to its settlement batch.
122
+ # on the account is skipped and counted in `skipped`. A line without `externalId` that is identical to a line
123
+ # already on the account (same booking date, amount, counterparty IBAN, or name when either IBAN is missing, and
124
+ # description) is skipped, counted in `skipped` and listed in `duplicates`. When `openingBalance` and
125
+ # `closingBalance` are both given, the opening balance plus the lines must give the closing balance (422 with both
126
+ # figures otherwise), and the closing balance is kept for `bank/reconciliation/get` as the balance on the latest
127
+ # line date. An incoming line that an active match rule (`bank/match-rules/create`) recognises is linked to its
128
+ # settlement batch.
124
129
  #
125
130
  # @param request_options [Hash]
126
131
  # @param params [Nordlet::Bank::Types::TransactionsImportBankRequest]
@@ -157,8 +162,10 @@ module Nordlet
157
162
  # Import a statement file into a bank account: camt.053 XML, MT940, a Stripe balance CSV or a Revolut Business
158
163
  # CSV, chosen by `format` or by the type of `templateId` (an iso20022 template also takes MT940 content).
159
164
  # Statements whose IBAN or currency differ from the account are left out; the call is refused with 422 when none
160
- # remains, when a line is in another currency, when the file lacks the columns or elements the template requires
161
- # or when it holds more than 50000 lines. Lines already on the account are skipped, and Stripe movements already
165
+ # remains, when a line is in another currency, when the opening balance plus the lines of a camt.053 or MT940
166
+ # statement does not give its closing balance (the message names both figures), when the file lacks the columns or
167
+ # elements the template requires or when it holds more than 50000 lines. The closing balance of each statement is
168
+ # kept for `bank/reconciliation/get`. Lines already on the account are skipped, and Stripe movements already
162
169
  # posted through a settlement payout are skipped with a warning. With a template, the mapped fields are posted to
163
170
  # their ledger accounts, partners are created, payments are matched to the invoices they reference, and invoices,
164
171
  # credit notes or advance invoices are issued where the template asks for them (`invoiceMetaField`,
@@ -239,10 +246,15 @@ module Nordlet
239
246
  # with any exchange difference on the gain or loss account, raises the paid amount of the document and sets the
240
247
  # line to matched. A payment in another currency is converted into the invoice currency at the rate of the line
241
248
  # date, and the difference against the invoice's own rate is the exchange difference; `invoiceAmount` states the
242
- # amount settled instead; in the same currency it must equal the payment (422). Answers 409 when the line is
243
- # already matched, when the amount (converted, beyond one cent of the payment) exceeds the remaining balance of
244
- # the document or when the accounting period of the line date is locked. A document that becomes fully paid is
245
- # announced as `sale_invoice.paid` or `purchase_invoice.paid`.
249
+ # amount settled instead; in the same currency it must equal the payment (422). `remainder` settles a payment that
250
+ # differs from the remaining balance of a sale or purchase invoice in its own currency: `advance` books an
251
+ # overpayment beyond the balance to the advances-received posting rule (customer payments) or to
252
+ # `remainder.accountCode`, which a supplier overpayment must name, on the line's partner; `write_off` books the
253
+ # over- or underpayment to `remainder.accountCode` and settles the invoice in full; `leave_open` settles an
254
+ # underpayment as a partial payment and leaves the rest open. Answers 409 when the line is already matched or
255
+ # ignored, when the amount (converted, beyond one cent of the payment) exceeds the remaining balance of the
256
+ # document and no `remainder` is given, or when the accounting period of the line date is locked. A document that
257
+ # becomes fully paid is announced as `sale_invoice.paid` or `purchase_invoice.paid`.
246
258
  #
247
259
  # @param request_options [Hash]
248
260
  # @param params [Nordlet::Bank::Types::TransactionsMatchBankRequest]
@@ -316,9 +328,11 @@ module Nordlet
316
328
  end
317
329
  end
318
330
 
319
- # Undo a match. A payment matched to an invoice, or a line posted by an import template, gets a reversing journal
320
- # transaction dated date (default: today) and the invoice paid amount and payment status are restored; a line
321
- # linked to a payment-provider settlement is only unlinked. The line returns to status new.
331
+ # Undo a match. A payment matched to an invoice, a line posted by an import template or by
332
+ # `bank/transactions/post` (to an account or a tax payment) gets a reversing journal transaction dated date
333
+ # (default: today) and the invoice paid amount and payment status are restored; a line linked to a
334
+ # payment-provider settlement is only unlinked; an ignored line is restored as with `bank/transactions/unignore`.
335
+ # The line returns to status new.
322
336
  #
323
337
  # @param request_options [Hash]
324
338
  # @param params [Nordlet::Bank::Types::TransactionsUnmatchBankRequest]
@@ -352,10 +366,165 @@ module Nordlet
352
366
  end
353
367
  end
354
368
 
369
+ # Book one new bank transaction against a ledger account, for lines that settle no invoice (bank fees, interest,
370
+ # tax payments, transfers). Posts a journal transaction dated on the line's booking date between the bank
371
+ # account's ledger account and `accountCode` (incoming money: debit bank, credit the account; outgoing money the
372
+ # reverse), with the optional `partnerId` on the transaction and `costCenterId` and `projectId` on the counter
373
+ # entry, and sets the line to matched with `matchedDocumentType` `journal_transaction`. With `taxPaymentId` the
374
+ # line settles a tax payment recorded with `declarations/tax-payments/create`: an outgoing line for a payment, an
375
+ # incoming line for a refund, in the company currency and for the same amount (422 otherwise), not yet booked from
376
+ # another line (409); the line is matched as `tax_payment`. VAT is not booked here, because VAT returns are built
377
+ # from documents: a `vatClassifierCode` answers 422, and a fee with VAT is registered as a purchase invoice and
378
+ # the line matched to it. Answers 409 when the line is already matched or ignored or when the accounting period of
379
+ # the line date is locked. `bank/transactions/unmatch` reverses the posting.
380
+ #
381
+ # @param request_options [Hash]
382
+ # @param params [Nordlet::Bank::Types::TransactionsPostBankRequest]
383
+ # @option request_options [String] :base_url
384
+ # @option request_options [Hash{String => Object}] :additional_headers
385
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
386
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
387
+ # @option request_options [Integer] :timeout_in_seconds
388
+ #
389
+ # @return [Nordlet::Bank::Types::TransactionsPostBankResponse]
390
+ def transactions_post(request_options: {}, **params)
391
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
392
+ request = Nordlet::Internal::JSON::Request.new(
393
+ base_url: request_options[:base_url],
394
+ method: "POST",
395
+ path: "v1/bank/transactions/post",
396
+ body: Nordlet::Bank::Types::TransactionsPostBankRequest.new(params).to_h,
397
+ request_options: request_options
398
+ )
399
+ begin
400
+ response = @client.send(request)
401
+ rescue Net::HTTPRequestTimeout
402
+ raise Nordlet::Errors::TimeoutError
403
+ end
404
+ code = response.code.to_i
405
+ if code.between?(200, 299)
406
+ Nordlet::Bank::Types::TransactionsPostBankResponse.load(response.body)
407
+ else
408
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
409
+ raise error_class.new(response.body, code: code)
410
+ end
411
+ end
412
+
413
+ # Mark a new bank transaction as ignored, for a line that needs no booking (a duplicate the bank sent, a line
414
+ # booked another way), with the reason kept on the line. Nothing is posted. Answers 409 when the line is matched
415
+ # or already ignored; `bank/transactions/unignore` returns it to new.
416
+ #
417
+ # @param request_options [Hash]
418
+ # @param params [Nordlet::Bank::Types::TransactionsIgnoreBankRequest]
419
+ # @option request_options [String] :base_url
420
+ # @option request_options [Hash{String => Object}] :additional_headers
421
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
422
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
423
+ # @option request_options [Integer] :timeout_in_seconds
424
+ #
425
+ # @return [Nordlet::Bank::Types::TransactionsIgnoreBankResponse]
426
+ def transactions_ignore(request_options: {}, **params)
427
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
428
+ request = Nordlet::Internal::JSON::Request.new(
429
+ base_url: request_options[:base_url],
430
+ method: "POST",
431
+ path: "v1/bank/transactions/ignore",
432
+ body: Nordlet::Bank::Types::TransactionsIgnoreBankRequest.new(params).to_h,
433
+ request_options: request_options
434
+ )
435
+ begin
436
+ response = @client.send(request)
437
+ rescue Net::HTTPRequestTimeout
438
+ raise Nordlet::Errors::TimeoutError
439
+ end
440
+ code = response.code.to_i
441
+ if code.between?(200, 299)
442
+ Nordlet::Bank::Types::TransactionsIgnoreBankResponse.load(response.body)
443
+ else
444
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
445
+ raise error_class.new(response.body, code: code)
446
+ end
447
+ end
448
+
449
+ # Return an ignored bank transaction to status new and clear its reason. Answers 409 when the line is not ignored.
450
+ #
451
+ # @param request_options [Hash]
452
+ # @param params [Nordlet::Bank::Types::TransactionsUnignoreBankRequest]
453
+ # @option request_options [String] :base_url
454
+ # @option request_options [Hash{String => Object}] :additional_headers
455
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
456
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
457
+ # @option request_options [Integer] :timeout_in_seconds
458
+ #
459
+ # @return [Nordlet::Bank::Types::TransactionsUnignoreBankResponse]
460
+ def transactions_unignore(request_options: {}, **params)
461
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
462
+ request = Nordlet::Internal::JSON::Request.new(
463
+ base_url: request_options[:base_url],
464
+ method: "POST",
465
+ path: "v1/bank/transactions/unignore",
466
+ body: Nordlet::Bank::Types::TransactionsUnignoreBankRequest.new(params).to_h,
467
+ request_options: request_options
468
+ )
469
+ begin
470
+ response = @client.send(request)
471
+ rescue Net::HTTPRequestTimeout
472
+ raise Nordlet::Errors::TimeoutError
473
+ end
474
+ code = response.code.to_i
475
+ if code.between?(200, 299)
476
+ Nordlet::Bank::Types::TransactionsUnignoreBankResponse.load(response.body)
477
+ else
478
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
479
+ raise error_class.new(response.body, code: code)
480
+ end
481
+ end
482
+
483
+ # Compare a bank account's statement balance with its ledger balance on `date`. The statement balance is
484
+ # `statementBalance` when given, else the latest closing balance kept from an imported statement on or before
485
+ # `date` (`statementClosingDate`) plus the lines on the account dated after it up to `date`. The ledger balance is
486
+ # the posted balance of the bank account's ledger account up to `date`, in the account currency (for an account in
487
+ # another currency than the company's, the sum of the entries' currency amounts in that currency). `difference` is
488
+ # the statement balance less the ledger balance. `unbookedLines` are the lines up to `date` still in status new
489
+ # (at most 1000; `unbookedCount` and `unbookedTotal` cover all of them). Answers 404 when the bank account does
490
+ # not exist.
491
+ #
492
+ # @param request_options [Hash]
493
+ # @param params [Nordlet::Bank::Types::ReconciliationGetBankRequest]
494
+ # @option request_options [String] :base_url
495
+ # @option request_options [Hash{String => Object}] :additional_headers
496
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
497
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
498
+ # @option request_options [Integer] :timeout_in_seconds
499
+ #
500
+ # @return [Nordlet::Bank::Types::ReconciliationGetBankResponse]
501
+ def reconciliation_get(request_options: {}, **params)
502
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
503
+ request = Nordlet::Internal::JSON::Request.new(
504
+ base_url: request_options[:base_url],
505
+ method: "POST",
506
+ path: "v1/bank/reconciliation/get",
507
+ body: Nordlet::Bank::Types::ReconciliationGetBankRequest.new(params).to_h,
508
+ request_options: request_options
509
+ )
510
+ begin
511
+ response = @client.send(request)
512
+ rescue Net::HTTPRequestTimeout
513
+ raise Nordlet::Errors::TimeoutError
514
+ end
515
+ code = response.code.to_i
516
+ if code.between?(200, 299)
517
+ Nordlet::Bank::Types::ReconciliationGetBankResponse.load(response.body)
518
+ else
519
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
520
+ raise error_class.new(response.body, code: code)
521
+ end
522
+ end
523
+
355
524
  # Record a payment that is on no imported statement: inserts a bank transaction on the account dated `date`
356
- # (positive for a sale invoice, negative for a purchase invoice or payroll run, in the account currency) and
357
- # matches it to the document with the checks, posting and `sale_invoice.paid` or `purchase_invoice.paid` event of
358
- # `bank/transactions/match`.
525
+ # (`amount` is always positive, in the account currency: money received for a sale invoice, money paid out for a
526
+ # purchase invoice or payroll run) and matches it to the document with the checks, posting and `sale_invoice.paid`
527
+ # or `purchase_invoice.paid` event of `bank/transactions/match`.
359
528
  #
360
529
  # @param request_options [Hash]
361
530
  # @param params [Nordlet::Bank::Types::TransactionsRecordBankRequest]
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Bank
5
+ module Types
6
+ class ReconciliationGetBankRequest < Internal::Types::Model
7
+ field :bank_account_id, -> { String }, optional: false, nullable: false, api_name: "bankAccountId"
8
+
9
+ field :date, -> { String }, optional: false, nullable: false
10
+
11
+ field :statement_balance, -> { String }, optional: true, nullable: false, api_name: "statementBalance"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Bank
5
+ module Types
6
+ class ReconciliationGetBankResponse < Internal::Types::Model
7
+ field :bank_account_id, -> { String }, optional: false, nullable: false, api_name: "bankAccountId"
8
+
9
+ field :account_code, -> { String }, optional: false, nullable: false, api_name: "accountCode"
10
+
11
+ field :currency, -> { String }, optional: false, nullable: false
12
+
13
+ field :date, -> { String }, optional: false, nullable: false
14
+
15
+ field :statement_balance, -> { String }, optional: false, nullable: true, api_name: "statementBalance"
16
+
17
+ field :statement_balance_source, -> { Nordlet::Bank::Types::ReconciliationGetBankResponseStatementBalanceSource }, optional: false, nullable: true, api_name: "statementBalanceSource"
18
+
19
+ field :statement_closing_date, -> { String }, optional: false, nullable: true, api_name: "statementClosingDate"
20
+
21
+ field :ledger_balance, -> { String }, optional: false, nullable: false, api_name: "ledgerBalance"
22
+
23
+ field :difference, -> { String }, optional: false, nullable: true
24
+
25
+ field :unbooked_count, -> { Integer }, optional: false, nullable: false, api_name: "unbookedCount"
26
+
27
+ field :unbooked_total, -> { String }, optional: false, nullable: false, api_name: "unbookedTotal"
28
+
29
+ field :unbooked_lines, -> { Internal::Types::Array[Nordlet::Bank::Types::ReconciliationGetBankResponseUnbookedLinesItem] }, optional: false, nullable: false, api_name: "unbookedLines"
30
+
31
+ field :warnings, -> { Internal::Types::Array[String] }, optional: false, nullable: false
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Bank
5
+ module Types
6
+ module ReconciliationGetBankResponseStatementBalanceSource
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ REQUEST = "request"
10
+ STATEMENT = "statement"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Bank
5
+ module Types
6
+ class ReconciliationGetBankResponseUnbookedLinesItem < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :bank_account_id, -> { String }, optional: false, nullable: false, api_name: "bankAccountId"
10
+
11
+ field :date, -> { String }, optional: false, nullable: false
12
+
13
+ field :amount, -> { String }, optional: false, nullable: false
14
+
15
+ field :currency, -> { String }, optional: false, nullable: false
16
+
17
+ field :counterparty_name, -> { String }, optional: false, nullable: true, api_name: "counterpartyName"
18
+
19
+ field :counterparty_iban, -> { String }, optional: false, nullable: true, api_name: "counterpartyIban"
20
+
21
+ field :description, -> { String }, optional: false, nullable: true
22
+
23
+ field :external_id, -> { String }, optional: false, nullable: true, api_name: "externalId"
24
+
25
+ field :status, -> { Nordlet::Bank::Types::ReconciliationGetBankResponseUnbookedLinesItemStatus }, optional: false, nullable: false
26
+
27
+ field :matched_document_type, -> { String }, optional: false, nullable: true, api_name: "matchedDocumentType"
28
+
29
+ field :matched_document_id, -> { String }, optional: false, nullable: true, api_name: "matchedDocumentId"
30
+
31
+ field :journal_transaction_id, -> { String }, optional: false, nullable: true, api_name: "journalTransactionId"
32
+
33
+ field :ignore_reason, -> { String }, optional: false, nullable: true, api_name: "ignoreReason"
34
+
35
+ field :created_at, -> { String }, optional: false, nullable: false, api_name: "createdAt"
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Bank
5
+ module Types
6
+ module ReconciliationGetBankResponseUnbookedLinesItemStatus
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ NEW = "new"
10
+ MATCHED = "matched"
11
+ IGNORED = "ignored"
12
+ end
13
+ end
14
+ end
15
+ end