nordlet 0.6.5 → 0.6.6

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nordlet/account/client.rb +41 -1
  3. data/lib/nordlet/account/types/companies_convert_to_live_account_request.rb +11 -0
  4. data/lib/nordlet/account/types/companies_convert_to_live_account_response.rb +13 -0
  5. data/lib/nordlet/account/types/me_account_response_billing.rb +2 -0
  6. data/lib/nordlet/billing/client.rb +47 -8
  7. data/lib/nordlet/billing/types/account_get_billing_response.rb +2 -0
  8. data/lib/nordlet/billing/types/account_set_account_type_billing_response.rb +2 -0
  9. data/lib/nordlet/billing/types/account_set_auto_top_up_billing_response.rb +2 -0
  10. data/lib/nordlet/billing/types/account_set_overdraft_cap_billing_response.rb +2 -0
  11. data/lib/nordlet/billing/types/account_set_plan_billing_response.rb +2 -0
  12. data/lib/nordlet/billing/types/flat_rate_confirm_billing_response.rb +2 -0
  13. data/lib/nordlet/billing/types/flat_rate_create_billing_request.rb +2 -0
  14. data/lib/nordlet/billing/types/free_sandbox_start_billing_request.rb +9 -0
  15. data/lib/nordlet/billing/types/free_sandbox_start_billing_response.rb +55 -0
  16. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_account_type.rb +14 -0
  17. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_auto_top_up.rb +15 -0
  18. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_month_to_date.rb +27 -0
  19. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_plan.rb +16 -0
  20. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_plans_value.rb +19 -0
  21. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_site.rb +14 -0
  22. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_status.rb +15 -0
  23. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_top_up.rb +13 -0
  24. data/lib/nordlet/billing/types/subscription_cancel_billing_response.rb +2 -0
  25. data/lib/nordlet/billing/types/topup_confirm_billing_response.rb +2 -0
  26. data/lib/nordlet/billing/types/topup_create_billing_request.rb +2 -0
  27. data/lib/nordlet/version.rb +1 -1
  28. data/lib/nordlet.rb +12 -0
  29. data/reference.md +136 -4
  30. metadata +14 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3eb06f95a095c09229898cf71175e3cdc73b61072d6c4c790a25a39bd085f8c
4
- data.tar.gz: 0bada22e90026192c0445db1837e436d652a58da5a6c1dc69e5f2e07db9184dd
3
+ metadata.gz: eedd5efc8df32359e54a246907c9a3b325d2e9dffa7d452b9752c9eb8f745274
4
+ data.tar.gz: 835276e28ec2eb23311f6f7d0ea94e2e6b3a5eff234ef55336d725b2a2dd87e4
5
5
  SHA512:
6
- metadata.gz: a95d1939c1e2fc13246107e919016ea570d78e3ee3bd49117246090fd811dd10afdc946c45d2191f3bca655e0d334d1daed01fdf769c22b8d6167c3b9d4a6fdc
7
- data.tar.gz: 5777cd07f820ab3fb8b3ffe70c9e57158d599e43bcb6c56c73fb9a164ffe0659eb980299a2d5fe36f907fe1049d4d84ccac8deca55256dcb6011ffaff4cea0dc
6
+ metadata.gz: d449387fa1acf0a830054dde08f75fca36b31437c95786111823e0af5a5b61be6e75e3a690af72c36291824ef898774df9be3e45ce8e4adf22f3de7a4966a764
7
+ data.tar.gz: e2b7200ef78d6055fc2b4f6a4e7f878b28b53bf0e4fc44dda77ed70f4905668d58fd14c82141eac4bdb13bd2210585f1ba7546a5d1d89179bc6f7f6be0ee6e02
@@ -522,7 +522,9 @@ module Nordlet
522
522
 
523
523
  # Create a company with the caller as its owner and payer, seed its chart of accounts from the template of
524
524
  # `countryCode`, and make it the active company of the session. `timeZone` defaults to the country's, `isVatPayer`
