kintsugi_sdk 5.5.12 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/crystalline/enum.rbi +17 -0
- data/lib/crystalline/metadata_fields.rb +94 -38
- data/lib/crystalline/module.rb +103 -13
- data/lib/crystalline/types.rb +100 -16
- data/lib/crystalline/utils.rb +13 -0
- data/lib/kintsugi_sdk/addressvalidation.rb +3 -3
- data/lib/kintsugi_sdk/customers.rb +10 -10
- data/lib/kintsugi_sdk/exemptions.rb +7 -7
- data/lib/kintsugi_sdk/models/errors/backend_src_address_validation_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_customers_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_exemptions_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_products_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_tax_estimation_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_transactions_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/errorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/httpvalidationerror.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/createtransactionbycustomer_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/estimate_tax_v1_tax_estimate_post_request.rb +2 -3
- data/lib/kintsugi_sdk/models/ops/get_customer_by_external_id_v1_customers_external_external_id_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_customer_by_id_v1_customers_customer_id_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_customers_v1_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_exemption_by_id_v1_exemptions_exemption_id_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_exemptions_v1_exemptions_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_nexus_for_org_v1_nexus_get_request.rb +12 -5
- data/lib/kintsugi_sdk/models/ops/get_nexus_for_org_v1_nexus_get_request.rbi +4 -0
- data/lib/kintsugi_sdk/models/ops/get_product_by_id_v1_products_product_id_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_transaction_by_id_v1_transactions_transaction_id_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_transactions_v1_transactions_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/getexemptionattachments_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionbyexternalid_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionsbycustomer_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionsbyfiling_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/search_v1_address_validation_search_post_security.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/update_customer_v1_customers_customer_id_put_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/update_product_v1_products_product_id_put_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/update_transaction_v1_transactions_transaction_id_put_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/uploadexemptioncert_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/addressbase.rb +1 -2
- data/lib/kintsugi_sdk/models/shared/addresses.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/addressresponsedata.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/addresssearchresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/addressstatus.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/addresssubmittedresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/addresstype.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/appliedto.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/attachmentread.rb +1 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_address_validation_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_customers_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_models_exemptionread.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_serializers_exemptionread.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/backend_src_products_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_tax_estimation_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_transactions_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/body_upload_exemption_certificate_v1_exemptions_exemption_id_attachments_post.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/countrycodeenum.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/currencyenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/customerbase.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customerbasebase.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customerbasepublic.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customercreate.rb +14 -7
- data/lib/kintsugi_sdk/models/shared/customercreate.rbi +4 -0
- data/lib/kintsugi_sdk/models/shared/customerread.rb +14 -7
- data/lib/kintsugi_sdk/models/shared/customerread.rbi +4 -0
- data/lib/kintsugi_sdk/models/shared/customertaxregistrationread.rb +52 -0
- data/lib/kintsugi_sdk/models/shared/customertaxregistrationread.rbi +23 -0
- data/lib/kintsugi_sdk/models/shared/customertaxtypeenum.rb +25 -0
- data/lib/kintsugi_sdk/models/shared/customertaxtypeenum.rbi +11 -0
- data/lib/kintsugi_sdk/models/shared/customerupdate.rb +10 -7
- data/lib/kintsugi_sdk/models/shared/customerupdate.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/discountbuilder.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/exemption.rb +5 -6
- data/lib/kintsugi_sdk/models/shared/exemptioncreate.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/exemptionrequired.rb +6 -5
- data/lib/kintsugi_sdk/models/shared/exemptionstatus.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/exemptiontype.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/fastapi_pagination_default_page_exemptionread_2.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/file.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/findthresholdcrossingtransactionstate.rb +56 -0
- data/lib/kintsugi_sdk/models/shared/findthresholdcrossingtransactionstate.rbi +25 -0
- data/lib/kintsugi_sdk/models/shared/jurisdictiontype.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/nexusresponse.rb +41 -26
- data/lib/kintsugi_sdk/models/shared/nexusresponse.rbi +10 -2
- data/lib/kintsugi_sdk/models/shared/nexusstateenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/nexusstatusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/nexustypeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/page_customerread_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/page_nexusresponse_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/page_transactionestimateresponse_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/page_transactionread_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/periodmodelenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/processingstatusenum.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/productread.rb +12 -9
- data/lib/kintsugi_sdk/models/shared/productstatusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/productupdate.rb +10 -7
- data/lib/kintsugi_sdk/models/shared/registration.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/registrationsregimeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/relatedentitytype.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/salesortransactionsenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/security.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/sourceenum.rb +10 -4
- data/lib/kintsugi_sdk/models/shared/statusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/taxexemptionenum.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/taxitembuilder.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/taxitemestimate.rb +1 -2
- data/lib/kintsugi_sdk/models/shared/taxitemread.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/taxitemreturnreasonenum.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/taxitemtypeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/taxliabilitysourceenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactionaddressbuilder.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/transactionaddresspublic.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/transactionaddressread_output.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/transactioncreate.rb +23 -19
- data/lib/kintsugi_sdk/models/shared/transactioncreate.rbi +2 -2
- data/lib/kintsugi_sdk/models/shared/transactionestimatepublicrequest.rb +6 -11
- data/lib/kintsugi_sdk/models/shared/transactionestimatepublicrequest.rbi +0 -2
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse.rb +7 -12
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse.rbi +0 -2
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse_addresses.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse_type.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactionexemptstatusenum.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/transactionitembuilder.rb +8 -7
- data/lib/kintsugi_sdk/models/shared/transactionitemcreateupdate.rb +8 -7
- data/lib/kintsugi_sdk/models/shared/transactionitemestimatebase.rb +9 -8
- data/lib/kintsugi_sdk/models/shared/transactionitemestimateresponse.rb +10 -9
- data/lib/kintsugi_sdk/models/shared/transactionitemread.rb +7 -6
- data/lib/kintsugi_sdk/models/shared/transactionpublicrequest.rb +21 -17
- data/lib/kintsugi_sdk/models/shared/transactionpublicrequest.rbi +2 -2
- data/lib/kintsugi_sdk/models/shared/transactionread.rb +24 -20
- data/lib/kintsugi_sdk/models/shared/transactionread.rbi +2 -2
- data/lib/kintsugi_sdk/models/shared/transactionrefundstatus.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactionstatusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactiontypeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactionupdate.rb +19 -60
- data/lib/kintsugi_sdk/models/shared/transactionupdate.rbi +2 -24
- data/lib/kintsugi_sdk/models/shared/treatmentenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/type.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/validationaddress.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/validationerror.rb +0 -1
- data/lib/kintsugi_sdk/models/shared.rb +3 -7
- data/lib/kintsugi_sdk/nexus.rb +1 -1
- data/lib/kintsugi_sdk/openapisdk.rb +13 -15
- data/lib/kintsugi_sdk/products.rb +6 -414
- data/lib/kintsugi_sdk/sdk_hooks/hooks.rb +0 -1
- data/lib/kintsugi_sdk/sdkconfiguration.rb +5 -10
- data/lib/kintsugi_sdk/taxestimation.rb +4 -4
- data/lib/kintsugi_sdk/transactions.rb +8 -8
- data/lib/kintsugi_sdk/utils/forms.rb +1 -1
- data/lib/kintsugi_sdk/utils/query_params.rb +4 -2
- data/lib/kintsugi_sdk/utils/request_bodies.rb +11 -6
- data/lib/kintsugi_sdk/utils/security.rb +10 -0
- data/lib/kintsugi_sdk/utils/url.rb +11 -5
- data/lib/kintsugi_sdk/utils/utils.rb +45 -3
- metadata +77 -41
- data/lib/kintsugi_sdk/models/ops/get_products_v1_products_get_request.rb +0 -61
- data/lib/kintsugi_sdk/models/ops/get_products_v1_products_get_request.rbi +0 -27
- data/lib/kintsugi_sdk/models/shared/page_productread_.rb +0 -49
- data/lib/kintsugi_sdk/models/shared/page_productread_.rbi +0 -21
- data/lib/kintsugi_sdk/models/shared/productcategories.rb +0 -38
- data/lib/kintsugi_sdk/models/shared/productcategories.rbi +0 -15
- data/lib/kintsugi_sdk/models/shared/productcategoryenum.rb +0 -25
- data/lib/kintsugi_sdk/models/shared/productcategoryenum.rbi +0 -11
- data/lib/kintsugi_sdk/models/shared/productcodeenum.rb +0 -82
- data/lib/kintsugi_sdk/models/shared/productcodeenum.rbi +0 -11
- data/lib/kintsugi_sdk/models/shared/productcreatemanual.rb +0 -61
- data/lib/kintsugi_sdk/models/shared/productcreatemanual.rbi +0 -27
- data/lib/kintsugi_sdk/models/shared/productsubcategory.rb +0 -46
- data/lib/kintsugi_sdk/models/shared/productsubcategory.rbi +0 -19
- data/lib/kintsugi_sdk/models/shared/productsubcategoryenum.rb +0 -83
- data/lib/kintsugi_sdk/models/shared/productsubcategoryenum.rbi +0 -11
|
@@ -7,19 +7,18 @@
|
|
|
7
7
|
module KintsugiSDK
|
|
8
8
|
module Models
|
|
9
9
|
module Shared
|
|
10
|
-
|
|
11
10
|
# Public request model for tax estimation API documentation.
|
|
12
|
-
# This model excludes internal fields like enriched_fields that should not be exposed in API docs.
|
|
11
|
+
# This model excludes internal fields like enriched_fields and total_amount that should not be exposed in API docs.
|
|
13
12
|
class TransactionEstimatePublicRequest
|
|
14
13
|
extend T::Sig
|
|
15
14
|
include Crystalline::MetadataFields
|
|
16
15
|
|
|
17
16
|
# The date of the transaction in ISO 8601 format (e.g., 2025-01-25T12:00:00Z).
|
|
18
|
-
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': Utils.datetime_from_iso_format(false) } }
|
|
17
|
+
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': ::KintsugiSDK::Utils.datetime_from_iso_format(false) } }
|
|
19
18
|
# Unique identifier of this transaction in the source system.
|
|
20
19
|
field :external_id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('external_id'), required: true } }
|
|
21
20
|
|
|
22
|
-
field :currency, Models::Shared::CurrencyEnum, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('currency'), required: true, 'decoder': Utils.enum_from_string(Models::Shared::CurrencyEnum, false) } }
|
|
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) } }
|
|
23
22
|
# List of items involved in the transaction.
|
|
24
23
|
field :transaction_items, Crystalline::Array.new(Models::Shared::TransactionItemEstimateBase), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('transaction_items'), required: true } }
|
|
25
24
|
# List of addresses related to the transaction. At least one BILL_TO or SHIP_TO address must be provided. The address will be validated during estimation, and the transaction may be rejected if the address does not pass validation. The SHIP_TO will be preferred to use for determining tax liability.
|
|
@@ -27,16 +26,14 @@ module KintsugiSDK
|
|
|
27
26
|
# An optional description of the transaction.
|
|
28
27
|
field :description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('description') } }
|
|
29
28
|
|
|
30
|
-
field :source, Crystalline::Nilable.new(Models::Shared::SourceEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('source'), 'decoder': Utils.enum_from_string(Models::Shared::SourceEnum, true) } }
|
|
29
|
+
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) } }
|
|
31
30
|
|
|
32
31
|
field :customer, Crystalline::Nilable.new(Models::Shared::CustomerBasePublic), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('customer') } }
|
|
33
|
-
# Total amount of the transaction.
|
|
34
|
-
field :total_amount, Crystalline::Nilable.new(::Float), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('total_amount') } }
|
|
35
32
|
# Indicates if the transaction involves a marketplace.
|
|
36
33
|
field :marketplace, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('marketplace') } }
|
|
37
34
|
|
|
38
|
-
sig { params(date: ::DateTime, external_id: ::String, currency: Models::Shared::CurrencyEnum, transaction_items: T::Array[Models::Shared::TransactionItemEstimateBase], addresses: T::Array[Models::Shared::Addresses], description: T.nilable(::String), source: T.nilable(Models::Shared::SourceEnum), customer: T.nilable(Models::Shared::CustomerBasePublic),
|
|
39
|
-
def initialize(date:, external_id:, currency:, transaction_items:, addresses:, description: nil, source: nil, customer: nil,
|
|
35
|
+
sig { params(date: ::DateTime, external_id: ::String, currency: Models::Shared::CurrencyEnum, transaction_items: T::Array[Models::Shared::TransactionItemEstimateBase], addresses: T::Array[Models::Shared::Addresses], description: T.nilable(::String), source: T.nilable(Models::Shared::SourceEnum), customer: T.nilable(Models::Shared::CustomerBasePublic), marketplace: T.nilable(T::Boolean)).void }
|
|
36
|
+
def initialize(date:, external_id:, currency:, transaction_items:, addresses:, description: nil, source: nil, customer: nil, marketplace: false)
|
|
40
37
|
@date = date
|
|
41
38
|
@external_id = external_id
|
|
42
39
|
@currency = currency
|
|
@@ -45,7 +42,6 @@ module KintsugiSDK
|
|
|
45
42
|
@description = description
|
|
46
43
|
@source = source
|
|
47
44
|
@customer = customer
|
|
48
|
-
@total_amount = total_amount
|
|
49
45
|
@marketplace = marketplace
|
|
50
46
|
end
|
|
51
47
|
|
|
@@ -60,7 +56,6 @@ module KintsugiSDK
|
|
|
60
56
|
return false unless @description == other.description
|
|
61
57
|
return false unless @source == other.source
|
|
62
58
|
return false unless @customer == other.customer
|
|
63
|
-
return false unless @total_amount == other.total_amount
|
|
64
59
|
return false unless @marketplace == other.marketplace
|
|
65
60
|
true
|
|
66
61
|
end
|
|
@@ -24,8 +24,6 @@ class KintsugiSDK::Models::Shared::TransactionEstimatePublicRequest
|
|
|
24
24
|
def source=(str_); end
|
|
25
25
|
def customer(); end
|
|
26
26
|
def customer=(str_); end
|
|
27
|
-
def total_amount(); end
|
|
28
|
-
def total_amount=(str_); end
|
|
29
27
|
def marketplace(); end
|
|
30
28
|
def marketplace=(str_); end
|
|
31
29
|
end
|
|
@@ -7,18 +7,17 @@
|
|
|
7
7
|
module KintsugiSDK
|
|
8
8
|
module Models
|
|
9
9
|
module Shared
|
|
10
|
-
|
|
11
10
|
|
|
12
11
|
class TransactionEstimateResponse
|
|
13
12
|
extend T::Sig
|
|
14
13
|
include Crystalline::MetadataFields
|
|
15
14
|
|
|
16
15
|
# The date of the transaction in ISO 8601 format (e.g., 2025-01-25T12:00:00Z).
|
|
17
|
-
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': Utils.datetime_from_iso_format(false) } }
|
|
16
|
+
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': ::KintsugiSDK::Utils.datetime_from_iso_format(false) } }
|
|
18
17
|
# Unique identifier of this transaction in the source system.
|
|
19
18
|
field :external_id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('external_id'), required: true } }
|
|
20
19
|
|
|
21
|
-
field :currency, Models::Shared::CurrencyEnum, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('currency'), required: true, 'decoder': Utils.enum_from_string(Models::Shared::CurrencyEnum, false) } }
|
|
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) } }
|
|
22
21
|
|
|
23
22
|
field :transaction_items, Crystalline::Array.new(Models::Shared::TransactionItemEstimateResponse), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('transaction_items'), required: true } }
|
|
24
23
|
# List of addresses related to the transaction. At least one BILL_TO or SHIP_TO address must be provided. The address will be validated during estimation, and the transaction may be rejected if the address does not pass validation. The SHIP_TO will be preferred to use for determining tax liability. **Deprecated:** Use of `address.status` in estimate api is ignored and will be removed in the future status will be considered UNVERIFIED by default and always validated
|
|
@@ -26,11 +25,9 @@ module KintsugiSDK
|
|
|
26
25
|
# An optional description of the transaction.
|
|
27
26
|
field :description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('description') } }
|
|
28
27
|
|
|
29
|
-
field :source, Crystalline::Nilable.new(Models::Shared::SourceEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('source'), 'decoder': Utils.enum_from_string(Models::Shared::SourceEnum, true) } }
|
|
28
|
+
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) } }
|
|
30
29
|
|
|
31
30
|
field :customer, Crystalline::Nilable.new(Models::Shared::CustomerBase), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('customer') } }
|
|
32
|
-
# Total amount of the transaction.
|
|
33
|
-
field :total_amount, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('total_amount') } }
|
|
34
31
|
# Indicates if the transaction involves a marketplace.
|
|
35
32
|
field :marketplace, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('marketplace') } }
|
|
36
33
|
# The total amount of tax determined for the transaction.
|
|
@@ -40,14 +37,14 @@ module KintsugiSDK
|
|
|
40
37
|
# The calculated tax rate for the transaction.
|
|
41
38
|
field :tax_rate_calculated, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_rate_calculated') } }
|
|
42
39
|
# Indicates if nexus was met for the transaction.**Deprecated:** Use `has_active_registration` instead.
|
|
43
|
-
#
|
|
44
|
-
# @deprecated
|
|
40
|
+
#
|
|
41
|
+
# @deprecated true: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
45
42
|
field :nexus_met, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('nexus_met') } }
|
|
46
43
|
# Indicates if there is an active registration for the transaction.
|
|
47
44
|
field :has_active_registration, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('has_active_registration') } }
|
|
48
45
|
|
|
49
|
-
sig { params(date: ::DateTime, external_id: ::String, currency: Models::Shared::CurrencyEnum, transaction_items: T::Array[Models::Shared::TransactionItemEstimateResponse], addresses: T::Array[Models::Shared::TransactionEstimateResponseAddresses], description: T.nilable(::String), source: T.nilable(Models::Shared::SourceEnum), customer: T.nilable(Models::Shared::CustomerBase),
|
|
50
|
-
def initialize(date:, external_id:, currency:, transaction_items:, addresses:, description: nil, source: nil, customer: nil,
|
|
46
|
+
sig { params(date: ::DateTime, external_id: ::String, currency: Models::Shared::CurrencyEnum, transaction_items: T::Array[Models::Shared::TransactionItemEstimateResponse], addresses: T::Array[Models::Shared::TransactionEstimateResponseAddresses], description: T.nilable(::String), source: T.nilable(Models::Shared::SourceEnum), customer: T.nilable(Models::Shared::CustomerBase), marketplace: T.nilable(T::Boolean), total_tax_amount_calculated: T.nilable(::String), taxable_amount: T.nilable(::String), tax_rate_calculated: T.nilable(::String), nexus_met: T.nilable(T::Boolean), has_active_registration: T.nilable(T::Boolean)).void }
|
|
47
|
+
def initialize(date:, external_id:, currency:, transaction_items:, addresses:, description: nil, source: nil, customer: nil, marketplace: false, total_tax_amount_calculated: '0.00', taxable_amount: '0.00', tax_rate_calculated: '0.00', nexus_met: false, has_active_registration: false)
|
|
51
48
|
@date = date
|
|
52
49
|
@external_id = external_id
|
|
53
50
|
@currency = currency
|
|
@@ -56,7 +53,6 @@ module KintsugiSDK
|
|
|
56
53
|
@description = description
|
|
57
54
|
@source = source
|
|
58
55
|
@customer = customer
|
|
59
|
-
@total_amount = total_amount
|
|
60
56
|
@marketplace = marketplace
|
|
61
57
|
@total_tax_amount_calculated = total_tax_amount_calculated
|
|
62
58
|
@taxable_amount = taxable_amount
|
|
@@ -76,7 +72,6 @@ module KintsugiSDK
|
|
|
76
72
|
return false unless @description == other.description
|
|
77
73
|
return false unless @source == other.source
|
|
78
74
|
return false unless @customer == other.customer
|
|
79
|
-
return false unless @total_amount == other.total_amount
|
|
80
75
|
return false unless @marketplace == other.marketplace
|
|
81
76
|
return false unless @total_tax_amount_calculated == other.total_tax_amount_calculated
|
|
82
77
|
return false unless @taxable_amount == other.taxable_amount
|
|
@@ -24,8 +24,6 @@ class KintsugiSDK::Models::Shared::TransactionEstimateResponse
|
|
|
24
24
|
def source=(str_); end
|
|
25
25
|
def customer(); end
|
|
26
26
|
def customer=(str_); end
|
|
27
|
-
def total_amount(); end
|
|
28
|
-
def total_amount=(str_); end
|
|
29
27
|
def marketplace(); end
|
|
30
28
|
def marketplace=(str_); end
|
|
31
29
|
def total_tax_amount_calculated(); end
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
module KintsugiSDK
|
|
8
8
|
module Models
|
|
9
9
|
module Shared
|
|
10
|
-
|
|
11
10
|
|
|
12
11
|
class TransactionEstimateResponseAddresses
|
|
13
12
|
extend T::Sig
|
|
@@ -15,7 +14,7 @@ module KintsugiSDK
|
|
|
15
14
|
|
|
16
15
|
# Type of the address. Must be either
|
|
17
16
|
# SHIP_TO or BILL_TO.
|
|
18
|
-
field :type, Models::Shared::TransactionEstimateResponseType, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('type'), required: true, 'decoder': Utils.enum_from_string(Models::Shared::TransactionEstimateResponseType, false) } }
|
|
17
|
+
field :type, Models::Shared::TransactionEstimateResponseType, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('type'), required: true, 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::TransactionEstimateResponseType, false) } }
|
|
19
18
|
# State or province of the address.
|
|
20
19
|
field :state, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('state'), required: true } }
|
|
21
20
|
# Postal code of the address.
|
|
@@ -35,8 +34,8 @@ module KintsugiSDK
|
|
|
35
34
|
# Complete address string of the customer, which can be used as an alternative to individual fields.
|
|
36
35
|
field :full_address, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('full_address') } }
|
|
37
36
|
# Status of the address. Deprecated and ignored.
|
|
38
|
-
#
|
|
39
|
-
# @deprecated
|
|
37
|
+
#
|
|
38
|
+
# @deprecated true: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
40
39
|
field :status, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('status') } }
|
|
41
40
|
# Additional enriched fields related to the address.
|
|
42
41
|
field :enriched_fields, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('enriched_fields') } }
|
|
@@ -7,12 +7,9 @@
|
|
|
7
7
|
module KintsugiSDK
|
|
8
8
|
module Models
|
|
9
9
|
module Shared
|
|
10
|
-
|
|
11
10
|
# TransactionEstimateResponseType - Type of the address. Must be either
|
|
12
11
|
# SHIP_TO or BILL_TO.
|
|
13
12
|
class TransactionEstimateResponseType < T::Enum
|
|
14
|
-
|
|
15
|
-
|
|
16
13
|
enums do
|
|
17
14
|
SHIP_TO = new('SHIP_TO')
|
|
18
15
|
BILL_TO = new('BILL_TO')
|
|
@@ -7,18 +7,17 @@
|
|
|
7
7
|
module KintsugiSDK
|
|
8
8
|
module Models
|
|
9
9
|
module Shared
|
|
10
|
-
|
|
11
10
|
# TransactionExemptStatusEnum - Based on transaction item exempt status.
|
|
12
11
|
# NOT EXEMPT: None of the items are NOT EXEMPT
|
|
13
12
|
# PARTIALLY EXEMPT: At least some of the items are NOT EXEMPT
|
|
14
13
|
# FULLY_EXEMPT: All items sold in the transaction are EXEMPT
|
|
14
|
+
# ZERO_RATE_NOT_EXEMPT: All items sold in the transaction are zero-rated
|
|
15
15
|
class TransactionExemptStatusEnum < T::Enum
|
|
16
|
-
|
|
17
|
-
|
|
18
16
|
enums do
|
|
19
17
|
NOT_EXEMPT = new('NOT_EXEMPT')
|
|
20
18
|
PARTIALLY_EXEMPT = new('PARTIALLY_EXEMPT')
|
|
21
19
|
FULLY_EXEMPT = new('FULLY_EXEMPT')
|
|
20
|
+
ZERO_RATE_NOT_EXEMPT = new('ZERO_RATE_NOT_EXEMPT')
|
|
22
21
|
end
|
|
23
22
|
end
|
|
24
23
|
end
|
|
@@ -7,16 +7,17 @@
|
|
|
7
7
|
module KintsugiSDK
|
|
8
8
|
module Models
|
|
9
9
|
module Shared
|
|
10
|
-
|
|
11
10
|
|
|
12
11
|
class TransactionItemBuilder
|
|
13
12
|
extend T::Sig
|
|
14
13
|
include Crystalline::MetadataFields
|
|
15
14
|
|
|
16
|
-
#
|
|
15
|
+
# Unique identifier of the organization. This field is deprecated, and should no longer be used. The value is populated through the 'x-organization-id' header.
|
|
16
|
+
#
|
|
17
|
+
# @deprecated true: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
17
18
|
field :organization_id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('organization_id'), required: true } }
|
|
18
19
|
# Date/time of item.
|
|
19
|
-
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': Utils.datetime_from_iso_format(false) } }
|
|
20
|
+
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': ::KintsugiSDK::Utils.datetime_from_iso_format(false) } }
|
|
20
21
|
# External product identifier.
|
|
21
22
|
field :external_product_id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('external_product_id'), required: true } }
|
|
22
23
|
# External item identifier.
|
|
@@ -32,9 +33,9 @@ module KintsugiSDK
|
|
|
32
33
|
# Product description
|
|
33
34
|
field :product_description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_description') } }
|
|
34
35
|
|
|
35
|
-
field :original_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('original_currency'), 'decoder': Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
36
|
+
field :original_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('original_currency'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
36
37
|
|
|
37
|
-
field :destination_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('destination_currency'), 'decoder': Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
38
|
+
field :destination_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('destination_currency'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
38
39
|
# Converted item amount.
|
|
39
40
|
field :converted_amount, Crystalline::Nilable.new(::Float), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('converted_amount') } }
|
|
40
41
|
# Converted taxable amount.
|
|
@@ -48,7 +49,7 @@ module KintsugiSDK
|
|
|
48
49
|
# Converted subtotal amount.
|
|
49
50
|
field :converted_subtotal, Crystalline::Nilable.new(::Float), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('converted_subtotal') } }
|
|
50
51
|
# This enum is used to determine if a transaction is exempt from tax.
|
|
51
|
-
field :tax_exemption, Crystalline::Nilable.new(Models::Shared::TaxExemptionEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_exemption'), 'decoder': Utils.enum_from_string(Models::Shared::TaxExemptionEnum, true) } }
|
|
52
|
+
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) } }
|
|
52
53
|
|
|
53
54
|
field :tax_items, Crystalline::Nilable.new(Crystalline::Array.new(Models::Shared::TaxItemBuilder)), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_items') } }
|
|
54
55
|
|
|
@@ -71,7 +72,7 @@ module KintsugiSDK
|
|
|
71
72
|
field :exempt, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('exempt') } }
|
|
72
73
|
|
|
73
74
|
sig { params(organization_id: ::String, date: ::DateTime, external_product_id: ::String, 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(::Float), converted_taxable_amount: T.nilable(::Float), converted_tax_amount_imported: T.nilable(::Float), converted_tax_amount_calculated: T.nilable(::Float), converted_total_discount: T.nilable(::Float), converted_subtotal: T.nilable(::Float), tax_exemption: T.nilable(Models::Shared::TaxExemptionEnum), tax_items: T.nilable(T::Array[Models::Shared::TaxItemBuilder]), discount_builder: T.nilable(Models::Shared::DiscountBuilder), quantity: T.nilable(::Float), amount: T.nilable(::Float), tax_amount_imported: T.nilable(::Float), tax_rate_imported: T.nilable(::Float), tax_amount_calculated: T.nilable(::Float), tax_rate_calculated: T.nilable(::Float), taxable_amount: T.nilable(::Float), exempt: T.nilable(T::Boolean)).void }
|
|
74
|
-
def initialize(organization_id:, date:, external_product_id:, 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, tax_items: nil, discount_builder: nil, quantity: 1.0, amount: 0.
|
|
75
|
+
def initialize(organization_id:, date:, external_product_id:, 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, tax_items: nil, discount_builder: nil, quantity: 1.0, amount: 0.0, tax_amount_imported: 0.0, tax_rate_imported: 0.0, tax_amount_calculated: 0.0, tax_rate_calculated: 0.0, taxable_amount: 0.0, exempt: false)
|
|
75
76
|
@organization_id = organization_id
|
|
76
77
|
@date = date
|
|
77
78
|
@external_product_id = external_product_id
|
|
@@ -7,16 +7,17 @@
|
|
|
7
7
|
module KintsugiSDK
|
|
8
8
|
module Models
|
|
9
9
|
module Shared
|
|
10
|
-
|
|
11
10
|
|
|
12
11
|
class TransactionItemCreateUpdate
|
|
13
12
|
extend T::Sig
|
|
14
13
|
include Crystalline::MetadataFields
|
|
15
14
|
|
|
16
|
-
#
|
|
15
|
+
# Unique identifier of the organization. This field is deprecated, and should no longer be used. The value is populated through the 'x-organization-id' header.
|
|
16
|
+
#
|
|
17
|
+
# @deprecated true: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
17
18
|
field :organization_id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('organization_id'), required: true } }
|
|
18
19
|
# Date/time of item.
|
|
19
|
-
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': Utils.datetime_from_iso_format(false) } }
|
|
20
|
+
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': ::KintsugiSDK::Utils.datetime_from_iso_format(false) } }
|
|
20
21
|
# External product identifier.
|
|
21
22
|
field :external_product_id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('external_product_id'), required: true } }
|
|
22
23
|
# External item identifier.
|
|
@@ -32,9 +33,9 @@ module KintsugiSDK
|
|
|
32
33
|
# Product description
|
|
33
34
|
field :product_description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_description') } }
|
|
34
35
|
|
|
35
|
-
field :original_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('original_currency'), 'decoder': Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
36
|
+
field :original_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('original_currency'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
36
37
|
|
|
37
|
-
field :destination_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('destination_currency'), 'decoder': Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
38
|
+
field :destination_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('destination_currency'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
38
39
|
# Converted item amount.
|
|
39
40
|
field :converted_amount, Crystalline::Nilable.new(::Float), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('converted_amount') } }
|
|
40
41
|
# Converted taxable amount.
|
|
@@ -48,7 +49,7 @@ module KintsugiSDK
|
|
|
48
49
|
# Converted subtotal amount.
|
|
49
50
|
field :converted_subtotal, Crystalline::Nilable.new(::Float), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('converted_subtotal') } }
|
|
50
51
|
# This enum is used to determine if a transaction is exempt from tax.
|
|
51
|
-
field :tax_exemption, Crystalline::Nilable.new(Models::Shared::TaxExemptionEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_exemption'), 'decoder': Utils.enum_from_string(Models::Shared::TaxExemptionEnum, true) } }
|
|
52
|
+
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) } }
|
|
52
53
|
|
|
53
54
|
field :tax_items, Crystalline::Nilable.new(Crystalline::Array.new(Models::Shared::TaxItemBuilder)), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_items') } }
|
|
54
55
|
|
|
@@ -71,7 +72,7 @@ module KintsugiSDK
|
|
|
71
72
|
field :exempt, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('exempt') } }
|
|
72
73
|
|
|
73
74
|
sig { params(organization_id: ::String, date: ::DateTime, external_product_id: ::String, 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(::Float), converted_taxable_amount: T.nilable(::Float), converted_tax_amount_imported: T.nilable(::Float), converted_tax_amount_calculated: T.nilable(::Float), converted_total_discount: T.nilable(::Float), converted_subtotal: T.nilable(::Float), tax_exemption: T.nilable(Models::Shared::TaxExemptionEnum), tax_items: T.nilable(T::Array[Models::Shared::TaxItemBuilder]), discount_builder: T.nilable(Models::Shared::DiscountBuilder), quantity: T.nilable(::Float), amount: T.nilable(::Float), tax_amount_imported: T.nilable(::Float), tax_rate_imported: T.nilable(::Float), tax_amount_calculated: T.nilable(::Float), tax_rate_calculated: T.nilable(::Float), taxable_amount: T.nilable(::Float), exempt: T.nilable(T::Boolean)).void }
|
|
74
|
-
def initialize(organization_id:, date:, external_product_id:, 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, tax_items: nil, discount_builder: nil, quantity: 1.0, amount: 0.
|
|
75
|
+
def initialize(organization_id:, date:, external_product_id:, 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, tax_items: nil, discount_builder: nil, quantity: 1.0, amount: 0.0, tax_amount_imported: 0.0, tax_rate_imported: 0.0, tax_amount_calculated: 0.0, tax_rate_calculated: 0.0, taxable_amount: 0.0, exempt: false)
|
|
75
76
|
@organization_id = organization_id
|
|
76
77
|
@date = date
|
|
77
78
|
@external_product_id = external_product_id
|
|
@@ -7,14 +7,13 @@
|
|
|
7
7
|
module KintsugiSDK
|
|
8
8
|
module Models
|
|
9
9
|
module Shared
|
|
10
|
-
|
|
11
10
|
|
|
12
11
|
class TransactionItemEstimateBase
|
|
13
12
|
extend T::Sig
|
|
14
13
|
include Crystalline::MetadataFields
|
|
15
14
|
|
|
16
15
|
# The date of the transaction item.
|
|
17
|
-
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': Utils.datetime_from_iso_format(false) } }
|
|
16
|
+
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': ::KintsugiSDK::Utils.datetime_from_iso_format(false) } }
|
|
18
17
|
# The total amount of the item.
|
|
19
18
|
field :amount, ::Float, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('amount'), required: true } }
|
|
20
19
|
# A unique identifier for the transaction item.
|
|
@@ -29,17 +28,19 @@ module KintsugiSDK
|
|
|
29
28
|
# Description of the product. Used if creating a new product.
|
|
30
29
|
field :product_description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_description') } }
|
|
31
30
|
|
|
32
|
-
field :product_source, Crystalline::Nilable.new(Models::Shared::SourceEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_source'), 'decoder': Utils.enum_from_string(Models::Shared::SourceEnum, true) } }
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
field :product_source, Crystalline::Nilable.new(Models::Shared::SourceEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_source'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::SourceEnum, true) } }
|
|
32
|
+
# Subcategory of the product. Required if product_category is used
|
|
33
|
+
# in place of external_product_id.
|
|
34
|
+
field :product_subcategory, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_subcategory') } }
|
|
35
|
+
# Category of the product. Required if product_subcategory is used
|
|
36
|
+
# in place of external_product_id.
|
|
37
|
+
field :product_category, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_category') } }
|
|
37
38
|
# Defaults to 1.0. The quantity of the item.
|
|
38
39
|
field :quantity, Crystalline::Nilable.new(::Float), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('quantity') } }
|
|
39
40
|
# Defaults to false. Indicates whether the item is exempt from tax.
|
|
40
41
|
field :exempt, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('exempt') } }
|
|
41
42
|
|
|
42
|
-
sig { params(date: ::DateTime, amount: ::Float, external_id: T.nilable(::String), description: T.nilable(::String), external_product_id: T.nilable(::String), product_name: T.nilable(::String), product_description: T.nilable(::String), product_source: T.nilable(Models::Shared::SourceEnum), product_subcategory: T.nilable(
|
|
43
|
+
sig { params(date: ::DateTime, amount: ::Float, external_id: T.nilable(::String), description: T.nilable(::String), external_product_id: T.nilable(::String), product_name: T.nilable(::String), product_description: T.nilable(::String), product_source: T.nilable(Models::Shared::SourceEnum), product_subcategory: T.nilable(::String), product_category: T.nilable(::String), quantity: T.nilable(::Float), exempt: T.nilable(T::Boolean)).void }
|
|
43
44
|
def initialize(date:, amount:, external_id: nil, description: nil, external_product_id: nil, product_name: nil, product_description: nil, product_source: nil, product_subcategory: nil, product_category: nil, quantity: 1.0, exempt: false)
|
|
44
45
|
@date = date
|
|
45
46
|
@amount = amount
|
|
@@ -7,14 +7,13 @@
|
|
|
7
7
|
module KintsugiSDK
|
|
8
8
|
module Models
|
|
9
9
|
module Shared
|
|
10
|
-
|
|
11
10
|
|
|
12
11
|
class TransactionItemEstimateResponse
|
|
13
12
|
extend T::Sig
|
|
14
13
|
include Crystalline::MetadataFields
|
|
15
14
|
|
|
16
15
|
# The date of the transaction item.
|
|
17
|
-
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': Utils.datetime_from_iso_format(false) } }
|
|
16
|
+
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': ::KintsugiSDK::Utils.datetime_from_iso_format(false) } }
|
|
18
17
|
# The total amount of the item.
|
|
19
18
|
field :amount, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('amount'), required: true } }
|
|
20
19
|
# A unique identifier for the transaction item.
|
|
@@ -29,13 +28,15 @@ module KintsugiSDK
|
|
|
29
28
|
# Description of the product. Used if creating a new product.
|
|
30
29
|
field :product_description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_description') } }
|
|
31
30
|
|
|
32
|
-
field :product_source, Crystalline::Nilable.new(Models::Shared::SourceEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_source'), 'decoder': Utils.enum_from_string(Models::Shared::SourceEnum, true) } }
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
field :product_source, Crystalline::Nilable.new(Models::Shared::SourceEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_source'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::SourceEnum, true) } }
|
|
32
|
+
# Subcategory of the product. Required if product_category is used
|
|
33
|
+
# in place of external_product_id.
|
|
34
|
+
field :product_subcategory, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_subcategory') } }
|
|
35
|
+
# Category of the product. Required if product_subcategory is used
|
|
36
|
+
# in place of external_product_id.
|
|
37
|
+
field :product_category, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_category') } }
|
|
37
38
|
# This enum is used to determine if a transaction is exempt from tax.
|
|
38
|
-
field :exempt_reason, Crystalline::Nilable.new(Models::Shared::TaxExemptionEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('exempt_reason'), 'decoder': Utils.enum_from_string(Models::Shared::TaxExemptionEnum, true) } }
|
|
39
|
+
field :exempt_reason, Crystalline::Nilable.new(Models::Shared::TaxExemptionEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('exempt_reason'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::TaxExemptionEnum, true) } }
|
|
39
40
|
# List of tax items applied to the transaction item.
|
|
40
41
|
field :tax_items, Crystalline::Nilable.new(Crystalline::Array.new(Models::Shared::TaxItemEstimate)), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_items') } }
|
|
41
42
|
# Defaults to 1.0. The quantity of the item.
|
|
@@ -49,7 +50,7 @@ module KintsugiSDK
|
|
|
49
50
|
# The tax rate applied to the transaction item.
|
|
50
51
|
field :tax_rate, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_rate') } }
|
|
51
52
|
|
|
52
|
-
sig { params(date: ::DateTime, amount: ::String, external_id: T.nilable(::String), description: T.nilable(::String), external_product_id: T.nilable(::String), product_name: T.nilable(::String), product_description: T.nilable(::String), product_source: T.nilable(Models::Shared::SourceEnum), product_subcategory: T.nilable(
|
|
53
|
+
sig { params(date: ::DateTime, amount: ::String, external_id: T.nilable(::String), description: T.nilable(::String), external_product_id: T.nilable(::String), product_name: T.nilable(::String), product_description: T.nilable(::String), product_source: T.nilable(Models::Shared::SourceEnum), product_subcategory: T.nilable(::String), product_category: T.nilable(::String), exempt_reason: T.nilable(Models::Shared::TaxExemptionEnum), tax_items: T.nilable(T::Array[Models::Shared::TaxItemEstimate]), quantity: T.nilable(::String), exempt: T.nilable(T::Boolean), tax_amount: T.nilable(::String), taxable_amount: T.nilable(::String), tax_rate: T.nilable(::String)).void }
|
|
53
54
|
def initialize(date:, amount:, external_id: nil, description: nil, external_product_id: nil, product_name: nil, product_description: nil, product_source: nil, product_subcategory: nil, product_category: nil, exempt_reason: nil, tax_items: nil, quantity: '1.0', exempt: false, tax_amount: '0.00', taxable_amount: '0.00', tax_rate: '0.00')
|
|
54
55
|
@date = date
|
|
55
56
|
@amount = amount
|
|
@@ -7,16 +7,17 @@
|
|
|
7
7
|
module KintsugiSDK
|
|
8
8
|
module Models
|
|
9
9
|
module Shared
|
|
10
|
-
|
|
11
10
|
|
|
12
11
|
class TransactionItemRead
|
|
13
12
|
extend T::Sig
|
|
14
13
|
include Crystalline::MetadataFields
|
|
15
14
|
|
|
16
|
-
#
|
|
15
|
+
# Unique identifier of the organization. This field is deprecated, and should no longer be used. The value is populated through the 'x-organization-id' header.
|
|
16
|
+
#
|
|
17
|
+
# @deprecated true: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
17
18
|
field :organization_id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('organization_id'), required: true } }
|
|
18
19
|
# Date/time of item.
|
|
19
|
-
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': Utils.datetime_from_iso_format(false) } }
|
|
20
|
+
field :date, ::DateTime, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('date'), required: true, 'decoder': ::KintsugiSDK::Utils.datetime_from_iso_format(false) } }
|
|
20
21
|
# External product identifier.
|
|
21
22
|
field :external_product_id, ::String, { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('external_product_id'), required: true } }
|
|
22
23
|
# The unique transaction item identifier.
|
|
@@ -36,9 +37,9 @@ module KintsugiSDK
|
|
|
36
37
|
# Product description
|
|
37
38
|
field :product_description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('product_description') } }
|
|
38
39
|
|
|
39
|
-
field :original_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('original_currency'), 'decoder': Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
40
|
+
field :original_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('original_currency'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
40
41
|
|
|
41
|
-
field :destination_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('destination_currency'), 'decoder': Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
42
|
+
field :destination_currency, Crystalline::Nilable.new(Models::Shared::CurrencyEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('destination_currency'), 'decoder': ::KintsugiSDK::Utils.enum_from_string(Models::Shared::CurrencyEnum, true) } }
|
|
42
43
|
# Converted item amount.
|
|
43
44
|
field :converted_amount, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('converted_amount') } }
|
|
44
45
|
# Converted taxable amount.
|
|
@@ -52,7 +53,7 @@ module KintsugiSDK
|
|
|
52
53
|
# Converted subtotal amount.
|
|
53
54
|
field :converted_subtotal, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('converted_subtotal') } }
|
|
54
55
|
# This enum is used to determine if a transaction is exempt from tax.
|
|
55
|
-
field :tax_exemption, Crystalline::Nilable.new(Models::Shared::TaxExemptionEnum), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('tax_exemption'), 'decoder': Utils.enum_from_string(Models::Shared::TaxExemptionEnum, true) } }
|
|
56
|
+
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) } }
|
|
56
57
|
# Total discount amount applied to this transaction item.
|
|
57
58
|
field :total_discount, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::KintsugiSDK::Utils.field_name('total_discount') } }
|
|
58
59
|
# Subtotal amount before any discount is applied.
|