kintsugi_sdk 5.7.0 → 5.7.1
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/kintsugi_sdk/addressvalidation.rb +21 -21
- data/lib/kintsugi_sdk/customers.rb +55 -55
- data/lib/kintsugi_sdk/exemptions.rb +44 -44
- data/lib/kintsugi_sdk/models/errors/apierror.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_address_validation_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_customers_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_exemptions_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_products_schemas_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_tax_estimation_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_transactions_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/errorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/httpvalidationerror.rb +1 -1
- data/lib/kintsugi_sdk/models/ops/get_exemptions_v1_exemptions_get_request.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_address_validation_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_customers_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_schemas_exemption_exemptionread.rb +6 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_schemas_exemption_exemptionread.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_serializers_exemptionread.rb +6 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_serializers_exemptionread.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/backend_src_products_schemas_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_tax_estimation_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_transactions_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/currencyenum.rb +1 -1
- data/lib/kintsugi_sdk/models/shared/exemptioncreate.rb +6 -2
- data/lib/kintsugi_sdk/models/shared/exemptioncreate.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/exemptionsourceenum.rb +4 -0
- data/lib/kintsugi_sdk/models/shared/exemptiontype.rb +1 -0
- data/lib/kintsugi_sdk/models/shared/nexusresponse.rb +31 -21
- data/lib/kintsugi_sdk/models/shared/nexusresponse.rbi +6 -4
- data/lib/kintsugi_sdk/models/shared/productread.rb +4 -6
- data/lib/kintsugi_sdk/models/shared/relatedentitytype.rb +4 -0
- data/lib/kintsugi_sdk/models/shared/sourceenum.rb +8 -0
- data/lib/kintsugi_sdk/models/shared/taxexemptionenum.rb +1 -0
- data/lib/kintsugi_sdk/models/shared/taxitemreturnreasonenum.rb +2 -0
- data/lib/kintsugi_sdk/models/shared/taxtypeenum.rb +7 -3
- data/lib/kintsugi_sdk/models/shared/transactioncreate.rb +8 -4
- data/lib/kintsugi_sdk/models/shared/transactioncreate.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/{exemption.rb → transactionembeddedexemption.rb} +17 -4
- data/lib/kintsugi_sdk/models/shared/{exemption.rbi → transactionembeddedexemption.rbi} +4 -2
- data/lib/kintsugi_sdk/models/shared/transactionestimatepublicrequest.rb +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionitembuilder.rb +6 -2
- data/lib/kintsugi_sdk/models/shared/transactionitembuilder.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/transactionitemcreateupdate.rb +6 -2
- data/lib/kintsugi_sdk/models/shared/transactionitemcreateupdate.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/transactionitemestimatebase.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/transactionitemestimateresponse.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/transactionitemread.rb +15 -3
- data/lib/kintsugi_sdk/models/shared/transactionitemread.rbi +6 -0
- data/lib/kintsugi_sdk/models/shared/transactionpublicrequest.rb +8 -4
- data/lib/kintsugi_sdk/models/shared/transactionpublicrequest.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/transactionread.rb +21 -5
- data/lib/kintsugi_sdk/models/shared/transactionread.rbi +8 -0
- data/lib/kintsugi_sdk/models/shared/transactionupdate.rb +8 -4
- data/lib/kintsugi_sdk/models/shared/transactionupdate.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/usetaxregistrationpath.rb +24 -0
- data/lib/kintsugi_sdk/models/shared/usetaxregistrationpath.rbi +11 -0
- data/lib/kintsugi_sdk/models/shared.rb +2 -1
- data/lib/kintsugi_sdk/nexus.rb +7 -7
- data/lib/kintsugi_sdk/openapisdk.rb +5 -5
- data/lib/kintsugi_sdk/products.rb +19 -19
- data/lib/kintsugi_sdk/sdk_hooks/hooks.rb +1 -1
- data/lib/kintsugi_sdk/sdk_hooks/types.rb +14 -14
- data/lib/kintsugi_sdk/sdkconfiguration.rb +17 -17
- data/lib/kintsugi_sdk/taxestimation.rb +11 -11
- data/lib/kintsugi_sdk/transactions.rb +51 -51
- data/lib/kintsugi_sdk/utils/forms.rb +23 -23
- data/lib/kintsugi_sdk/utils/headers.rb +4 -4
- data/lib/kintsugi_sdk/utils/query_params.rb +14 -14
- data/lib/kintsugi_sdk/utils/request_bodies.rb +7 -7
- data/lib/kintsugi_sdk/utils/retries.rb +5 -5
- data/lib/kintsugi_sdk/utils/security.rb +16 -16
- data/lib/kintsugi_sdk/utils/url.rb +6 -6
- data/lib/kintsugi_sdk/utils/utils.rb +31 -31
- metadata +6 -4
|
@@ -34,9 +34,11 @@ module KintsugiSDK
|
|
|
34
34
|
field :transaction_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('transaction_id') } }
|
|
35
35
|
# Indicates whether the exemption is for a reseller
|
|
36
36
|
field :reseller, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('reseller') } }
|
|
37
|
+
# Partial-exemption certificate form code. Required when exemption_type is partial; must be absent otherwise.
|
|
38
|
+
field :certificate_type, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('certificate_type') } }
|
|
37
39
|
|
|
38
|
-
sig { params(exemption_type: Models::Shared::ExemptionType, start_date: ::Date, customer_id: ::String, fein: ::String, sales_tax_id: ::String, status: Models::Shared::ExemptionStatus, jurisdiction: T.nilable(::String), country_code: T.nilable(Models::Shared::CountryCodeEnum), end_date: T.nilable(::Date), transaction_id: T.nilable(::String), reseller: T.nilable(T::Boolean)).void }
|
|
39
|
-
def initialize(exemption_type:, start_date:, customer_id:, fein:, sales_tax_id:, status:, jurisdiction: nil, country_code: nil, end_date: nil, transaction_id: nil, reseller: false)
|
|
40
|
+
sig { params(exemption_type: Models::Shared::ExemptionType, start_date: ::Date, customer_id: ::String, fein: ::String, sales_tax_id: ::String, status: Models::Shared::ExemptionStatus, jurisdiction: T.nilable(::String), country_code: T.nilable(Models::Shared::CountryCodeEnum), end_date: T.nilable(::Date), transaction_id: T.nilable(::String), reseller: T.nilable(T::Boolean), certificate_type: T.nilable(::String)).void }
|
|
41
|
+
def initialize(exemption_type:, start_date:, customer_id:, fein:, sales_tax_id:, status:, jurisdiction: nil, country_code: nil, end_date: nil, transaction_id: nil, reseller: false, certificate_type: nil)
|
|
40
42
|
@exemption_type = exemption_type
|
|
41
43
|
@start_date = start_date
|
|
42
44
|
@customer_id = customer_id
|
|
@@ -48,6 +50,7 @@ module KintsugiSDK
|
|
|
48
50
|
@end_date = end_date
|
|
49
51
|
@transaction_id = transaction_id
|
|
50
52
|
@reseller = reseller
|
|
53
|
+
@certificate_type = certificate_type
|
|
51
54
|
end
|
|
52
55
|
|
|
53
56
|
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
@@ -64,6 +67,7 @@ module KintsugiSDK
|
|
|
64
67
|
return false unless @end_date == other.end_date
|
|
65
68
|
return false unless @transaction_id == other.transaction_id
|
|
66
69
|
return false unless @reseller == other.reseller
|
|
70
|
+
return false unless @certificate_type == other.certificate_type
|
|
67
71
|
true
|
|
68
72
|
end
|
|
69
73
|
end
|
|
@@ -29,6 +29,10 @@ module KintsugiSDK
|
|
|
29
29
|
SHOPLINE = new('SHOPLINE')
|
|
30
30
|
ORB = new('ORB')
|
|
31
31
|
ZENSKAR = new('ZENSKAR')
|
|
32
|
+
HYPERLINE = new('HYPERLINE')
|
|
33
|
+
ODOO = new('ODOO')
|
|
34
|
+
ZOHO_BOOKS = new('ZOHO_BOOKS')
|
|
35
|
+
UNLEASHED = new('UNLEASHED')
|
|
32
36
|
MANUAL = new('MANUAL')
|
|
33
37
|
BULK_UPLOAD = new('BULK_UPLOAD')
|
|
34
38
|
EMAIL = new('EMAIL')
|
|
@@ -35,10 +35,6 @@ module KintsugiSDK
|
|
|
35
35
|
|
|
36
36
|
field :id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('id'), required: true } }
|
|
37
37
|
|
|
38
|
-
field :created_at, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('created_at'), required: true, 'decoder': ::KintsugiSDK::Utils.datetime_from_iso_format(false) } }
|
|
39
|
-
|
|
40
|
-
field :updated_at, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('updated_at'), required: true, 'decoder': ::KintsugiSDK::Utils.datetime_from_iso_format(false) } }
|
|
41
|
-
|
|
42
38
|
field :organization_id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('organization_id'), required: true } }
|
|
43
39
|
|
|
44
40
|
field :threshold_sales, ::Integer, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('threshold_sales'), required: true } }
|
|
@@ -64,18 +60,30 @@ module KintsugiSDK
|
|
|
64
60
|
#
|
|
65
61
|
# Registrations and filings may be SALES_AND_USE_TAX: one state account and
|
|
66
62
|
# one return can cover both taxes, and each is stored as a single row.
|
|
67
|
-
# Nexus rows are
|
|
68
|
-
#
|
|
69
|
-
#
|
|
63
|
+
# Nexus rows are SALES_TAX, USE_TAX, RETAIL_DELIVERY_FEE, or
|
|
64
|
+
# SMALL_PARCEL_VAT. Sales tax, use tax, the retail delivery fee, and the
|
|
65
|
+
# Swiss small-parcel threshold are separate obligations with their own met
|
|
66
|
+
# dates and period models. SMALL_PARCEL_VAT is a threshold only. A sales
|
|
67
|
+
# tax registration covers it, and it has no account and no return of its own.
|
|
70
68
|
field :tax_type, Crystalline::Nilable.new(Models::Shared::TaxTypeEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_type'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::TaxTypeEnum, true) } }
|
|
71
69
|
|
|
72
70
|
field :previous_period_start_date, Crystalline::Nilable.new(::Date), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('previous_period_start_date'), required: true, 'decoder': ::KintsugiSDK::Utils.date_from_iso_format(false) } }
|
|
73
71
|
|
|
74
72
|
field :previous_period_end_date, Crystalline::Nilable.new(::Date), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('previous_period_end_date'), required: true, 'decoder': ::KintsugiSDK::Utils.date_from_iso_format(false) } }
|
|
75
73
|
|
|
76
|
-
field :periods, Crystalline::Nilable.new(Crystalline::Array.new(Crystalline::Hash.new(Symbol, ::Object))), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('periods') } }
|
|
74
|
+
field :periods, Crystalline::Nilable.new(Crystalline::Array.new(Crystalline::Hash.new(::Symbol, ::Object))), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('periods') } }
|
|
75
|
+
|
|
76
|
+
field :created_at, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('created_at'), required: true } }
|
|
77
|
+
|
|
78
|
+
field :updated_at, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('updated_at'), required: true } }
|
|
77
79
|
|
|
78
80
|
field :disregarded_nexus_types, Crystalline::Nilable.new(Crystalline::Array.new(::String)), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('disregarded_nexus_types') } }
|
|
81
|
+
# What Register does with a use tax row, as the nexus response reports it.
|
|
82
|
+
#
|
|
83
|
+
# - ABSORBED: Register folds the row into the org's live sales tax registration
|
|
84
|
+
# - SEPARATE: the state always keeps use tax on its own registration
|
|
85
|
+
# - NONE: everything else, and always NONE on a row that is not use tax
|
|
86
|
+
field :use_tax_registration_path, Crystalline::Nilable.new(Models::Shared::UseTaxRegistrationPath), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('use_tax_registration_path'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::UseTaxRegistrationPath, true) } }
|
|
79
87
|
|
|
80
88
|
field :marketplace_included, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('marketplace_included'), required: true } }
|
|
81
89
|
|
|
@@ -115,13 +123,13 @@ module KintsugiSDK
|
|
|
115
123
|
|
|
116
124
|
field :collected_tax_nexus_met_date, Crystalline::Nilable.new(::Date), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('collected_tax_nexus_met_date'), 'decoder': ::KintsugiSDK::Utils.date_from_iso_format(true) } }
|
|
117
125
|
|
|
118
|
-
field :earliest_transaction_date, Crystalline::Nilable.new(::
|
|
126
|
+
field :earliest_transaction_date, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('earliest_transaction_date') } }
|
|
119
127
|
|
|
120
|
-
field :most_recent_transaction_date, Crystalline::Nilable.new(::
|
|
128
|
+
field :most_recent_transaction_date, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('most_recent_transaction_date') } }
|
|
121
129
|
|
|
122
130
|
field :find_threshold_crossing_transaction_state, Crystalline::Nilable.new(Models::Shared::FindThresholdCrossingTransactionState), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('find_threshold_crossing_transaction_state') } }
|
|
123
131
|
|
|
124
|
-
field :earliest_collected_date, Crystalline::Nilable.new(::
|
|
132
|
+
field :earliest_collected_date, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('earliest_collected_date') } }
|
|
125
133
|
|
|
126
134
|
field :predicted_month_from_today, Crystalline::Nilable.new(::Integer), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('predicted_month_from_today') } }
|
|
127
135
|
|
|
@@ -129,17 +137,17 @@ module KintsugiSDK
|
|
|
129
137
|
|
|
130
138
|
field :confidence_level, Crystalline::Nilable.new(::Float), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('confidence_level') } }
|
|
131
139
|
|
|
132
|
-
field :last_processed_at, Crystalline::Nilable.new(::
|
|
140
|
+
field :last_processed_at, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('last_processed_at') } }
|
|
133
141
|
|
|
134
|
-
field :last_tax_liability_processed_at, Crystalline::Nilable.new(::
|
|
142
|
+
field :last_tax_liability_processed_at, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('last_tax_liability_processed_at') } }
|
|
135
143
|
# Currency code for the nexus (e.g., USD, CAD).
|
|
136
144
|
field :currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('currency'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
137
145
|
|
|
138
|
-
field :registration, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('registration') } }
|
|
146
|
+
field :registration, Crystalline::Nilable.new(Crystalline::Hash.new(::Symbol, ::Object)), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('registration') } }
|
|
139
147
|
|
|
140
148
|
field :registration_regime, Crystalline::Nilable.new(Models::Shared::RegistrationsRegimeEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('registration_regime'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::RegistrationsRegimeEnum, true) } }
|
|
141
149
|
|
|
142
|
-
field :disregarded_at, Crystalline::Nilable.new(::
|
|
150
|
+
field :disregarded_at, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('disregarded_at') } }
|
|
143
151
|
|
|
144
152
|
field :disregarded_by, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('disregarded_by') } }
|
|
145
153
|
|
|
@@ -153,8 +161,8 @@ module KintsugiSDK
|
|
|
153
161
|
|
|
154
162
|
field :requires_ior_number_to_register, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('requires_ior_number_to_register') } }
|
|
155
163
|
|
|
156
|
-
sig { params(country_code: Models::Shared::CountryCodeEnum, state_code: ::String, state_name: ::String, treatment_of_exempt_transactions: Models::Shared::TreatmentEnum, trigger: ::String, sales_or_transactions: Models::Shared::SalesOrTransactionsEnum, start_date: ::Date, period_model: Models::Shared::PeriodModelEnum, period_start_date: ::Date, period_end_date: ::Date, id: ::String,
|
|
157
|
-
def initialize(country_code:, state_code:, state_name:, treatment_of_exempt_transactions:, trigger:, sales_or_transactions:, start_date:, period_model:, period_start_date:, period_end_date:, id:,
|
|
164
|
+
sig { params(country_code: Models::Shared::CountryCodeEnum, state_code: ::String, state_name: ::String, treatment_of_exempt_transactions: Models::Shared::TreatmentEnum, trigger: ::String, sales_or_transactions: Models::Shared::SalesOrTransactionsEnum, start_date: ::Date, period_model: Models::Shared::PeriodModelEnum, period_start_date: ::Date, period_end_date: ::Date, id: ::String, organization_id: ::String, threshold_sales: ::Integer, is_vda_eligible: T::Boolean, nexus_type: Models::Shared::NexusTypeEnum, total_transactions: ::Integer, total_transactions_included: ::Integer, total_transactions_exempted: ::Integer, total_transactions_marketplace: ::Integer, processing_status: T.nilable(Models::Shared::NexusStatusEnum), status: T.nilable(Models::Shared::NexusStateEnum), threshold_transactions: T.nilable(::Integer), tax_type: T.nilable(Models::Shared::TaxTypeEnum), previous_period_start_date: T.nilable(::Date), previous_period_end_date: T.nilable(::Date), periods: T.nilable(T::Array[T::Hash[::Symbol, ::Object]]), created_at: T.nilable(::String), updated_at: T.nilable(::String), disregarded_nexus_types: T.nilable(T::Array[::String]), use_tax_registration_path: T.nilable(Models::Shared::UseTaxRegistrationPath), marketplace_included: T.nilable(T::Boolean), threshold_sales_bigint: T.nilable(::Integer), transaction_count: T.nilable(::Integer), transactions_amount: T.nilable(::String), previous_transaction_count: T.nilable(::Integer), previous_transactions_amount: T.nilable(::String), calculated_tax_liability: T.nilable(::String), imported_tax_liability: T.nilable(::String), tax_liability: T.nilable(::String), nexus_met: T.nilable(T::Boolean), nexus_met_date: T.nilable(::Date), economic_nexus_met: T.nilable(T::Boolean), economic_nexus_met_date: T.nilable(::Date), physical_nexus_met: T.nilable(T::Boolean), physical_nexus_met_date: T.nilable(::Date), collected_tax_nexus_met: T.nilable(T::Boolean), collected_tax_nexus_met_date: T.nilable(::Date), earliest_transaction_date: T.nilable(::String), most_recent_transaction_date: T.nilable(::String), find_threshold_crossing_transaction_state: T.nilable(Models::Shared::FindThresholdCrossingTransactionState), earliest_collected_date: T.nilable(::String), predicted_month_from_today: T.nilable(::Integer), vda_eligible: T.nilable(T::Boolean), confidence_level: T.nilable(::Float), last_processed_at: T.nilable(::String), last_tax_liability_processed_at: T.nilable(::String), currency: T.nilable(Models::Shared::CurrencyEnum), registration: T.nilable(T::Hash[::Symbol, ::Object]), registration_regime: T.nilable(Models::Shared::RegistrationsRegimeEnum), disregarded_at: T.nilable(::String), disregarded_by: T.nilable(::String), disregarded_type: T.nilable(Models::Shared::DisregardedTypeEnum), is_currently_disregarded: T.nilable(T::Boolean), ior_opt_out_eligible: T.nilable(T::Boolean), ior_eligible_at_registration: T.nilable(T::Boolean), requires_ior_number_to_register: T.nilable(T::Boolean)).void }
|
|
165
|
+
def initialize(country_code:, state_code:, state_name:, treatment_of_exempt_transactions:, trigger:, sales_or_transactions:, start_date:, period_model:, period_start_date:, period_end_date:, id:, organization_id:, threshold_sales:, is_vda_eligible:, nexus_type:, total_transactions:, total_transactions_included:, total_transactions_exempted:, total_transactions_marketplace:, processing_status: nil, status: nil, threshold_transactions: nil, tax_type: nil, previous_period_start_date: nil, previous_period_end_date: nil, periods: nil, created_at: nil, updated_at: nil, disregarded_nexus_types: nil, use_tax_registration_path: nil, marketplace_included: nil, threshold_sales_bigint: 0, transaction_count: 0, transactions_amount: '0.00', previous_transaction_count: 0, previous_transactions_amount: '0.00', calculated_tax_liability: nil, imported_tax_liability: nil, tax_liability: '0.00', nexus_met: false, nexus_met_date: nil, economic_nexus_met: false, economic_nexus_met_date: nil, physical_nexus_met: false, physical_nexus_met_date: nil, collected_tax_nexus_met: nil, collected_tax_nexus_met_date: nil, earliest_transaction_date: nil, most_recent_transaction_date: nil, find_threshold_crossing_transaction_state: nil, earliest_collected_date: nil, predicted_month_from_today: nil, vda_eligible: nil, confidence_level: nil, last_processed_at: nil, last_tax_liability_processed_at: nil, currency: nil, registration: nil, registration_regime: nil, disregarded_at: nil, disregarded_by: nil, disregarded_type: nil, is_currently_disregarded: false, ior_opt_out_eligible: false, ior_eligible_at_registration: false, requires_ior_number_to_register: false)
|
|
158
166
|
@country_code = country_code
|
|
159
167
|
@state_code = state_code
|
|
160
168
|
@state_name = state_name
|
|
@@ -166,8 +174,6 @@ module KintsugiSDK
|
|
|
166
174
|
@period_start_date = period_start_date
|
|
167
175
|
@period_end_date = period_end_date
|
|
168
176
|
@id = id
|
|
169
|
-
@created_at = created_at
|
|
170
|
-
@updated_at = updated_at
|
|
171
177
|
@organization_id = organization_id
|
|
172
178
|
@threshold_sales = threshold_sales
|
|
173
179
|
@is_vda_eligible = is_vda_eligible
|
|
@@ -183,7 +189,10 @@ module KintsugiSDK
|
|
|
183
189
|
@previous_period_start_date = previous_period_start_date
|
|
184
190
|
@previous_period_end_date = previous_period_end_date
|
|
185
191
|
@periods = periods
|
|
192
|
+
@created_at = created_at
|
|
193
|
+
@updated_at = updated_at
|
|
186
194
|
@disregarded_nexus_types = disregarded_nexus_types
|
|
195
|
+
@use_tax_registration_path = use_tax_registration_path
|
|
187
196
|
@marketplace_included = marketplace_included
|
|
188
197
|
@threshold_sales_bigint = threshold_sales_bigint
|
|
189
198
|
@transaction_count = transaction_count
|
|
@@ -236,8 +245,6 @@ module KintsugiSDK
|
|
|
236
245
|
return false unless @period_start_date == other.period_start_date
|
|
237
246
|
return false unless @period_end_date == other.period_end_date
|
|
238
247
|
return false unless @id == other.id
|
|
239
|
-
return false unless @created_at == other.created_at
|
|
240
|
-
return false unless @updated_at == other.updated_at
|
|
241
248
|
return false unless @organization_id == other.organization_id
|
|
242
249
|
return false unless @threshold_sales == other.threshold_sales
|
|
243
250
|
return false unless @is_vda_eligible == other.is_vda_eligible
|
|
@@ -253,7 +260,10 @@ module KintsugiSDK
|
|
|
253
260
|
return false unless @previous_period_start_date == other.previous_period_start_date
|
|
254
261
|
return false unless @previous_period_end_date == other.previous_period_end_date
|
|
255
262
|
return false unless @periods == other.periods
|
|
263
|
+
return false unless @created_at == other.created_at
|
|
264
|
+
return false unless @updated_at == other.updated_at
|
|
256
265
|
return false unless @disregarded_nexus_types == other.disregarded_nexus_types
|
|
266
|
+
return false unless @use_tax_registration_path == other.use_tax_registration_path
|
|
257
267
|
return false unless @marketplace_included == other.marketplace_included
|
|
258
268
|
return false unless @threshold_sales_bigint == other.threshold_sales_bigint
|
|
259
269
|
return false unless @transaction_count == other.transaction_count
|
|
@@ -30,10 +30,6 @@ class KintsugiSDK::Models::Shared::NexusResponse
|
|
|
30
30
|
def period_end_date=(str_); end
|
|
31
31
|
def id(); end
|
|
32
32
|
def id=(str_); end
|
|
33
|
-
def created_at(); end
|
|
34
|
-
def created_at=(str_); end
|
|
35
|
-
def updated_at(); end
|
|
36
|
-
def updated_at=(str_); end
|
|
37
33
|
def organization_id(); end
|
|
38
34
|
def organization_id=(str_); end
|
|
39
35
|
def threshold_sales(); end
|
|
@@ -64,8 +60,14 @@ class KintsugiSDK::Models::Shared::NexusResponse
|
|
|
64
60
|
def previous_period_end_date=(str_); end
|
|
65
61
|
def periods(); end
|
|
66
62
|
def periods=(str_); end
|
|
63
|
+
def created_at(); end
|
|
64
|
+
def created_at=(str_); end
|
|
65
|
+
def updated_at(); end
|
|
66
|
+
def updated_at=(str_); end
|
|
67
67
|
def disregarded_nexus_types(); end
|
|
68
68
|
def disregarded_nexus_types=(str_); end
|
|
69
|
+
def use_tax_registration_path(); end
|
|
70
|
+
def use_tax_registration_path=(str_); end
|
|
69
71
|
def marketplace_included(); end
|
|
70
72
|
def marketplace_included=(str_); end
|
|
71
73
|
def threshold_sales_bigint(); end
|
|
@@ -26,9 +26,7 @@ module KintsugiSDK
|
|
|
26
26
|
# For example, Physical, Digital, etc. You can
|
|
27
27
|
# retrieve supported categories from [GET /products/categories endpoint](/reference/api/products/get-product-categories)
|
|
28
28
|
field :product_category, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_category'), required: true } }
|
|
29
|
-
#
|
|
30
|
-
# For example, General Clothing, UNKNOWN, etc. You can
|
|
31
|
-
# retrieve supported subcategories from [GET /products/categories endpoint](/reference/api/products/get-product-categories)
|
|
29
|
+
# Tax subcategory display label of the product (e.g. 'General Clothing'). List supported values from [GET /products/categories](/reference/api/products/get-product-categories).
|
|
32
30
|
field :product_subcategory, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_subcategory'), required: true } }
|
|
33
31
|
|
|
34
32
|
field :tax_exempt, Crystalline::Boolean.new, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_exempt'), required: true } }
|
|
@@ -53,11 +51,11 @@ module KintsugiSDK
|
|
|
53
51
|
|
|
54
52
|
field :source_taxonomy_name, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('source_taxonomy_name') } }
|
|
55
53
|
|
|
56
|
-
field :source_taxonomy_categories, Crystalline::Nilable.new(Crystalline::Array.new(Crystalline::Hash.new(Symbol, ::Object))), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('source_taxonomy_categories') } }
|
|
54
|
+
field :source_taxonomy_categories, Crystalline::Nilable.new(Crystalline::Array.new(Crystalline::Hash.new(::Symbol, ::Object))), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('source_taxonomy_categories') } }
|
|
57
55
|
|
|
58
|
-
field :source_taxonomy_metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('source_taxonomy_metadata') } }
|
|
56
|
+
field :source_taxonomy_metadata, Crystalline::Nilable.new(Crystalline::Hash.new(::Symbol, ::Object)), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('source_taxonomy_metadata') } }
|
|
59
57
|
|
|
60
|
-
sig { params(id: ::String, external_id: ::String, code: ::String, name: ::String, status: Models::Shared::ProductStatusEnum, product_category: ::String, product_subcategory: ::String, tax_exempt: T::Boolean, source: Models::Shared::SourceEnum, sku: T.nilable(T::Array[::String]), description: T.nilable(::String), connection_id: T.nilable(::String), classification_failed: T.nilable(T::Boolean), store_name: T.nilable(::String), source_taxonomy_type: T.nilable(::String), source_taxonomy_code: T.nilable(::String), source_taxonomy_id: T.nilable(::String), source_taxonomy_name: T.nilable(::String), source_taxonomy_categories: T.nilable(T::Array[T::Hash[Symbol, ::Object]]), source_taxonomy_metadata: T.nilable(T::Hash[Symbol, ::Object])).void }
|
|
58
|
+
sig { params(id: ::String, external_id: ::String, code: ::String, name: ::String, status: Models::Shared::ProductStatusEnum, product_category: ::String, product_subcategory: ::String, tax_exempt: T::Boolean, source: Models::Shared::SourceEnum, sku: T.nilable(T::Array[::String]), description: T.nilable(::String), connection_id: T.nilable(::String), classification_failed: T.nilable(T::Boolean), store_name: T.nilable(::String), source_taxonomy_type: T.nilable(::String), source_taxonomy_code: T.nilable(::String), source_taxonomy_id: T.nilable(::String), source_taxonomy_name: T.nilable(::String), source_taxonomy_categories: T.nilable(T::Array[T::Hash[::Symbol, ::Object]]), source_taxonomy_metadata: T.nilable(T::Hash[::Symbol, ::Object])).void }
|
|
61
59
|
def initialize(id:, external_id:, code:, name:, status:, product_category:, product_subcategory:, tax_exempt:, source:, sku: nil, description: nil, connection_id: nil, classification_failed: nil, store_name: nil, source_taxonomy_type: nil, source_taxonomy_code: nil, source_taxonomy_id: nil, source_taxonomy_name: nil, source_taxonomy_categories: nil, source_taxonomy_metadata: nil)
|
|
62
60
|
@id = id
|
|
63
61
|
@external_id = external_id
|
|
@@ -14,6 +14,10 @@ module KintsugiSDK
|
|
|
14
14
|
REGISTRATION = new('REGISTRATION')
|
|
15
15
|
FILING = new('FILING')
|
|
16
16
|
FILING_PAYMENT = new('FILING_PAYMENT')
|
|
17
|
+
TASK = new('TASK')
|
|
18
|
+
FILING_PAYMENT_RECEIPT = new('FILING_PAYMENT_RECEIPT')
|
|
19
|
+
PROPOSAL = new('PROPOSAL')
|
|
20
|
+
FILING_DOCUMENT = new('FILING_DOCUMENT')
|
|
17
21
|
end
|
|
18
22
|
end
|
|
19
23
|
end
|
|
@@ -48,6 +48,8 @@ module KintsugiSDK
|
|
|
48
48
|
RIPPLING = new('RIPPLING')
|
|
49
49
|
GUSTO = new('GUSTO')
|
|
50
50
|
FACEBOOK = new('FACEBOOK')
|
|
51
|
+
FRESHBOOKS = new('FRESHBOOKS')
|
|
52
|
+
FULFIL = new('FULFIL')
|
|
51
53
|
OTHER = new('OTHER')
|
|
52
54
|
ORDWAY = new('ORDWAY')
|
|
53
55
|
INSTAGRAM = new('INSTAGRAM')
|
|
@@ -64,8 +66,10 @@ module KintsugiSDK
|
|
|
64
66
|
MODALYST = new('MODALYST')
|
|
65
67
|
NORDSTROM = new('NORDSTROM')
|
|
66
68
|
FAIRE = new('FAIRE')
|
|
69
|
+
FRISBII_BILLING = new('FRISBII_BILLING')
|
|
67
70
|
SHOPWARE = new('SHOPWARE')
|
|
68
71
|
ZOHO = new('ZOHO')
|
|
72
|
+
ZOHO_BOOKS = new('ZOHO_BOOKS')
|
|
69
73
|
SAGE_INTACCT = new('SAGE-INTACCT')
|
|
70
74
|
AIRWALLEX = new('AIRWALLEX')
|
|
71
75
|
ORB = new('ORB')
|
|
@@ -85,6 +89,10 @@ module KintsugiSDK
|
|
|
85
89
|
INTUIT_ENTERPRISE_SUITE = new('INTUIT_ENTERPRISE_SUITE')
|
|
86
90
|
ACUMATICA = new('ACUMATICA')
|
|
87
91
|
PLENTYONE = new('PLENTYONE')
|
|
92
|
+
HYPERLINE = new('HYPERLINE')
|
|
93
|
+
OPENMETER = new('OPENMETER')
|
|
94
|
+
SALEOR = new('SALEOR')
|
|
95
|
+
UNLEASHED = new('UNLEASHED')
|
|
88
96
|
end
|
|
89
97
|
end
|
|
90
98
|
end
|
|
@@ -14,6 +14,7 @@ module KintsugiSDK
|
|
|
14
14
|
TRANSACTION = new('TRANSACTION')
|
|
15
15
|
CUSTOMER = new('CUSTOMER')
|
|
16
16
|
WHOLESALE = new('WHOLESALE')
|
|
17
|
+
PARTIAL_CERTIFICATE = new('PARTIAL_CERTIFICATE')
|
|
17
18
|
REGION = new('REGION')
|
|
18
19
|
REVERSE_CHARGE = new('REVERSE_CHARGE')
|
|
19
20
|
ZERO_RATE_TAX = new('ZERO_RATE_TAX')
|
|
@@ -11,6 +11,7 @@ module KintsugiSDK
|
|
|
11
11
|
class TaxItemReturnReasonEnum < T::Enum
|
|
12
12
|
enums do
|
|
13
13
|
NO_RULE_FOUND = new('NO_RULE_FOUND')
|
|
14
|
+
ALL_RATES_OPTED_OUT = new('ALL_RATES_OPTED_OUT')
|
|
14
15
|
RULE_FOUND_TAXABLE = new('RULE_FOUND_TAXABLE')
|
|
15
16
|
RULE_FOUND_NOT_TAXABLE = new('RULE_FOUND_NOT_TAXABLE')
|
|
16
17
|
RULE_FOUND_TAXABLE_ZERO_RATE = new('RULE_FOUND_TAXABLE_ZERO_RATE')
|
|
@@ -18,6 +19,7 @@ module KintsugiSDK
|
|
|
18
19
|
FROM_IMPORT = new('FROM_IMPORT')
|
|
19
20
|
RULE_EXCLUDED_IN_CALCULATION = new('RULE_EXCLUDED_IN_CALCULATION')
|
|
20
21
|
REVERSE_CHARGE = new('REVERSE_CHARGE')
|
|
22
|
+
RULE_FOUND_SUPPRESSED_BY_COUNTY = new('RULE_FOUND_SUPPRESSED_BY_COUNTY')
|
|
21
23
|
end
|
|
22
24
|
end
|
|
23
25
|
end
|
|
@@ -11,14 +11,18 @@ module KintsugiSDK
|
|
|
11
11
|
#
|
|
12
12
|
# Registrations and filings may be SALES_AND_USE_TAX: one state account and
|
|
13
13
|
# one return can cover both taxes, and each is stored as a single row.
|
|
14
|
-
# Nexus rows are
|
|
15
|
-
#
|
|
16
|
-
#
|
|
14
|
+
# Nexus rows are SALES_TAX, USE_TAX, RETAIL_DELIVERY_FEE, or
|
|
15
|
+
# SMALL_PARCEL_VAT. Sales tax, use tax, the retail delivery fee, and the
|
|
16
|
+
# Swiss small-parcel threshold are separate obligations with their own met
|
|
17
|
+
# dates and period models. SMALL_PARCEL_VAT is a threshold only. A sales
|
|
18
|
+
# tax registration covers it, and it has no account and no return of its own.
|
|
17
19
|
class TaxTypeEnum < T::Enum
|
|
18
20
|
enums do
|
|
19
21
|
SALES_TAX = new('SALES_TAX')
|
|
20
22
|
USE_TAX = new('USE_TAX')
|
|
21
23
|
SALES_AND_USE_TAX = new('SALES_AND_USE_TAX')
|
|
24
|
+
RETAIL_DELIVERY_FEE = new('RETAIL_DELIVERY_FEE')
|
|
25
|
+
SMALL_PARCEL_VAT = new('SMALL_PARCEL_VAT')
|
|
22
26
|
end
|
|
23
27
|
end
|
|
24
28
|
end
|
|
@@ -38,7 +38,7 @@ module KintsugiSDK
|
|
|
38
38
|
field :total_tax_liability_amount, Crystalline::Nilable.new(Crystalline::Union.new(::Float, ::String)), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('total_tax_liability_amount') } }
|
|
39
39
|
# Taxable amount.
|
|
40
40
|
field :taxable_amount, Crystalline::Nilable.new(Crystalline::Union.new(::Float, ::String)), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('taxable_amount') } }
|
|
41
|
-
|
|
41
|
+
# ISO-4217 currency code. Pair with a monetary amount on the same object.
|
|
42
42
|
field :currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('currency'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
43
43
|
|
|
44
44
|
field :source, Crystalline::Nilable.new(Models::Shared::SourceEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('source'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::SourceEnum, true) } }
|
|
@@ -66,7 +66,7 @@ module KintsugiSDK
|
|
|
66
66
|
# Exemption status (e.g., NOT_EXEMPT)
|
|
67
67
|
field :exempt, Crystalline::Nilable.new(Models::Shared::TransactionExemptStatusEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('exempt'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::TransactionExemptStatusEnum, true) } }
|
|
68
68
|
# List of exemptions applied (if any).
|
|
69
|
-
field :exemptions, Crystalline::Nilable.new(Crystalline::Array.new(Models::Shared::
|
|
69
|
+
field :exemptions, Crystalline::Nilable.new(Crystalline::Array.new(Models::Shared::TransactionEmbeddedExemption)), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('exemptions') } }
|
|
70
70
|
# Related transaction identifier.
|
|
71
71
|
field :related_to, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('related_to') } }
|
|
72
72
|
# Secondary External Identifier.
|
|
@@ -77,6 +77,8 @@ module KintsugiSDK
|
|
|
77
77
|
field :external_friendly_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('external_friendly_id') } }
|
|
78
78
|
# Source of tax liability.
|
|
79
79
|
field :tax_liability_source, Crystalline::Nilable.new(Models::Shared::TaxLiabilitySourceEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_liability_source'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::TaxLiabilitySourceEnum, true) } }
|
|
80
|
+
# Whether source amounts include tax. NULL means the source did not say.
|
|
81
|
+
field :is_tax_inclusive, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('is_tax_inclusive') } }
|
|
80
82
|
# Transaction lock status.
|
|
81
83
|
field :locked, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('locked') } }
|
|
82
84
|
# Connection Identifier
|
|
@@ -124,8 +126,8 @@ module KintsugiSDK
|
|
|
124
126
|
|
|
125
127
|
field :customer, Crystalline::Nilable.new(Models::Shared::CustomerCreate), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('customer') } }
|
|
126
128
|
|
|
127
|
-
sig { params(organization_id: ::String, external_id: ::String, date: ::DateTime, addresses: T::Array[Models::Shared::TransactionAddressBuilder], transaction_items: T::Array[Models::Shared::TransactionItemCreateUpdate], total_amount: T.nilable(T.any(::Float, ::String)), total_tax_amount_imported: T.nilable(T.any(::Float, ::String)), tax_rate_imported: T.nilable(T.any(::Float, ::String)), total_tax_amount_calculated: T.nilable(T.any(::Float, ::String)), tax_rate_calculated: T.nilable(T.any(::Float, ::String)), total_tax_liability_amount: T.nilable(T.any(::Float, ::String)), taxable_amount: T.nilable(T.any(::Float, ::String)), currency: T.nilable(Models::Shared::CurrencyEnum), source: T.nilable(Models::Shared::SourceEnum), status: T.nilable(Models::Shared::TransactionStatusEnum), address_status: T.nilable(Models::Shared::AddressStatus), processing_status: T.nilable(Models::Shared::ProcessingStatusEnum), requires_exemption: T.nilable(Models::Shared::ExemptionRequired), shop_date: T.nilable(::Date), shop_date_tz: T.nilable(::String), description: T.nilable(::String), refund_status: T.nilable(Models::Shared::TransactionRefundStatus), customer_id: T.nilable(::String), marketplace: T.nilable(T::Boolean), exempt: T.nilable(Models::Shared::TransactionExemptStatusEnum), exemptions: T.nilable(T::Array[Models::Shared::
|
|
128
|
-
def initialize(organization_id:, external_id:, date:, addresses:, transaction_items:, total_amount: nil, total_tax_amount_imported: nil, tax_rate_imported: nil, total_tax_amount_calculated: nil, tax_rate_calculated: nil, total_tax_liability_amount: nil, taxable_amount: nil, currency: nil, source: nil, status: nil, address_status: nil, processing_status: nil, requires_exemption: nil, shop_date: nil, shop_date_tz: nil, description: nil, refund_status: nil, customer_id: nil, marketplace: nil, exempt: nil, exemptions: nil, related_to: nil, secondary_external_id: nil, secondary_source: nil, external_friendly_id: nil, tax_liability_source: nil, locked: false, connection_id: nil, filing_id: nil, city: nil, county: nil, state: nil, country: nil, postal_code: nil, tax_id: nil, document_type: nil, created_from: nil, is_duplicate: false, destination_currency: nil, converted_total_amount: nil, converted_total_tax_amount_imported: nil, converted_total_tax_amount_calculated: nil, conversion_rate: nil, converted_taxable_amount: nil, converted_total_discount: nil, converted_subtotal: nil, converted_total_tax_liability_amount: nil, customer: nil)
|
|
129
|
+
sig { params(organization_id: ::String, external_id: ::String, date: ::DateTime, addresses: T::Array[Models::Shared::TransactionAddressBuilder], transaction_items: T::Array[Models::Shared::TransactionItemCreateUpdate], total_amount: T.nilable(T.any(::Float, ::String)), total_tax_amount_imported: T.nilable(T.any(::Float, ::String)), tax_rate_imported: T.nilable(T.any(::Float, ::String)), total_tax_amount_calculated: T.nilable(T.any(::Float, ::String)), tax_rate_calculated: T.nilable(T.any(::Float, ::String)), total_tax_liability_amount: T.nilable(T.any(::Float, ::String)), taxable_amount: T.nilable(T.any(::Float, ::String)), currency: T.nilable(Models::Shared::CurrencyEnum), source: T.nilable(Models::Shared::SourceEnum), status: T.nilable(Models::Shared::TransactionStatusEnum), address_status: T.nilable(Models::Shared::AddressStatus), processing_status: T.nilable(Models::Shared::ProcessingStatusEnum), requires_exemption: T.nilable(Models::Shared::ExemptionRequired), shop_date: T.nilable(::Date), shop_date_tz: T.nilable(::String), description: T.nilable(::String), refund_status: T.nilable(Models::Shared::TransactionRefundStatus), customer_id: T.nilable(::String), marketplace: T.nilable(T::Boolean), exempt: T.nilable(Models::Shared::TransactionExemptStatusEnum), exemptions: T.nilable(T::Array[Models::Shared::TransactionEmbeddedExemption]), related_to: T.nilable(::String), secondary_external_id: T.nilable(::String), secondary_source: T.nilable(::String), external_friendly_id: T.nilable(::String), tax_liability_source: T.nilable(Models::Shared::TaxLiabilitySourceEnum), is_tax_inclusive: T.nilable(T::Boolean), locked: T.nilable(T::Boolean), connection_id: T.nilable(::String), filing_id: T.nilable(::String), city: T.nilable(::String), county: T.nilable(::String), state: T.nilable(::String), country: T.nilable(Models::Shared::CountryCodeEnum), postal_code: T.nilable(::String), tax_id: T.nilable(::String), document_type: T.nilable(Models::Shared::DocumentTypeEnum), created_from: T.nilable(::String), is_duplicate: T.nilable(T::Boolean), destination_currency: T.nilable(Models::Shared::CurrencyEnum), converted_total_amount: T.nilable(T.any(::Float, ::String)), converted_total_tax_amount_imported: T.nilable(T.any(::Float, ::String)), converted_total_tax_amount_calculated: T.nilable(T.any(::Float, ::String)), conversion_rate: T.nilable(T.any(::Float, ::String)), converted_taxable_amount: T.nilable(T.any(::Float, ::String)), converted_total_discount: T.nilable(T.any(::Float, ::String)), converted_subtotal: T.nilable(T.any(::Float, ::String)), converted_total_tax_liability_amount: T.nilable(T.any(::Float, ::String)), customer: T.nilable(Models::Shared::CustomerCreate)).void }
|
|
130
|
+
def initialize(organization_id:, external_id:, date:, addresses:, transaction_items:, total_amount: nil, total_tax_amount_imported: nil, tax_rate_imported: nil, total_tax_amount_calculated: nil, tax_rate_calculated: nil, total_tax_liability_amount: nil, taxable_amount: nil, currency: nil, source: nil, status: nil, address_status: nil, processing_status: nil, requires_exemption: nil, shop_date: nil, shop_date_tz: nil, description: nil, refund_status: nil, customer_id: nil, marketplace: nil, exempt: nil, exemptions: nil, related_to: nil, secondary_external_id: nil, secondary_source: nil, external_friendly_id: nil, tax_liability_source: nil, is_tax_inclusive: nil, locked: false, connection_id: nil, filing_id: nil, city: nil, county: nil, state: nil, country: nil, postal_code: nil, tax_id: nil, document_type: nil, created_from: nil, is_duplicate: false, destination_currency: nil, converted_total_amount: nil, converted_total_tax_amount_imported: nil, converted_total_tax_amount_calculated: nil, conversion_rate: nil, converted_taxable_amount: nil, converted_total_discount: nil, converted_subtotal: nil, converted_total_tax_liability_amount: nil, customer: nil)
|
|
129
131
|
@organization_id = organization_id
|
|
130
132
|
@external_id = external_id
|
|
131
133
|
@date = date
|
|
@@ -157,6 +159,7 @@ module KintsugiSDK
|
|
|
157
159
|
@secondary_source = secondary_source
|
|
158
160
|
@external_friendly_id = external_friendly_id
|
|
159
161
|
@tax_liability_source = tax_liability_source
|
|
162
|
+
@is_tax_inclusive = is_tax_inclusive
|
|
160
163
|
@locked = locked
|
|
161
164
|
@connection_id = connection_id
|
|
162
165
|
@filing_id = filing_id
|
|
@@ -215,6 +218,7 @@ module KintsugiSDK
|
|
|
215
218
|
return false unless @secondary_source == other.secondary_source
|
|
216
219
|
return false unless @external_friendly_id == other.external_friendly_id
|
|
217
220
|
return false unless @tax_liability_source == other.tax_liability_source
|
|
221
|
+
return false unless @is_tax_inclusive == other.is_tax_inclusive
|
|
218
222
|
return false unless @locked == other.locked
|
|
219
223
|
return false unless @connection_id == other.connection_id
|
|
220
224
|
return false unless @filing_id == other.filing_id
|
|
@@ -70,6 +70,8 @@ class KintsugiSDK::Models::Shared::TransactionCreate
|
|
|
70
70
|
def external_friendly_id=(str_); end
|
|
71
71
|
def tax_liability_source(); end
|
|
72
72
|
def tax_liability_source=(str_); end
|
|
73
|
+
def is_tax_inclusive(); end
|
|
74
|
+
def is_tax_inclusive=(str_); end
|
|
73
75
|
def locked(); end
|
|
74
76
|
def locked=(str_); end
|
|
75
77
|
def connection_id(); end
|
|
@@ -7,8 +7,17 @@
|
|
|
7
7
|
module KintsugiSDK
|
|
8
8
|
module Models
|
|
9
9
|
module Shared
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
# Public read schema mirroring the ORM ``Exemption`` for /v1 transaction embedding.
|
|
11
|
+
#
|
|
12
|
+
# A non-table twin of ``exemptions.models.Exemption``: it re-declares the exact fields
|
|
13
|
+
# the ORM adds on top of ``ExemptionBase``/``TableBase`` (id, organization_id,
|
|
14
|
+
# certificate_import_id, source, certificate_type) so
|
|
15
|
+
# ``TransactionSerializerBase.exemptions`` can be
|
|
16
|
+
# typed without importing the private ORM model (CP-4895). Its serialized shape is
|
|
17
|
+
# byte-identical to the ORM's — ``from_attributes`` reads the same attributes off each
|
|
18
|
+
# ORM row — so the /v1 response payload is unchanged. Keep it in lockstep with
|
|
19
|
+
# ``Exemption`` if the ORM's public columns change (a JSON-schema parity test guards it).
|
|
20
|
+
class TransactionEmbeddedExemption
|
|
12
21
|
extend T::Sig
|
|
13
22
|
include Crystalline::MetadataFields
|
|
14
23
|
|
|
@@ -49,9 +58,11 @@ module KintsugiSDK
|
|
|
49
58
|
field :certificate_import_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('certificate_import_id') } }
|
|
50
59
|
# Source of exemption.
|
|
51
60
|
field :source, Crystalline::Nilable.new(Models::Shared::ExemptionSourceEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('source'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::ExemptionSourceEnum, true) } }
|
|
61
|
+
# Partial-exemption certificate form code. Null when the exemption is not a partial exemption.
|
|
62
|
+
field :certificate_type, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('certificate_type') } }
|
|
52
63
|
|
|
53
|
-
sig { params(exemption_type: Models::Shared::ExemptionType, start_date: ::Date, id: T.nilable(::String), created_at: T.nilable(::DateTime), organization_id: T.nilable(::String), updated_at: T.nilable(::DateTime), jurisdiction: T.nilable(::String), country_code: T.nilable(Models::Shared::CountryCodeEnum), end_date: T.nilable(::Date), customer_id: T.nilable(::String), transaction_id: T.nilable(::String), reseller: T.nilable(T::Boolean), fein: T.nilable(::String), sales_tax_id: T.nilable(::String), status: T.nilable(Models::Shared::ExemptionStatus), certificate_import_id: T.nilable(::String), source: T.nilable(Models::Shared::ExemptionSourceEnum)).void }
|
|
54
|
-
def initialize(exemption_type:, start_date:, id: nil, created_at: nil, organization_id: nil, updated_at: nil, jurisdiction: nil, country_code: nil, end_date: nil, customer_id: nil, transaction_id: nil, reseller: false, fein: nil, sales_tax_id: nil, status: nil, certificate_import_id: nil, source: nil)
|
|
64
|
+
sig { params(exemption_type: Models::Shared::ExemptionType, start_date: ::Date, id: T.nilable(::String), created_at: T.nilable(::DateTime), organization_id: T.nilable(::String), updated_at: T.nilable(::DateTime), jurisdiction: T.nilable(::String), country_code: T.nilable(Models::Shared::CountryCodeEnum), end_date: T.nilable(::Date), customer_id: T.nilable(::String), transaction_id: T.nilable(::String), reseller: T.nilable(T::Boolean), fein: T.nilable(::String), sales_tax_id: T.nilable(::String), status: T.nilable(Models::Shared::ExemptionStatus), certificate_import_id: T.nilable(::String), source: T.nilable(Models::Shared::ExemptionSourceEnum), certificate_type: T.nilable(::String)).void }
|
|
65
|
+
def initialize(exemption_type:, start_date:, id: nil, created_at: nil, organization_id: nil, updated_at: nil, jurisdiction: nil, country_code: nil, end_date: nil, customer_id: nil, transaction_id: nil, reseller: false, fein: nil, sales_tax_id: nil, status: nil, certificate_import_id: nil, source: nil, certificate_type: nil)
|
|
55
66
|
@exemption_type = exemption_type
|
|
56
67
|
@start_date = start_date
|
|
57
68
|
@id = id
|
|
@@ -69,6 +80,7 @@ module KintsugiSDK
|
|
|
69
80
|
@status = status
|
|
70
81
|
@certificate_import_id = certificate_import_id
|
|
71
82
|
@source = source
|
|
83
|
+
@certificate_type = certificate_type
|
|
72
84
|
end
|
|
73
85
|
|
|
74
86
|
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
@@ -91,6 +103,7 @@ module KintsugiSDK
|
|
|
91
103
|
return false unless @status == other.status
|
|
92
104
|
return false unless @certificate_import_id == other.certificate_import_id
|
|
93
105
|
return false unless @source == other.source
|
|
106
|
+
return false unless @certificate_type == other.certificate_type
|
|
94
107
|
true
|
|
95
108
|
end
|
|
96
109
|
end
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
class KintsugiSDK::Models::Shared::
|
|
5
|
+
class KintsugiSDK::Models::Shared::TransactionEmbeddedExemption
|
|
6
6
|
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class KintsugiSDK::Models::Shared::
|
|
10
|
+
class KintsugiSDK::Models::Shared::TransactionEmbeddedExemption
|
|
11
11
|
def exemption_type(); end
|
|
12
12
|
def exemption_type=(str_); end
|
|
13
13
|
def start_date(); end
|
|
@@ -42,4 +42,6 @@ class KintsugiSDK::Models::Shared::Exemption
|
|
|
42
42
|
def certificate_import_id=(str_); end
|
|
43
43
|
def source(); end
|
|
44
44
|
def source=(str_); end
|
|
45
|
+
def certificate_type(); end
|
|
46
|
+
def certificate_type=(str_); end
|
|
45
47
|
end
|
|
@@ -17,7 +17,7 @@ module KintsugiSDK
|
|
|
17
17
|
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': ::KintsugiSDK::Utils.datetime_from_iso_format(false) } }
|
|
18
18
|
# Unique identifier of this transaction in the source system.
|
|
19
19
|
field :external_id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('external_id'), required: true } }
|
|
20
|
-
|
|
20
|
+
# ISO-4217 currency code. Pair with a monetary amount on the same object.
|
|
21
21
|
field :currency, Models::Shared::CurrencyEnum, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('currency'), required: true, 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::CurrencyEnum, false) } }
|
|
22
22
|
# List of items involved in the transaction.
|
|
23
23
|
field :transaction_items, Crystalline::Array.new(Models::Shared::TransactionItemEstimateBase), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('transaction_items'), required: true } }
|
|
@@ -16,7 +16,7 @@ module KintsugiSDK
|
|
|
16
16
|
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': ::KintsugiSDK::Utils.datetime_from_iso_format(false) } }
|
|
17
17
|
# Unique identifier of this transaction in the source system.
|
|
18
18
|
field :external_id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('external_id'), required: true } }
|
|
19
|
-
|
|
19
|
+
# ISO-4217 currency code. Pair with a monetary amount on the same object.
|
|
20
20
|
field :currency, Models::Shared::CurrencyEnum, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('currency'), required: true, 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::CurrencyEnum, false) } }
|
|
21
21
|
|
|
22
22
|
field :transaction_items, Crystalline::Array.new(Models::Shared::TransactionItemEstimateResponse), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('transaction_items'), required: true } }
|
|
@@ -68,11 +68,13 @@ module KintsugiSDK
|
|
|
68
68
|
field :tax_exemption, Crystalline::Nilable.new(Models::Shared::TaxExemptionEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_exemption'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::TaxExemptionEnum, true) } }
|
|
69
69
|
# Indicates if the item is exempt.
|
|
70
70
|
field :exempt, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('exempt') } }
|
|
71
|
+
# Whether this line's source amount includes tax. NULL means the source did not say.
|
|
72
|
+
field :is_tax_inclusive, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('is_tax_inclusive') } }
|
|
71
73
|
|
|
72
74
|
field :discount_builder, Crystalline::Nilable.new(Models::Shared::DiscountBuilder), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('discount_builder') } }
|
|
73
75
|
|
|
74
|
-
sig { params(date: ::DateTime, external_product_id: ::String, organization_id: T.nilable(::String), quantity: T.nilable(T.any(::Float, ::String)), amount: T.nilable(T.any(::Float, ::String)), tax_amount_imported: T.nilable(T.any(::Float, ::String)), tax_rate_imported: T.nilable(T.any(::Float, ::String)), tax_amount_calculated: T.nilable(T.any(::Float, ::String)), tax_rate_calculated: T.nilable(T.any(::Float, ::String)), taxable_amount: T.nilable(T.any(::Float, ::String)), tax_items: T.nilable(T::Array[Models::Shared::TaxItemBuilder]), external_id: T.nilable(::String), description: T.nilable(::String), product: T.nilable(::String), product_id: T.nilable(::String), product_name: T.nilable(::String), product_description: T.nilable(::String), original_currency: T.nilable(Models::Shared::CurrencyEnum), destination_currency: T.nilable(Models::Shared::CurrencyEnum), converted_amount: T.nilable(T.any(::Float, ::String)), converted_taxable_amount: T.nilable(T.any(::Float, ::String)), converted_tax_amount_imported: T.nilable(T.any(::Float, ::String)), converted_tax_amount_calculated: T.nilable(T.any(::Float, ::String)), converted_total_discount: T.nilable(T.any(::Float, ::String)), converted_subtotal: T.nilable(T.any(::Float, ::String)), tax_exemption: T.nilable(Models::Shared::TaxExemptionEnum), exempt: T.nilable(T::Boolean), discount_builder: T.nilable(Models::Shared::DiscountBuilder)).void }
|
|
75
|
-
def initialize(date:, external_product_id:, organization_id: nil, quantity: nil, amount: nil, tax_amount_imported: nil, tax_rate_imported: nil, tax_amount_calculated: nil, tax_rate_calculated: nil, taxable_amount: nil, tax_items: nil, external_id: nil, description: nil, product: nil, product_id: nil, product_name: nil, product_description: nil, original_currency: nil, destination_currency: nil, converted_amount: nil, converted_taxable_amount: nil, converted_tax_amount_imported: nil, converted_tax_amount_calculated: nil, converted_total_discount: nil, converted_subtotal: nil, tax_exemption: nil, exempt: false, discount_builder: nil)
|
|
76
|
+
sig { params(date: ::DateTime, external_product_id: ::String, organization_id: T.nilable(::String), quantity: T.nilable(T.any(::Float, ::String)), amount: T.nilable(T.any(::Float, ::String)), tax_amount_imported: T.nilable(T.any(::Float, ::String)), tax_rate_imported: T.nilable(T.any(::Float, ::String)), tax_amount_calculated: T.nilable(T.any(::Float, ::String)), tax_rate_calculated: T.nilable(T.any(::Float, ::String)), taxable_amount: T.nilable(T.any(::Float, ::String)), tax_items: T.nilable(T::Array[Models::Shared::TaxItemBuilder]), external_id: T.nilable(::String), description: T.nilable(::String), product: T.nilable(::String), product_id: T.nilable(::String), product_name: T.nilable(::String), product_description: T.nilable(::String), original_currency: T.nilable(Models::Shared::CurrencyEnum), destination_currency: T.nilable(Models::Shared::CurrencyEnum), converted_amount: T.nilable(T.any(::Float, ::String)), converted_taxable_amount: T.nilable(T.any(::Float, ::String)), converted_tax_amount_imported: T.nilable(T.any(::Float, ::String)), converted_tax_amount_calculated: T.nilable(T.any(::Float, ::String)), converted_total_discount: T.nilable(T.any(::Float, ::String)), converted_subtotal: T.nilable(T.any(::Float, ::String)), tax_exemption: T.nilable(Models::Shared::TaxExemptionEnum), exempt: T.nilable(T::Boolean), is_tax_inclusive: T.nilable(T::Boolean), discount_builder: T.nilable(Models::Shared::DiscountBuilder)).void }
|
|
77
|
+
def initialize(date:, external_product_id:, organization_id: nil, quantity: nil, amount: nil, tax_amount_imported: nil, tax_rate_imported: nil, tax_amount_calculated: nil, tax_rate_calculated: nil, taxable_amount: nil, tax_items: nil, external_id: nil, description: nil, product: nil, product_id: nil, product_name: nil, product_description: nil, original_currency: nil, destination_currency: nil, converted_amount: nil, converted_taxable_amount: nil, converted_tax_amount_imported: nil, converted_tax_amount_calculated: nil, converted_total_discount: nil, converted_subtotal: nil, tax_exemption: nil, exempt: false, is_tax_inclusive: nil, discount_builder: nil)
|
|
76
78
|
@date = date
|
|
77
79
|
@external_product_id = external_product_id
|
|
78
80
|
@organization_id = organization_id
|
|
@@ -100,6 +102,7 @@ module KintsugiSDK
|
|
|
100
102
|
@converted_subtotal = converted_subtotal
|
|
101
103
|
@tax_exemption = tax_exemption
|
|
102
104
|
@exempt = exempt
|
|
105
|
+
@is_tax_inclusive = is_tax_inclusive
|
|
103
106
|
@discount_builder = discount_builder
|
|
104
107
|
end
|
|
105
108
|
|
|
@@ -133,6 +136,7 @@ module KintsugiSDK
|
|
|
133
136
|
return false unless @converted_subtotal == other.converted_subtotal
|
|
134
137
|
return false unless @tax_exemption == other.tax_exemption
|
|
135
138
|
return false unless @exempt == other.exempt
|
|
139
|
+
return false unless @is_tax_inclusive == other.is_tax_inclusive
|
|
136
140
|
return false unless @discount_builder == other.discount_builder
|
|
137
141
|
true
|
|
138
142
|
end
|
|
@@ -62,6 +62,8 @@ class KintsugiSDK::Models::Shared::TransactionItemBuilder
|
|
|
62
62
|
def tax_exemption=(str_); end
|
|
63
63
|
def exempt(); end
|
|
64
64
|
def exempt=(str_); end
|
|
65
|
+
def is_tax_inclusive(); end
|
|
66
|
+
def is_tax_inclusive=(str_); end
|
|
65
67
|
def discount_builder(); end
|
|
66
68
|
def discount_builder=(str_); end
|
|
67
69
|
end
|