525
- # to true and `defaultInvoiceCurrency` to the base currency. Refused with 422 when `baseCurrency` is not a
525
+ # to true and `defaultInvoiceCurrency` to the base currency. Without a paid plan the caller may create only one
526
+ # sandbox company, which starts the free sandbox plan; a live company, a second sandbox company, or a sandbox
527
+ # company after the free sandbox has ended is refused with 402. Refused with 422 when `baseCurrency` is not a
526
528
  # supported currency.
527
529
  #
528
530
  # @param request_options [Hash]
@@ -736,6 +738,44 @@ module Nordlet
736
738
  end
737
739
  end
738
740
 
741
+ # Turn the sandbox company `companyId` into a live company and keep all of its data: from then on its filings go
742
+ # to the authorities' production systems and a delete is no longer purged at once. The caller must be the
743
+ # company's owner and payer and have a paid plan (a flat-rate subscription or per-request billing). Refused with
744
+ # 403 when the caller is not the owner or not the payer, 409 when the company is not a sandbox company and 402
745
+ # when the caller has no paid plan.
746
+ #
747
+ # @param request_options [Hash]
748
+ # @param params [Nordlet::Account::Types::CompaniesConvertToLiveAccountRequest]
749
+ # @option request_options [String] :base_url
750
+ # @option request_options [Hash{String => Object}] :additional_headers
751
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
752
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
753
+ # @option request_options [Integer] :timeout_in_seconds
754
+ #
755
+ # @return [Nordlet::Account::Types::CompaniesConvertToLiveAccountResponse]
756
+ def companies_convert_to_live(request_options: {}, **params)
757
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
758
+ request = Nordlet::Internal::JSON::Request.new(
759
+ base_url: request_options[:base_url],
760
+ method: "POST",
761
+ path: "v1/account/companies/convert-to-live",
762
+ body: Nordlet::Account::Types::CompaniesConvertToLiveAccountRequest.new(params).to_h,
763
+ request_options: request_options
764
+ )
765
+ begin
766
+ response = @client.send(request)
767
+ rescue Net::HTTPRequestTimeout
768
+ raise Nordlet::Errors::TimeoutError
769
+ end
770
+ code = response.code.to_i
771
+ if code.between?(200, 299)
772
+ Nordlet::Account::Types::CompaniesConvertToLiveAccountResponse.load(response.body)
773
+ else
774
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
775
+ raise error_class.new(response.body, code: code)
776
+ end
777
+ end
778
+
739
779
  # Set an archived or deleted company named by `companyId` back to `active`; the caller must be its owner. Refused
740
780
  # with 409 when it is already active.
741
781
  #
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class CompaniesConvertToLiveAccountRequest < Internal::Types::Model
7
+ field :company_id, -> { String }, optional: false, nullable: false, api_name: "companyId"
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class CompaniesConvertToLiveAccountResponse < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :is_sandbox, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isSandbox"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -22,6 +22,8 @@ module Nordlet
22
22
 
23
23
  field :plan_chosen, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "planChosen"
24
24
 
25
+ field :free_sandbox, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "freeSandbox"
26
+
25
27
  field :flat_rate, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "flatRate"
26
28
 
27
29
  field :account_type, -> { Nordlet::Account::Types::MeAccountResponseBillingAccountType }, optional: false, nullable: false, api_name: "accountType"
@@ -198,8 +198,9 @@ module Nordlet
198
198
 
199
199
  # Open a Stripe Checkout session for a one-time credit top-up of `amountCents` and return its URL; a Stripe
200
200
  # customer is created for the user when there is none. `returnTo` chooses whether Checkout returns to the credits
201
- # page or to the onboarding plan page, in `locale`. Answers 409 on a site without top-ups and 503 when online
202
- # payments are not configured.
201
+ # page or to the onboarding plan page, in `locale`; with `convertCompanyId` it returns to the onboarding plan
202
+ # page, which then converts that sandbox company to a live company. Answers 409 on a site without top-ups and 503
203
+ # when online payments are not configured.
203
204
  #
204
205
  # @param request_options [Hash]
205
206
  # @param params [Nordlet::Billing::Types::TopupCreateBillingRequest]
@@ -269,13 +270,51 @@ module Nordlet
269
270
  end
270
271
  end
271
272
 
