nordlet 0.5.6 → 0.6.0
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.
- checksums.yaml +4 -4
- data/lib/nordlet/account/client.rb +2 -1
- data/lib/nordlet/account/types/companies_create_account_request.rb +16 -0
- data/lib/nordlet/account/types/companies_create_account_request_country_code.rb +222 -3
- data/lib/nordlet/account/types/companies_create_account_request_default_invoice_locale.rb +44 -0
- data/lib/nordlet/account/types/companies_create_account_response.rb +2 -0
- data/lib/nordlet/account/types/companies_profile_account_response.rb +18 -0
- data/lib/nordlet/account/types/companies_update_account_request.rb +14 -0
- data/lib/nordlet/account/types/companies_update_account_request_default_invoice_locale.rb +44 -0
- data/lib/nordlet/account/types/companies_update_account_response.rb +18 -0
- data/lib/nordlet/account/types/me_account_response_companies_item.rb +2 -0
- data/lib/nordlet/billing/client.rb +40 -3
- data/lib/nordlet/billing/types/account_get_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/account_get_billing_response_plan.rb +1 -0
- data/lib/nordlet/billing/types/account_set_account_type_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/account_set_account_type_billing_response_plan.rb +1 -0
- data/lib/nordlet/billing/types/account_set_auto_top_up_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/account_set_auto_top_up_billing_response_plan.rb +1 -0
- data/lib/nordlet/billing/types/account_set_overdraft_cap_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/account_set_overdraft_cap_billing_response_plan.rb +1 -0
- data/lib/nordlet/billing/types/account_set_plan_billing_request_plan.rb +1 -0
- data/lib/nordlet/billing/types/account_set_plan_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/account_set_plan_billing_response_plan.rb +1 -0
- data/lib/nordlet/billing/types/flat_rate_confirm_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/flat_rate_confirm_billing_response_plan.rb +1 -0
- data/lib/nordlet/billing/types/flat_rate_create_billing_request_plan.rb +1 -0
- data/lib/nordlet/billing/types/subscription_cancel_billing_request.rb +9 -0
- data/lib/nordlet/billing/types/subscription_cancel_billing_response.rb +51 -0
- data/lib/nordlet/billing/types/subscription_cancel_billing_response_account_type.rb +14 -0
- data/lib/nordlet/billing/types/subscription_cancel_billing_response_auto_top_up.rb +15 -0
- data/lib/nordlet/billing/types/subscription_cancel_billing_response_month_to_date.rb +27 -0
- data/lib/nordlet/billing/types/subscription_cancel_billing_response_plan.rb +16 -0
- data/lib/nordlet/billing/types/subscription_cancel_billing_response_plans_value.rb +19 -0
- data/lib/nordlet/billing/types/subscription_cancel_billing_response_status.rb +15 -0
- data/lib/nordlet/billing/types/subscription_cancel_billing_response_top_up.rb +13 -0
- data/lib/nordlet/billing/types/topup_confirm_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/topup_confirm_billing_response_plan.rb +1 -0
- data/lib/nordlet/declarations/client.rb +45 -4
- data/lib/nordlet/declarations/types/de_euer_get_declarations_request.rb +11 -0
- data/lib/nordlet/declarations/types/de_euer_get_declarations_response.rb +17 -0
- data/lib/nordlet/declarations/types/de_euer_get_declarations_response_rows_item.rb +19 -0
- data/lib/nordlet/declarations/types/de_euer_get_declarations_response_rows_item_anlage.rb +14 -0
- data/lib/nordlet/declarations/types/de_return_facts_get_declarations_response_facts.rb +6 -0
- data/lib/nordlet/declarations/types/de_return_facts_get_declarations_response_facts_euer_einkunftsart.rb +15 -0
- data/lib/nordlet/declarations/types/de_return_facts_set_declarations_request_facts.rb +6 -0
- data/lib/nordlet/declarations/types/de_return_facts_set_declarations_request_facts_euer_einkunftsart.rb +15 -0
- data/lib/nordlet/declarations/types/de_return_facts_set_declarations_response_facts.rb +6 -0
- data/lib/nordlet/declarations/types/de_return_facts_set_declarations_response_facts_euer_einkunftsart.rb +15 -0
- data/lib/nordlet/declarations/types/de_returns_generate_declarations_request_rule_key.rb +1 -0
- data/lib/nordlet/partners/client.rb +11 -10
- data/lib/nordlet/partners/types/create_partners_request.rb +4 -0
- data/lib/nordlet/partners/types/create_partners_request_invoice_currency.rb +97 -0
- data/lib/nordlet/partners/types/create_partners_request_invoice_locale.rb +44 -0
- data/lib/nordlet/partners/types/create_partners_response.rb +4 -0
- data/lib/nordlet/partners/types/find_or_create_partners_request.rb +4 -0
- data/lib/nordlet/partners/types/find_or_create_partners_request_invoice_currency.rb +97 -0
- data/lib/nordlet/partners/types/find_or_create_partners_request_invoice_locale.rb +44 -0
- data/lib/nordlet/partners/types/find_or_create_partners_response_partner.rb +4 -0
- data/lib/nordlet/partners/types/get_partners_response.rb +4 -0
- data/lib/nordlet/partners/types/list_partners_response_rows_item.rb +4 -0
- data/lib/nordlet/partners/types/update_partners_request.rb +4 -0
- data/lib/nordlet/partners/types/update_partners_request_invoice_currency.rb +97 -0
- data/lib/nordlet/partners/types/update_partners_request_invoice_locale.rb +44 -0
- data/lib/nordlet/partners/types/update_partners_response.rb +4 -0
- data/lib/nordlet/public/client.rb +111 -2
- data/lib/nordlet/public/types/invoices_checkout_public_request.rb +11 -0
- data/lib/nordlet/public/types/invoices_checkout_public_response.rb +11 -0
- data/lib/nordlet/public/types/invoices_get_public_request.rb +11 -0
- data/lib/nordlet/public/types/invoices_get_public_response.rb +47 -0
- data/lib/nordlet/public/types/invoices_get_public_response_buyer.rb +17 -0
- data/lib/nordlet/public/types/invoices_get_public_response_buyer_address.rb +17 -0
- data/lib/nordlet/public/types/invoices_get_public_response_lines_item.rb +21 -0
- data/lib/nordlet/public/types/invoices_get_public_response_payment_status.rb +15 -0
- data/lib/nordlet/public/types/invoices_get_public_response_seller.rb +31 -0
- data/lib/nordlet/public/types/invoices_get_public_response_seller_address.rb +17 -0
- data/lib/nordlet/public/types/invoices_get_public_response_status.rb +14 -0
- data/lib/nordlet/public/types/invoices_get_public_response_type.rb +16 -0
- data/lib/nordlet/public/types/invoices_pdf_public_request.rb +11 -0
- data/lib/nordlet/public/types/invoices_pdf_public_response.rb +15 -0
- data/lib/nordlet/sales/client.rb +237 -9
- data/lib/nordlet/sales/types/exports_month_sales_request.rb +13 -0
- data/lib/nordlet/sales/types/exports_month_sales_request_format.rb +15 -0
- data/lib/nordlet/sales/types/exports_month_sales_response.rb +15 -0
- data/lib/nordlet/sales/types/invoices_apply_advance_sales_response.rb +8 -0
- data/lib/nordlet/sales/types/invoices_card_payments_connect_sales_request.rb +13 -0
- data/lib/nordlet/sales/types/invoices_card_payments_connect_sales_response.rb +11 -0
- data/lib/nordlet/sales/types/invoices_card_payments_disconnect_sales_request.rb +9 -0
- data/lib/nordlet/sales/types/invoices_card_payments_disconnect_sales_response.rb +15 -0
- data/lib/nordlet/sales/types/invoices_card_payments_get_sales_request.rb +9 -0
- data/lib/nordlet/sales/types/invoices_card_payments_get_sales_response.rb +15 -0
- data/lib/nordlet/sales/types/invoices_create_sales_request.rb +6 -0
- data/lib/nordlet/sales/types/invoices_create_sales_request_locale.rb +29 -0
- data/lib/nordlet/sales/types/invoices_create_sales_response.rb +8 -0
- data/lib/nordlet/sales/types/invoices_get_sales_response.rb +8 -0
- data/lib/nordlet/sales/types/invoices_issue_sales_response.rb +8 -0
- data/lib/nordlet/sales/types/invoices_list_sales_response_rows_item.rb +8 -0
- data/lib/nordlet/sales/types/invoices_lock_sales_response.rb +8 -0
- data/lib/nordlet/sales/types/invoices_payment_link_sales_response_source.rb +1 -0
- data/lib/nordlet/sales/types/invoices_pdf_sales_request_locale.rb +29 -0
- data/lib/nordlet/sales/types/invoices_send_sales_request.rb +2 -0
- data/lib/nordlet/sales/types/invoices_send_sales_request_locale.rb +29 -0
- data/lib/nordlet/sales/types/invoices_unlock_sales_response.rb +8 -0
- data/lib/nordlet/sales/types/invoices_update_sales_request.rb +6 -0
- data/lib/nordlet/sales/types/invoices_update_sales_request_locale.rb +29 -0
- data/lib/nordlet/sales/types/invoices_update_sales_response.rb +8 -0
- data/lib/nordlet/sales/types/invoices_view_sales_request.rb +11 -0
- data/lib/nordlet/sales/types/invoices_view_sales_response.rb +49 -0
- data/lib/nordlet/sales/types/invoices_view_sales_response_buyer.rb +17 -0
- data/lib/nordlet/sales/types/invoices_view_sales_response_buyer_address.rb +17 -0
- data/lib/nordlet/sales/types/invoices_view_sales_response_lines_item.rb +21 -0
- data/lib/nordlet/sales/types/invoices_view_sales_response_payment_status.rb +15 -0
- data/lib/nordlet/sales/types/invoices_view_sales_response_seller.rb +31 -0
- data/lib/nordlet/sales/types/invoices_view_sales_response_seller_address.rb +17 -0
- data/lib/nordlet/sales/types/invoices_view_sales_response_status.rb +14 -0
- data/lib/nordlet/sales/types/invoices_view_sales_response_type.rb +16 -0
- data/lib/nordlet/sales/types/payments_list_sales_request.rb +17 -0
- data/lib/nordlet/sales/types/payments_list_sales_response.rb +19 -0
- data/lib/nordlet/sales/types/payments_list_sales_response_rows_item.rb +27 -0
- data/lib/nordlet/sales/types/payments_list_sales_response_rows_item_method.rb +15 -0
- data/lib/nordlet/sales/types/recurring_invoices_create_sales_request_locale.rb +29 -0
- data/lib/nordlet/sales/types/recurring_invoices_update_sales_request_locale.rb +29 -0
- data/lib/nordlet/version.rb +1 -1
- data/lib/nordlet/webhooks/types/subscriptions_create_webhooks_request_events_item.rb +1 -0
- data/lib/nordlet/webhooks/types/subscriptions_update_webhooks_request_events_item.rb +1 -0
- data/lib/nordlet.rb +61 -0
- data/reference.md +1296 -365
- metadata +63 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Public
|
|
5
|
+
module Types
|
|
6
|
+
class InvoicesGetPublicResponseLinesItem < Internal::Types::Model
|
|
7
|
+
field :description, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :unit, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :quantity, -> { String }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :unit_price, -> { String }, optional: false, nullable: true, api_name: "unitPrice"
|
|
14
|
+
|
|
15
|
+
field :vat_rate_percent, -> { String }, optional: false, nullable: false, api_name: "vatRatePercent"
|
|
16
|
+
|
|
17
|
+
field :line_net, -> { String }, optional: false, nullable: false, api_name: "lineNet"
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Public
|
|
5
|
+
module Types
|
|
6
|
+
module InvoicesGetPublicResponsePaymentStatus
|
|
7
|
+
extend Nordlet::Internal::Types::Enum
|
|
8
|
+
|
|
9
|
+
UNPAID = "unpaid"
|
|
10
|
+
PARTIAL = "partial"
|
|
11
|
+
PAID = "paid"
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Public
|
|
5
|
+
module Types
|
|
6
|
+
class InvoicesGetPublicResponseSeller < Internal::Types::Model
|
|
7
|
+
field :name, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :vat_code, -> { String }, optional: false, nullable: true, api_name: "vatCode"
|
|
10
|
+
|
|
11
|
+
field :country_code, -> { String }, optional: false, nullable: true, api_name: "countryCode"
|
|
12
|
+
|
|
13
|
+
field :address, -> { Nordlet::Public::Types::InvoicesGetPublicResponseSellerAddress }, optional: false, nullable: false
|
|
14
|
+
|
|
15
|
+
field :email, -> { String }, optional: false, nullable: true
|
|
16
|
+
|
|
17
|
+
field :iban, -> { String }, optional: false, nullable: true
|
|
18
|
+
|
|
19
|
+
field :bank_name, -> { String }, optional: false, nullable: true, api_name: "bankName"
|
|
20
|
+
|
|
21
|
+
field :bank_bic, -> { String }, optional: false, nullable: true, api_name: "bankBic"
|
|
22
|
+
|
|
23
|
+
field :bank_code, -> { String }, optional: false, nullable: true, api_name: "bankCode"
|
|
24
|
+
|
|
25
|
+
field :bank_branch_code, -> { String }, optional: false, nullable: true, api_name: "bankBranchCode"
|
|
26
|
+
|
|
27
|
+
field :bank_account_number, -> { String }, optional: false, nullable: true, api_name: "bankAccountNumber"
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Public
|
|
5
|
+
module Types
|
|
6
|
+
class InvoicesGetPublicResponseSellerAddress < Internal::Types::Model
|
|
7
|
+
field :street, -> { String }, optional: false, nullable: true
|
|
8
|
+
|
|
9
|
+
field :city, -> { String }, optional: false, nullable: true
|
|
10
|
+
|
|
11
|
+
field :postal_code, -> { String }, optional: false, nullable: true, api_name: "postalCode"
|
|
12
|
+
|
|
13
|
+
field :country_code, -> { String }, optional: false, nullable: true, api_name: "countryCode"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Public
|
|
5
|
+
module Types
|
|
6
|
+
module InvoicesGetPublicResponseType
|
|
7
|
+
extend Nordlet::Internal::Types::Enum
|
|
8
|
+
|
|
9
|
+
INVOICE = "invoice"
|
|
10
|
+
CREDIT_NOTE = "credit_note"
|
|
11
|
+
PROFORMA = "proforma"
|
|
12
|
+
ADVANCE = "advance"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Public
|
|
5
|
+
module Types
|
|
6
|
+
class InvoicesPdfPublicResponse < Internal::Types::Model
|
|
7
|
+
field :file_name, -> { String }, optional: false, nullable: false, api_name: "fileName"
|
|
8
|
+
|
|
9
|
+
field :content_type, -> { String }, optional: false, nullable: false, api_name: "contentType"
|
|
10
|
+
|
|
11
|
+
field :data, -> { String }, optional: false, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
data/lib/nordlet/sales/client.rb
CHANGED
|
@@ -120,9 +120,48 @@ module Nordlet
|
|
|
120
120
|
end
|
|
121
121
|
end
|
|
122
122
|
|
|
123
|
+
# Return a sale document as its customer sees it: the seller as printed on it (the snapshot taken at issue, else
|
|
124
|
+
# the company), the buyer with address and e-mail, the lines, the totals, `paidOn` (the date of the latest payment
|
|
125
|
+
# once the document is paid), `payUrl` (as in `sales/invoices/payment-link`) and `token`, the document's customer
|
|
126
|
+
# token for `public/invoices/get` and `public/invoices/pdf`, created on first use; `token` is null on a draft.
|
|
127
|
+
#
|
|
128
|
+
# @param request_options [Hash]
|
|
129
|
+
# @param params [Nordlet::Sales::Types::InvoicesViewSalesRequest]
|
|
130
|
+
# @option request_options [String] :base_url
|
|
131
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
132
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
133
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
134
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
135
|
+
#
|
|
136
|
+
# @return [Nordlet::Sales::Types::InvoicesViewSalesResponse]
|
|
137
|
+
def invoices_view(request_options: {}, **params)
|
|
138
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
139
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
140
|
+
base_url: request_options[:base_url],
|
|
141
|
+
method: "POST",
|
|
142
|
+
path: "v1/sales/invoices/view",
|
|
143
|
+
body: Nordlet::Sales::Types::InvoicesViewSalesRequest.new(params).to_h,
|
|
144
|
+
request_options: request_options
|
|
145
|
+
)
|
|
146
|
+
begin
|
|
147
|
+
response = @client.send(request)
|
|
148
|
+
rescue Net::HTTPRequestTimeout
|
|
149
|
+
raise Nordlet::Errors::TimeoutError
|
|
150
|
+
end
|
|
151
|
+
code = response.code.to_i
|
|
152
|
+
if code.between?(200, 299)
|
|
153
|
+
Nordlet::Sales::Types::InvoicesViewSalesResponse.load(response.body)
|
|
154
|
+
else
|
|
155
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
156
|
+
raise error_class.new(response.body, code: code)
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
123
160
|
# E-mail an issued sale document as a PDF attachment to `to`, else to the partner's e-mail address, and emit
|
|
124
|
-
# `sale_invoice.sent`. The PDF is the one of `sales/invoices/pdf`.
|
|
125
|
-
#
|
|
161
|
+
# `sale_invoice.sent`. The PDF is the one of `sales/invoices/pdf`. With `quote: true` the document must be a
|
|
162
|
+
# draft: it is e-mailed as a quote (PDF titled quote, no payment link), stays a draft, and
|
|
163
|
+
# `sale_invoice.quote_sent` is emitted instead. Answers 422 when e-mail sending is not configured, when the
|
|
164
|
+
# document is not issued (or, with `quote`, not a draft), or when neither `to` nor the partner's e-mail is set.
|
|
126
165
|
#
|
|
127
166
|
# @param request_options [Hash]
|
|
128
167
|
# @param params [Nordlet::Sales::Types::InvoicesSendSalesRequest]
|
|
@@ -378,10 +417,11 @@ module Nordlet
|
|
|
378
417
|
end
|
|
379
418
|
end
|
|
380
419
|
|
|
381
|
-
# Change a draft sale document. Fields left out keep their value, `lines` replaces every line,
|
|
382
|
-
# `discountPercent` recomputes the existing lines
|
|
383
|
-
#
|
|
384
|
-
#
|
|
420
|
+
# Change a draft sale document. Fields left out keep their value, `lines` replaces every line, a changed
|
|
421
|
+
# `discountPercent` recomputes the existing lines, and `salesTaxPercent` (invoices only, null removes it)
|
|
422
|
+
# recomputes the sales tax and the total. Answers 409 when the document is issued or locked, and 422 under the
|
|
423
|
+
# checks of `sales/invoices/create` (the credited document's partner and currency, the OSS and IOSS country, VAT
|
|
424
|
+
# on the lines, the operation type and document series).
|
|
385
425
|
#
|
|
386
426
|
# @param request_options [Hash]
|
|
387
427
|
# @param params [Nordlet::Sales::Types::InvoicesUpdateSalesRequest]
|
|
@@ -563,9 +603,11 @@ module Nordlet
|
|
|
563
603
|
end
|
|
564
604
|
end
|
|
565
605
|
|
|
566
|
-
# Return the customer payment link of a sale document
|
|
567
|
-
# (`sales/invoices/
|
|
568
|
-
#
|
|
606
|
+
# Return the customer payment link of a sale document: the Stripe card payment page (`source` `stripe`) when the
|
|
607
|
+
# company's Stripe account is connected and can take charges (`sales/invoices/card-payments/get`), else the link
|
|
608
|
+
# rendered from the company's payment link template (`sales/invoices/payment-settings/update`, `source`
|
|
609
|
+
# `template`); `url` is null when the company has neither, the document is not issued or its `payLinkEnabled` is
|
|
610
|
+
# false. The document's payment token is created on first use. Answers 409 when the document is already paid.
|
|
569
611
|
#
|
|
570
612
|
# @param request_options [Hash]
|
|
571
613
|
# @param params [Nordlet::Sales::Types::InvoicesPaymentLinkSalesRequest]
|
|
@@ -1759,6 +1801,192 @@ module Nordlet
|
|
|
1759
1801
|
raise error_class.new(response.body, code: code)
|
|
1760
1802
|
end
|
|
1761
1803
|
end
|
|
1804
|
+
|
|
1805
|
+
# List the money received on sale documents between `from` and `to` (inclusive), oldest first: bank payments
|
|
1806
|
+
# matched to the document, card settlements of a payment provider and cash receipt orders. A reversed bank match
|
|
1807
|
+
# is a row with a negative amount on the date it was reversed. Credit notes, advances applied to a final invoice
|
|
1808
|
+
# and balances carried over by a migration are not money received and are left out. `amount` is in the document
|
|
1809
|
+
# currency; `method` is `card` for a settlement or a payment into a Stripe bank account, `cash` for a cash order
|
|
1810
|
+
# and `bank_transfer` otherwise.
|
|
1811
|
+
#
|
|
1812
|
+
# @param request_options [Hash]
|
|
1813
|
+
# @param params [Nordlet::Sales::Types::PaymentsListSalesRequest]
|
|
1814
|
+
# @option request_options [String] :base_url
|
|
1815
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1816
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1817
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1818
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1819
|
+
#
|
|
1820
|
+
# @return [Nordlet::Sales::Types::PaymentsListSalesResponse]
|
|
1821
|
+
def payments_list(request_options: {}, **params)
|
|
1822
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
1823
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
1824
|
+
base_url: request_options[:base_url],
|
|
1825
|
+
method: "POST",
|
|
1826
|
+
path: "v1/sales/payments/list",
|
|
1827
|
+
body: Nordlet::Sales::Types::PaymentsListSalesRequest.new(params).to_h,
|
|
1828
|
+
request_options: request_options
|
|
1829
|
+
)
|
|
1830
|
+
begin
|
|
1831
|
+
response = @client.send(request)
|
|
1832
|
+
rescue Net::HTTPRequestTimeout
|
|
1833
|
+
raise Nordlet::Errors::TimeoutError
|
|
1834
|
+
end
|
|
1835
|
+
code = response.code.to_i
|
|
1836
|
+
if code.between?(200, 299)
|
|
1837
|
+
Nordlet::Sales::Types::PaymentsListSalesResponse.load(response.body)
|
|
1838
|
+
else
|
|
1839
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
1840
|
+
raise error_class.new(response.body, code: code)
|
|
1841
|
+
end
|
|
1842
|
+
end
|
|
1843
|
+
|
|
1844
|
+
# Export one calendar month for the accountant as a single file: every invoice and credit note issued in the month
|
|
1845
|
+
# (number, dates, client, currency, net, VAT, total and the amount paid so far) and every payment received in the
|
|
1846
|
+
# month as listed by `sales/payments/list`. `format` is `csv` (comma separated, UTF-8, one section per table) or
|
|
1847
|
+
# `pdf`. `format` `nordlet` instead returns a JSON package that `migration/books/validate` and
|
|
1848
|
+
# `migration/books/import` accept: every posted journal transaction dated in the month with its debit and credit
|
|
1849
|
+
# lines, the accounts those lines use (with their parent accounts) and the partners of those transactions; its
|
|
1850
|
+
# cutoverDate is the day after the month ends. The file comes back base64-encoded in `data`.
|
|
1851
|
+
#
|
|
1852
|
+
# @param request_options [Hash]
|
|
1853
|
+
# @param params [Nordlet::Sales::Types::ExportsMonthSalesRequest]
|
|
1854
|
+
# @option request_options [String] :base_url
|
|
1855
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1856
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1857
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1858
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1859
|
+
#
|
|
1860
|
+
# @return [Nordlet::Sales::Types::ExportsMonthSalesResponse]
|
|
1861
|
+
def exports_month(request_options: {}, **params)
|
|
1862
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
1863
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
1864
|
+
base_url: request_options[:base_url],
|
|
1865
|
+
method: "POST",
|
|
1866
|
+
path: "v1/sales/exports/month",
|
|
1867
|
+
body: Nordlet::Sales::Types::ExportsMonthSalesRequest.new(params).to_h,
|
|
1868
|
+
request_options: request_options
|
|
1869
|
+
)
|
|
1870
|
+
begin
|
|
1871
|
+
response = @client.send(request)
|
|
1872
|
+
rescue Net::HTTPRequestTimeout
|
|
1873
|
+
raise Nordlet::Errors::TimeoutError
|
|
1874
|
+
end
|
|
1875
|
+
code = response.code.to_i
|
|
1876
|
+
if code.between?(200, 299)
|
|
1877
|
+
Nordlet::Sales::Types::ExportsMonthSalesResponse.load(response.body)
|
|
1878
|
+
else
|
|
1879
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
1880
|
+
raise error_class.new(response.body, code: code)
|
|
1881
|
+
end
|
|
1882
|
+
end
|
|
1883
|
+
|
|
1884
|
+
# Return whether the company's Stripe account is connected for card payments and whether Stripe lets it take
|
|
1885
|
+
# charges yet. While the account is connected but cannot take charges, Stripe is asked again on each call. When
|
|
1886
|
+
# `chargesEnabled` is true, payment links of issued invoices open a Stripe Checkout page on that account.
|
|
1887
|
+
#
|
|
1888
|
+
# @param request_options [Hash]
|
|
1889
|
+
# @param params [Nordlet::Sales::Types::InvoicesCardPaymentsGetSalesRequest]
|
|
1890
|
+
# @option request_options [String] :base_url
|
|
1891
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1892
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1893
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1894
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1895
|
+
#
|
|
1896
|
+
# @return [Nordlet::Sales::Types::InvoicesCardPaymentsGetSalesResponse]
|
|
1897
|
+
def invoices_card_payments_get(request_options: {}, **params)
|
|
1898
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
1899
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
1900
|
+
base_url: request_options[:base_url],
|
|
1901
|
+
method: "POST",
|
|
1902
|
+
path: "v1/sales/invoices/card-payments/get",
|
|
1903
|
+
body: Nordlet::Sales::Types::InvoicesCardPaymentsGetSalesRequest.new(params).to_h,
|
|
1904
|
+
request_options: request_options
|
|
1905
|
+
)
|
|
1906
|
+
begin
|
|
1907
|
+
response = @client.send(request)
|
|
1908
|
+
rescue Net::HTTPRequestTimeout
|
|
1909
|
+
raise Nordlet::Errors::TimeoutError
|
|
1910
|
+
end
|
|
1911
|
+
code = response.code.to_i
|
|
1912
|
+
if code.between?(200, 299)
|
|
1913
|
+
Nordlet::Sales::Types::InvoicesCardPaymentsGetSalesResponse.load(response.body)
|
|
1914
|
+
else
|
|
1915
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
1916
|
+
raise error_class.new(response.body, code: code)
|
|
1917
|
+
end
|
|
1918
|
+
end
|
|
1919
|
+
|
|
1920
|
+
# Start or continue connecting the company's own Stripe account for card payments: creates the Stripe account on
|
|
1921
|
+
# first use and returns the Stripe-hosted onboarding `url`. Stripe sends the user back to `returnUrl` when
|
|
1922
|
+
# onboarding ends and to `refreshUrl` when the link has expired. Answers 503 when Stripe is not configured.
|
|
1923
|
+
#
|
|
1924
|
+
# @param request_options [Hash]
|
|
1925
|
+
# @param params [Nordlet::Sales::Types::InvoicesCardPaymentsConnectSalesRequest]
|
|
1926
|
+
# @option request_options [String] :base_url
|
|
1927
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1928
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1929
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1930
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1931
|
+
#
|
|
1932
|
+
# @return [Nordlet::Sales::Types::InvoicesCardPaymentsConnectSalesResponse]
|
|
1933
|
+
def invoices_card_payments_connect(request_options: {}, **params)
|
|
1934
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
1935
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
1936
|
+
base_url: request_options[:base_url],
|
|
1937
|
+
method: "POST",
|
|
1938
|
+
path: "v1/sales/invoices/card-payments/connect",
|
|
1939
|
+
body: Nordlet::Sales::Types::InvoicesCardPaymentsConnectSalesRequest.new(params).to_h,
|
|
1940
|
+
request_options: request_options
|
|
1941
|
+
)
|
|
1942
|
+
begin
|
|
1943
|
+
response = @client.send(request)
|
|
1944
|
+
rescue Net::HTTPRequestTimeout
|
|
1945
|
+
raise Nordlet::Errors::TimeoutError
|
|
1946
|
+
end
|
|
1947
|
+
code = response.code.to_i
|
|
1948
|
+
if code.between?(200, 299)
|
|
1949
|
+
Nordlet::Sales::Types::InvoicesCardPaymentsConnectSalesResponse.load(response.body)
|
|
1950
|
+
else
|
|
1951
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
1952
|
+
raise error_class.new(response.body, code: code)
|
|
1953
|
+
end
|
|
1954
|
+
end
|
|
1955
|
+
|
|
1956
|
+
# Disconnect the company's Stripe account: payment links fall back to the payment link template. The Stripe
|
|
1957
|
+
# account itself is left as it is.
|
|
1958
|
+
#
|
|
1959
|
+
# @param request_options [Hash]
|
|
1960
|
+
# @param params [Nordlet::Sales::Types::InvoicesCardPaymentsDisconnectSalesRequest]
|
|
1961
|
+
# @option request_options [String] :base_url
|
|
1962
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1963
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1964
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1965
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1966
|
+
#
|
|
1967
|
+
# @return [Nordlet::Sales::Types::InvoicesCardPaymentsDisconnectSalesResponse]
|
|
1968
|
+
def invoices_card_payments_disconnect(request_options: {}, **params)
|
|
1969
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
1970
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
1971
|
+
base_url: request_options[:base_url],
|
|
1972
|
+
method: "POST",
|
|
1973
|
+
path: "v1/sales/invoices/card-payments/disconnect",
|
|
1974
|
+
body: Nordlet::Sales::Types::InvoicesCardPaymentsDisconnectSalesRequest.new(params).to_h,
|
|
1975
|
+
request_options: request_options
|
|
1976
|
+
)
|
|
1977
|
+
begin
|
|
1978
|
+
response = @client.send(request)
|
|
1979
|
+
rescue Net::HTTPRequestTimeout
|
|
1980
|
+
raise Nordlet::Errors::TimeoutError
|
|
1981
|
+
end
|
|
1982
|
+
code = response.code.to_i
|
|
1983
|
+
if code.between?(200, 299)
|
|
1984
|
+
Nordlet::Sales::Types::InvoicesCardPaymentsDisconnectSalesResponse.load(response.body)
|
|
1985
|
+
else
|
|
1986
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
1987
|
+
raise error_class.new(response.body, code: code)
|
|
1988
|
+
end
|
|
1989
|
+
end
|
|
1762
1990
|
end
|
|
1763
1991
|
end
|
|
1764
1992
|
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Sales
|
|
5
|
+
module Types
|
|
6
|
+
class ExportsMonthSalesRequest < Internal::Types::Model
|
|
7
|
+
field :month, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :format, -> { Nordlet::Sales::Types::ExportsMonthSalesRequestFormat }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Sales
|
|
5
|
+
module Types
|
|
6
|
+
class ExportsMonthSalesResponse < Internal::Types::Model
|
|
7
|
+
field :file_name, -> { String }, optional: false, nullable: false, api_name: "fileName"
|
|
8
|
+
|
|
9
|
+
field :content_type, -> { String }, optional: false, nullable: false, api_name: "contentType"
|
|
10
|
+
|
|
11
|
+
field :data, -> { String }, optional: false, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -34,6 +34,10 @@ module Nordlet
|
|
|
34
34
|
|
|
35
35
|
field :gross_total, -> { String }, optional: false, nullable: false, api_name: "grossTotal"
|
|
36
36
|
|
|
37
|
+
field :sales_tax_percent, -> { String }, optional: false, nullable: true, api_name: "salesTaxPercent"
|
|
38
|
+
|
|
39
|
+
field :sales_tax_total, -> { String }, optional: false, nullable: false, api_name: "salesTaxTotal"
|
|
40
|
+
|
|
37
41
|
field :paid_amount, -> { String }, optional: false, nullable: false, api_name: "paidAmount"
|
|
38
42
|
|
|
39
43
|
field :journal_transaction_id, -> { String }, optional: false, nullable: true, api_name: "journalTransactionId"
|
|
@@ -94,6 +98,10 @@ module Nordlet
|
|
|
94
98
|
|
|
95
99
|
field :pay_token, -> { String }, optional: false, nullable: true, api_name: "payToken"
|
|
96
100
|
|
|
101
|
+
field :pay_link_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "payLinkEnabled"
|
|
102
|
+
|
|
103
|
+
field :debt_reminders_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "debtRemindersEnabled"
|
|
104
|
+
|
|
97
105
|
field :einvoice_system, -> { String }, optional: false, nullable: true, api_name: "einvoiceSystem"
|
|
98
106
|
|
|
99
107
|
field :einvoice_transport, -> { String }, optional: false, nullable: true, api_name: "einvoiceTransport"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Sales
|
|
5
|
+
module Types
|
|
6
|
+
class InvoicesCardPaymentsConnectSalesRequest < Internal::Types::Model
|
|
7
|
+
field :return_url, -> { String }, optional: false, nullable: false, api_name: "returnUrl"
|
|
8
|
+
|
|
9
|
+
field :refresh_url, -> { String }, optional: false, nullable: false, api_name: "refreshUrl"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Sales
|
|
5
|
+
module Types
|
|
6
|
+
class InvoicesCardPaymentsDisconnectSalesResponse < Internal::Types::Model
|
|
7
|
+
field :connected, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :charges_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "chargesEnabled"
|
|
10
|
+
|
|
11
|
+
field :account_id, -> { String }, optional: false, nullable: true, api_name: "accountId"
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Sales
|
|
5
|
+
module Types
|
|
6
|
+
class InvoicesCardPaymentsGetSalesResponse < Internal::Types::Model
|
|
7
|
+
field :connected, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :charges_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "chargesEnabled"
|
|
10
|
+
|
|
11
|
+
field :account_id, -> { String }, optional: false, nullable: true, api_name: "accountId"
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -42,6 +42,10 @@ module Nordlet
|
|
|
42
42
|
|
|
43
43
|
field :locale, -> { Nordlet::Sales::Types::InvoicesCreateSalesRequestLocale }, optional: true, nullable: false
|
|
44
44
|
|
|
45
|
+
field :pay_link_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "payLinkEnabled"
|
|
46
|
+
|
|
47
|
+
field :debt_reminders_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "debtRemindersEnabled"
|
|
48
|
+
|
|
45
49
|
field :operation_type_id, -> { String }, optional: true, nullable: false, api_name: "operationTypeId"
|
|
46
50
|
|
|
47
51
|
field :document_series_id, -> { String }, optional: true, nullable: false, api_name: "documentSeriesId"
|
|
@@ -60,6 +64,8 @@ module Nordlet
|
|
|
60
64
|
|
|
61
65
|
field :discount_percent, -> { String }, optional: true, nullable: false, api_name: "discountPercent"
|
|
62
66
|
|
|
67
|
+
field :sales_tax_percent, -> { String }, optional: true, nullable: false, api_name: "salesTaxPercent"
|
|
68
|
+
|
|
63
69
|
field :lines, -> { Internal::Types::Array[Nordlet::Sales::Types::InvoicesCreateSalesRequestLinesItem] }, optional: false, nullable: false
|
|
64
70
|
end
|
|
65
71
|
end
|
|
@@ -9,6 +9,35 @@ module Nordlet
|
|
|
9
9
|
EN = "en"
|
|
10
10
|
LT = "lt"
|
|
11
11
|
DE = "de"
|
|
12
|
+
FR = "fr"
|
|
13
|
+
ES = "es"
|
|
14
|
+
IT = "it"
|
|
15
|
+
PT = "pt"
|
|
16
|
+
NL = "nl"
|
|
17
|
+
PL = "pl"
|
|
18
|
+
SV = "sv"
|
|
19
|
+
DA = "da"
|
|
20
|
+
NO = "no"
|
|
21
|
+
FI = "fi"
|
|
22
|
+
ET = "et"
|
|
23
|
+
LV = "lv"
|
|
24
|
+
CS = "cs"
|
|
25
|
+
SK = "sk"
|
|
26
|
+
HU = "hu"
|
|
27
|
+
RO = "ro"
|
|
28
|
+
BG = "bg"
|
|
29
|
+
HR = "hr"
|
|
30
|
+
SL = "sl"
|
|
31
|
+
EL = "el"
|
|
32
|
+
MT = "mt"
|
|
33
|
+
IS = "is"
|
|
34
|
+
GA = "ga"
|
|
35
|
+
ZH = "zh"
|
|
36
|
+
JA = "ja"
|
|
37
|
+
AR = "ar"
|
|
38
|
+
HI = "hi"
|
|
39
|
+
RU = "ru"
|
|
40
|
+
TR = "tr"
|
|
12
41
|
end
|
|
13
42
|
end
|
|
14
43
|
end
|
|
@@ -34,6 +34,10 @@ module Nordlet
|
|
|
34
34
|
|
|
35
35
|
field :gross_total, -> { String }, optional: false, nullable: false, api_name: "grossTotal"
|
|
36
36
|
|
|
37
|
+
field :sales_tax_percent, -> { String }, optional: false, nullable: true, api_name: "salesTaxPercent"
|
|
38
|
+
|
|
39
|
+
field :sales_tax_total, -> { String }, optional: false, nullable: false, api_name: "salesTaxTotal"
|
|
40
|
+
|
|
37
41
|
field :paid_amount, -> { String }, optional: false, nullable: false, api_name: "paidAmount"
|
|
38
42
|
|
|
39
43
|
field :journal_transaction_id, -> { String }, optional: false, nullable: true, api_name: "journalTransactionId"
|
|
@@ -94,6 +98,10 @@ module Nordlet
|
|
|
94
98
|
|
|
95
99
|
field :pay_token, -> { String }, optional: false, nullable: true, api_name: "payToken"
|
|
96
100
|
|
|
101
|
+
field :pay_link_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "payLinkEnabled"
|
|
102
|
+
|
|
103
|
+
field :debt_reminders_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "debtRemindersEnabled"
|
|
104
|
+
|
|
97
105
|
field :einvoice_system, -> { String }, optional: false, nullable: true, api_name: "einvoiceSystem"
|
|
98
106
|
|
|
99
107
|
field :einvoice_transport, -> { String }, optional: false, nullable: true, api_name: "einvoiceTransport"
|