273
+ # Start the free sandbox plan of the caller's `app` billing account: one sandbox company, free for 14 days from
274
+ # now, without a payment. A free sandbox that is already running keeps its end date. After `trialEndsAt` the
275
+ # sandbox company answers 402 until a paid plan is chosen. Answers 409 on the `invoice` site, when a paid plan is
276
+ # already active, and when the free sandbox of this account has already ended.
277
+ #
278
+ # @param request_options [Hash]
279
+ # @param params [Nordlet::Billing::Types::FreeSandboxStartBillingRequest]
280
+ # @option request_options [String] :base_url
281
+ # @option request_options [Hash{String => Object}] :additional_headers
282
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
283
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
284
+ # @option request_options [Integer] :timeout_in_seconds
285
+ #
286
+ # @return [Nordlet::Billing::Types::FreeSandboxStartBillingResponse]
287
+ def free_sandbox_start(request_options: {}, **params)
288
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
289
+ request = Nordlet::Internal::JSON::Request.new(
290
+ base_url: request_options[:base_url],
291
+ method: "POST",
292
+ path: "v1/billing/free-sandbox/start",
293
+ body: Nordlet::Billing::Types::FreeSandboxStartBillingRequest.new(params).to_h,
294
+ request_options: request_options
295
+ )
296
+ begin
297
+ response = @client.send(request)
298
+ rescue Net::HTTPRequestTimeout
299
+ raise Nordlet::Errors::TimeoutError
300
+ end
301
+ code = response.code.to_i
302
+ if code.between?(200, 299)
303
+ Nordlet::Billing::Types::FreeSandboxStartBillingResponse.load(response.body)
304
+ else
305
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
306
+ raise error_class.new(response.body, code: code)
307
+ end
308
+ end
309
+
272
310
  # Open a Stripe Checkout session for a flat-rate subscription on `plan` (by default the first plan of the
273
- # request's site) for the billing account of the request's site, with the trial period of `trialDays` days, and
274
- # return its URL; a Stripe customer is created for that account when it has none. The `invoicing` plan of the
275
- # `invoice` site takes its trial days from the server setting `INVOICE_PLAN_TRIAL_DAYS` and returns to the invoice
276
- # app. Answers 422 when the plan is not one of the site's plans, 409 when the site's flat-rate subscription is
277
- # already active and 503 when online payments are not configured, the plan has no price, or the Invoicing trial is
278
- # not set.
311
+ # request's site) for the billing account of the request's site and return its URL; a Stripe customer is created
312
+ # for that account when it has none. The plans of the `app` site have no trial period: the first month is charged
313
+ # at checkout. The `invoicing` plan of the `invoice` site takes its trial days from the server setting
314
+ # `INVOICE_PLAN_TRIAL_DAYS` and returns to the invoice app. With `convertCompanyId` Checkout returns to the
315
+ # onboarding plan page, which then converts that sandbox company to a live company. Answers 422 when the plan is
316
+ # not one of the site's plans, 409 when the site's flat-rate subscription is already active and 503 when online
317
+ # payments are not configured, the plan has no price, or the Invoicing trial is not set.
279
318
  #
280
319
  # @param request_options [Hash]
281
320
  # @param params [Nordlet::Billing::Types::FlatRateCreateBillingRequest]
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -7,6 +7,8 @@ module Nordlet
7
7
  field :locale, -> { Nordlet::Billing::Types::FlatRateCreateBillingRequestLocale }, optional: true, nullable: false
8
8
 
9
9
  field :plan, -> { Nordlet::Billing::Types::FlatRateCreateBillingRequestPlan }, optional: true, nullable: false
10
+
11
+ field :convert_company_id, -> { String }, optional: true, nullable: false, api_name: "convertCompanyId"
10
12
  end
11
13
  end
12
14
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingRequest < Internal::Types::Model; end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingResponse < Internal::Types::Model
7
+ field :site, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseSite }, optional: false, nullable: false
8
+
9
+ field :plan, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponsePlan }, optional: false, nullable: false
10
+
11
+ field :account_type, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseAccountType }, optional: false, nullable: false, api_name: "accountType"
12
+
13
+ field :status, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseStatus }, optional: false, nullable: false
14
+
15
+ field :balance_cents, -> { Integer }, optional: false, nullable: false, api_name: "balanceCents"
16
+
17
+ field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
+
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
21
+ field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
22
+
23
+ field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
24
+
25
+ field :payments_configured, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "paymentsConfigured"
26
+
27
+ field :has_payment_account, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "hasPaymentAccount"
28
+
29
+ field :has_subscription, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "hasSubscription"
30
+
31
+ field :subscription_cancel_at, -> { String }, optional: false, nullable: true, api_name: "subscriptionCancelAt"
32
+
33
+ field :payment_failed_at, -> { String }, optional: false, nullable: true, api_name: "paymentFailedAt"
34
+
35
+ field :payment_failed_invoice_url, -> { String }, optional: false, nullable: true, api_name: "paymentFailedInvoiceUrl"
36
+
37
+ field :month_to_date, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseMonthToDate }, optional: false, nullable: false, api_name: "monthToDate"
38
+
39
+ field :plans, -> { Internal::Types::Hash[String, Nordlet::Billing::Types::FreeSandboxStartBillingResponsePlansValue] }, optional: false, nullable: false
40
+
41
+ field :api_request_eur, -> { String }, optional: false, nullable: false, api_name: "apiRequestEur"
42
+
43
+ field :top_up, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseTopUp }, optional: false, nullable: false, api_name: "topUp"
44
+
45
+ field :auto_top_up, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseAutoTopUp }, optional: false, nullable: false, api_name: "autoTopUp"
46
+
47
+ field :overdraft_cap_cents, -> { Integer }, optional: false, nullable: false, api_name: "overdraftCapCents"
48
+
49
+ field :overdraft_cap_max_cents, -> { Integer }, optional: false, nullable: false, api_name: "overdraftCapMaxCents"
50
+
51
+ field :trial_days, -> { Integer }, optional: false, nullable: false, api_name: "trialDays"
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ module FreeSandboxStartBillingResponseAccountType
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ FLAT_RATE = "flat_rate"
10
+ PER_REQUEST = "per_request"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingResponseAutoTopUp < Internal::Types::Model
7
+ field :enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
8
+
9
+ field :amount_cents, -> { Integer }, optional: false, nullable: false, api_name: "amountCents"
10
+
11
+ field :pending, -> { Internal::Types::Boolean }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingResponseMonthToDate < Internal::Types::Model
7
+ field :from, -> { String }, optional: false, nullable: false
8
+
9
+ field :to, -> { String }, optional: false, nullable: false
10
+
11
+ field :api_requests, -> { Integer }, optional: false, nullable: false, api_name: "apiRequests"
12
+
13
+ field :sale_invoices, -> { Integer }, optional: false, nullable: false, api_name: "saleInvoices"
14
+
15
+ field :ocr_pages, -> { Integer }, optional: false, nullable: false, api_name: "ocrPages"
16
+
17
+ field :file_bytes, -> { Integer }, optional: false, nullable: false, api_name: "fileBytes"
18
+
19
+ field :database_bytes, -> { Integer }, optional: false, nullable: false, api_name: "databaseBytes"
20
+
21
+ field :archived_companies, -> { Integer }, optional: false, nullable: false, api_name: "archivedCompanies"
22
+
23
+ field :estimated_today_cents, -> { Integer }, optional: false, nullable: false, api_name: "estimatedTodayCents"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ module FreeSandboxStartBillingResponsePlan
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ STARTER = "starter"
10
+ BUSINESS = "business"
11
+ SCALE = "scale"
12
+ INVOICING = "invoicing"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingResponsePlansValue < Internal::Types::Model
7
+ field :monthly_fee_eur, -> { String }, optional: false, nullable: false, api_name: "monthlyFeeEur"
8
+
9
+ field :included_invoices, -> { Integer }, optional: false, nullable: false, api_name: "includedInvoices"
10
+
11
+ field :invoice_overage_eur, -> { String }, optional: false, nullable: false, api_name: "invoiceOverageEur"
12
+
13
+ field :included_database_bytes, -> { Integer }, optional: false, nullable: false, api_name: "includedDatabaseBytes"
14
+
15
+ field :included_file_bytes, -> { Integer }, optional: false, nullable: false, api_name: "includedFileBytes"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ module FreeSandboxStartBillingResponseSite
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ APP = "app"
10
+ INVOICE = "invoice"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ module FreeSandboxStartBillingResponseStatus
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ TRIAL = "trial"
10
+ ACTIVE = "active"
11
+ SUSPENDED = "suspended"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingResponseTopUp < Internal::Types::Model
7
+ field :min_cents, -> { Integer }, optional: false, nullable: false, api_name: "minCents"
8
+
9
+ field :max_cents, -> { Integer }, optional: false, nullable: false, api_name: "maxCents"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -9,6 +9,8 @@ module Nordlet
9
9
  field :locale, -> { Nordlet::Billing::Types::TopupCreateBillingRequestLocale }, optional: true, nullable: false
10
10
 
11
11
  field :return_to, -> { Nordlet::Billing::Types::TopupCreateBillingRequestReturnTo }, optional: true, nullable: false, api_name: "returnTo"
12
+
13
+ field :convert_company_id, -> { String }, optional: true, nullable: false, api_name: "convertCompanyId"
12
14
  end
13
15
  end
14
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nordlet
4
- VERSION = "0.6.5"
4
+ VERSION = "0.6.6"
5
5
  end
data/lib/nordlet.rb CHANGED
@@ -2782,6 +2782,15 @@ require_relative "nordlet/billing/types/topup_confirm_billing_response_plans_val
2782
2782
  require_relative "nordlet/billing/types/topup_confirm_billing_response_top_up"
2783
2783
  require_relative "nordlet/billing/types/topup_confirm_billing_response_auto_top_up"
2784
2784
  require_relative "nordlet/billing/types/topup_confirm_billing_response"
2785
+ require_relative "nordlet/billing/types/free_sandbox_start_billing_response_site"
2786
+ require_relative "nordlet/billing/types/free_sandbox_start_billing_response_plan"
2787
+ require_relative "nordlet/billing/types/free_sandbox_start_billing_response_account_type"
2788
+ require_relative "nordlet/billing/types/free_sandbox_start_billing_response_status"
2789
+ require_relative "nordlet/billing/types/free_sandbox_start_billing_response_month_to_date"
2790
+ require_relative "nordlet/billing/types/free_sandbox_start_billing_response_plans_value"
2791
+ require_relative "nordlet/billing/types/free_sandbox_start_billing_response_top_up"
2792
+ require_relative "nordlet/billing/types/free_sandbox_start_billing_response_auto_top_up"
2793
+ require_relative "nordlet/billing/types/free_sandbox_start_billing_response"
2785
2794
  require_relative "nordlet/billing/types/flat_rate_create_billing_request_locale"
2786
2795
  require_relative "nordlet/billing/types/flat_rate_create_billing_request_plan"
2787
2796
  require_relative "nordlet/billing/types/flat_rate_create_billing_response"
@@ -2869,6 +2878,7 @@ require_relative "nordlet/account/types/companies_update_account_response_vat_pe
2869
2878
  require_relative "nordlet/account/types/companies_update_account_response"
2870
2879
  require_relative "nordlet/account/types/companies_archive_account_response"
2871
2880
  require_relative "nordlet/account/types/companies_delete_account_response"
2881
+ require_relative "nordlet/account/types/companies_convert_to_live_account_response"
2872
2882
  require_relative "nordlet/account/types/companies_activate_account_response"
2873
2883
  require_relative "nordlet/account/types/api_keys_create_account_response"
2874
2884
  require_relative "nordlet/account/types/api_keys_list_account_response_rows_item"
@@ -3607,6 +3617,7 @@ require_relative "nordlet/billing/types/account_set_auto_top_up_billing_request"
3607
3617
  require_relative "nordlet/billing/types/account_set_overdraft_cap_billing_request"
3608
3618
  require_relative "nordlet/billing/types/topup_create_billing_request"
3609
3619
  require_relative "nordlet/billing/types/topup_confirm_billing_request"
3620
+ require_relative "nordlet/billing/types/free_sandbox_start_billing_request"
3610
3621
  require_relative "nordlet/billing/types/flat_rate_create_billing_request"
3611
3622
  require_relative "nordlet/billing/types/flat_rate_confirm_billing_request"
3612
3623
  require_relative "nordlet/billing/types/subscription_cancel_billing_request"
@@ -3634,6 +3645,7 @@ require_relative "nordlet/account/types/companies_profile_account_request"
3634
3645
  require_relative "nordlet/account/types/companies_update_account_request"
3635
3646
  require_relative "nordlet/account/types/companies_archive_account_request"
3636
3647
  require_relative "nordlet/account/types/companies_delete_account_request"
3648
+ require_relative "nordlet/account/types/companies_convert_to_live_account_request"
3637
3649
  require_relative "nordlet/account/types/companies_activate_account_request"
3638
3650
  require_relative "nordlet/account/types/api_keys_create_account_request"
3639
3651
  require_relative "nordlet/account/types/api_keys_list_account_request"
data/reference.md CHANGED
@@ -56415,7 +56415,7 @@ client.billing.account_set_overdraft_cap(cap_cents: 1000000)
56415
56415
  <dl>
56416
56416
  <dd>
56417
56417
 
56418
- Open a Stripe Checkout session for a one-time credit top-up of `amountCents` and return its URL; a Stripe customer is created for the user when there is none. `returnTo` chooses whether Checkout returns to the credits page or to the onboarding plan page, in `locale`. Answers 409 on a site without top-ups and 503 when online payments are not configured.
56418
+ Open a Stripe Checkout session for a one-time credit top-up of `amountCents` and return its URL; a Stripe customer is created for the user when there is none. `returnTo` chooses whether Checkout returns to the credits page or to the onboarding plan page, in `locale`; with `convertCompanyId` it returns to the onboarding plan page, which then converts that sandbox company to a live company. Answers 409 on a site without top-ups and 503 when online payments are not configured.
56419
56419
  </dd>
56420
56420
  </dl>
56421
56421
  </dd>
@@ -56469,6 +56469,14 @@ client.billing.topup_create(amount_cents: 1000000)
56469
56469
  <dl>
56470
56470
  <dd>
56471
56471
 
56472
+ **convert_company_id:** `String`
56473
+
56474
+ </dd>
56475
+ </dl>
56476
+
56477
+ <dl>
56478
+ <dd>
56479
+
56472
56480
  **request_options:** `Nordlet::Billing::RequestOptions`
56473
56481
 
56474
56482
  </dd>
@@ -56539,6 +56547,60 @@ client.billing.topup_confirm(session_id: "sessionId")
56539
56547
  </dl>
56540
56548
 
56541
56549
 
56550
+ </dd>
56551
+ </dl>
56552
+ </details>
56553
+
56554
+ <details><summary><code>client.billing.<a href="/lib/nordlet/billing/client.rb">free_sandbox_start</a>(request) -> Nordlet::Billing::Types::FreeSandboxStartBillingResponse</code></summary>
56555
+ <dl>
56556
+ <dd>
56557
+
56558
+ #### 📝 Description
56559
+
56560
+ <dl>
56561
+ <dd>
56562
+
56563
+ <dl>
56564
+ <dd>
56565
+
56566
+ Start the free sandbox plan of the caller's `app` billing account: one sandbox company, free for 14 days from now, without a payment. A free sandbox that is already running keeps its end date. After `trialEndsAt` the sandbox company answers 402 until a paid plan is chosen. Answers 409 on the `invoice` site, when a paid plan is already active, and when the free sandbox of this account has already ended.
56567
+ </dd>
56568
+ </dl>
56569
+ </dd>
56570
+ </dl>
56571
+
56572
+ #### 🔌 Usage
56573
+
56574
+ <dl>
56575
+ <dd>
56576
+
56577
+ <dl>
56578
+ <dd>
56579
+
56580
+ ```ruby
56581
+ client.billing.free_sandbox_start
56582
+ ```
56583
+ </dd>
56584
+ </dl>
56585
+ </dd>
56586
+ </dl>
56587
+
56588
+ #### ⚙️ Parameters
56589
+
56590
+ <dl>
56591
+ <dd>
56592
+
56593
+ <dl>
56594
+ <dd>
56595
+
56596
+ **request_options:** `Nordlet::Billing::RequestOptions`
56597
+
56598
+ </dd>
56599
+ </dl>
56600
+ </dd>
56601
+ </dl>
56602
+
56603
+
56542
56604
  </dd>
56543
56605
  </dl>
56544
56606
  </details>
@@ -56555,7 +56617,7 @@ client.billing.topup_confirm(session_id: "sessionId")
56555
56617
  <dl>
56556
56618
  <dd>
56557
56619
 
56558
- Open a Stripe Checkout session for a flat-rate subscription on `plan` (by default the first plan of the request's site) for the billing account of the request's site, with the trial period of `trialDays` days, and return its URL; a Stripe customer is created for that account when it has none. The `invoicing` plan of the `invoice` site takes its trial days from the server setting `INVOICE_PLAN_TRIAL_DAYS` and returns to the invoice app. Answers 422 when the plan is not one of the site's plans, 409 when the site's flat-rate subscription is already active and 503 when online payments are not configured, the plan has no price, or the Invoicing trial is not set.
56620
+ Open a Stripe Checkout session for a flat-rate subscription on `plan` (by default the first plan of the request's site) for the billing account of the request's site and return its URL; a Stripe customer is created for that account when it has none. The plans of the `app` site have no trial period: the first month is charged at checkout. The `invoicing` plan of the `invoice` site takes its trial days from the server setting `INVOICE_PLAN_TRIAL_DAYS` and returns to the invoice app. With `convertCompanyId` Checkout returns to the onboarding plan page, which then converts that sandbox company to a live company. Answers 422 when the plan is not one of the site's plans, 409 when the site's flat-rate subscription is already active and 503 when online payments are not configured, the plan has no price, or the Invoicing trial is not set.
56559
56621
  </dd>
56560
56622
  </dl>
56561
56623
  </dd>
@@ -56601,6 +56663,14 @@ client.billing.flat_rate_create
56601
56663
  <dl>
56602
56664
  <dd>
56603
56665
 
56666
+ **convert_company_id:** `String`
56667
+
56668
+ </dd>
56669
+ </dl>
56670
+
56671
+ <dl>
56672
+ <dd>
56673
+
56604
56674
  **request_options:** `Nordlet::Billing::RequestOptions`
56605
56675
 
56606
56676
  </dd>
@@ -57885,7 +57955,7 @@ client.account.locale_set(locale: "en")
57885
57955
  <dl>
57886
57956
  <dd>
57887
57957
 
57888
- Create a company with the caller as its owner and payer, seed its chart of accounts from the template of `countryCode`, and make it the active company of the session. `timeZone` defaults to the country's, `isVatPayer` to true and `defaultInvoiceCurrency` to the base currency. Refused with 422 when `baseCurrency` is not a supported currency.
57958
+ Create a company with the caller as its owner and payer, seed its chart of accounts from the template of `countryCode`, and make it the active company of the session. `timeZone` defaults to the country's, `isVatPayer` to true and `defaultInvoiceCurrency` to the base currency. Without a paid plan the caller may create only one sandbox company, which starts the free sandbox plan; a live company, a second sandbox company, or a sandbox company after the free sandbox has ended is refused with 402. Refused with 422 when `baseCurrency` is not a supported currency.
57889
57959
  </dd>
57890
57960
  </dl>
57891
57961
  </dd>
@@ -58195,7 +58265,7 @@ client.account.companies_create(name: "name")
58195
58265
  <dl>
58196
58266
  <dd>
58197
58267
 
58198
- **is_sandbox:** `Internal::Types::Boolean` — Sandbox companies hold test data and are purged immediately on delete (immutable after creation)
58268
+ **is_sandbox:** `Internal::Types::Boolean` — Sandbox companies hold test data and are purged immediately on delete; `companies/convert-to-live` turns one into a live company
58199
58269
 
58200
58270
  </dd>
58201
58271
  </dl>
@@ -58785,6 +58855,68 @@ client.account.companies_delete(company_id: "companyId")
58785
58855
  </dl>
58786
58856
 
58787
58857
 
58858
+ </dd>
58859
+ </dl>
58860
+ </details>
58861
+
58862
+ <details><summary><code>client.account.<a href="/lib/nordlet/account/client.rb">companies_convert_to_live</a>(request) -> Nordlet::Account::Types::CompaniesConvertToLiveAccountResponse</code></summary>
58863
+ <dl>
58864
+ <dd>
58865
+
58866
+ #### 📝 Description
58867
+
58868
+ <dl>
58869
+ <dd>
58870
+
58871
+ <dl>
58872
+ <dd>
58873
+
58874
+ Turn the sandbox company `companyId` into a live company and keep all of its data: from then on its filings go to the authorities' production systems and a delete is no longer purged at once. The caller must be the company's owner and payer and have a paid plan (a flat-rate subscription or per-request billing). Refused with 403 when the caller is not the owner or not the payer, 409 when the company is not a sandbox company and 402 when the caller has no paid plan.
58875
+ </dd>
58876
+ </dl>
58877
+ </dd>
58878
+ </dl>
58879
+
58880
+ #### 🔌 Usage
58881
+
58882
+ <dl>
58883
+ <dd>
58884
+
58885
+ <dl>
58886
+ <dd>
58887
+
58888
+ ```ruby
58889
+ client.account.companies_convert_to_live(company_id: "companyId")
58890
+ ```
58891
+ </dd>
58892
+ </dl>
58893
+ </dd>
58894
+ </dl>
58895
+
58896
+ #### ⚙️ Parameters
58897
+
58898
+ <dl>
58899
+ <dd>
58900
+
58901
+ <dl>
58902
+ <dd>
58903
+
58904
+ **company_id:** `String`
58905
+
58906
+ </dd>
58907
+ </dl>
58908
+
58909
+ <dl>
58910
+ <dd>
58911
+
58912
+ **request_options:** `Nordlet::Account::RequestOptions`
58913
+
58914
+ </dd>
58915
+ </dl>
58916
+ </dd>
58917
+ </dl>
58918
+
58919
+
58788
58920
  </dd>
58789
58921
  </dl>
58790
58922
  </details>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nordlet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nordlet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-05 00:00:00.000000000 Z
11
+ date: 2026-11-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: The Nordlet Ruby library provides convenient access to the Nordlet API
14
14
  from Ruby.
@@ -33,6 +33,8 @@ files:
33
33
  - lib/nordlet/account/types/companies_activate_account_response.rb
34
34
  - lib/nordlet/account/types/companies_archive_account_request.rb
35
35
  - lib/nordlet/account/types/companies_archive_account_response.rb
36
+ - lib/nordlet/account/types/companies_convert_to_live_account_request.rb
37
+ - lib/nordlet/account/types/companies_convert_to_live_account_response.rb
36
38
  - lib/nordlet/account/types/companies_create_account_request.rb
37
39
  - lib/nordlet/account/types/companies_create_account_request_accounts_kept_by.rb
38
40
  - lib/nordlet/account/types/companies_create_account_request_address.rb
@@ -657,6 +659,16 @@ files:
657
659
  - lib/nordlet/billing/types/flat_rate_create_billing_request_locale.rb
658
660
  - lib/nordlet/billing/types/flat_rate_create_billing_request_plan.rb
659
661
  - lib/nordlet/billing/types/flat_rate_create_billing_response.rb
662
+ - lib/nordlet/billing/types/free_sandbox_start_billing_request.rb
663
+ - lib/nordlet/billing/types/free_sandbox_start_billing_response.rb
664
+ - lib/nordlet/billing/types/free_sandbox_start_billing_response_account_type.rb
665
+ - lib/nordlet/billing/types/free_sandbox_start_billing_response_auto_top_up.rb
666
+ - lib/nordlet/billing/types/free_sandbox_start_billing_response_month_to_date.rb
667
+ - lib/nordlet/billing/types/free_sandbox_start_billing_response_plan.rb
668
+ - lib/nordlet/billing/types/free_sandbox_start_billing_response_plans_value.rb
669
+ - lib/nordlet/billing/types/free_sandbox_start_billing_response_site.rb
670
+ - lib/nordlet/billing/types/free_sandbox_start_billing_response_status.rb
671
+ - lib/nordlet/billing/types/free_sandbox_start_billing_response_top_up.rb
660
672
  - lib/nordlet/billing/types/portal_create_billing_request.rb
661
673
  - lib/nordlet/billing/types/portal_create_billing_request_locale.rb
662
674
  - lib/nordlet/billing/types/portal_create_billing_response.rb