vatsense 0.1.1 → 0.2.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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/lib/vatsense/internal/util.rb +3 -1
  4. data/lib/vatsense/models/create_invoice.rb +9 -1
  5. data/lib/vatsense/models/invoice.rb +11 -3
  6. data/lib/vatsense/models/invoice_create_params.rb +13 -1
  7. data/lib/vatsense/models/rate_list_params.rb +10 -1
  8. data/lib/vatsense/models/usage_retrieve_response.rb +4 -4
  9. data/lib/vatsense/models/validate_check_params.rb +36 -1
  10. data/lib/vatsense/models/validate_check_response.rb +63 -1
  11. data/lib/vatsense/resources/invoice.rb +8 -2
  12. data/lib/vatsense/resources/rates.rb +1 -1
  13. data/lib/vatsense/resources/validate.rb +7 -2
  14. data/lib/vatsense/version.rb +1 -1
  15. data/rbi/vatsense/models/create_invoice.rbi +9 -0
  16. data/rbi/vatsense/models/invoice.rbi +12 -2
  17. data/rbi/vatsense/models/invoice_create_params.rbi +17 -5
  18. data/rbi/vatsense/models/rate_list_params.rbi +13 -0
  19. data/rbi/vatsense/models/usage_retrieve_response.rbi +4 -4
  20. data/rbi/vatsense/models/validate_check_params.rbi +55 -0
  21. data/rbi/vatsense/models/validate_check_response.rbi +140 -0
  22. data/rbi/vatsense/resources/invoice.rbi +4 -0
  23. data/rbi/vatsense/resources/rates.rbi +2 -0
  24. data/rbi/vatsense/resources/validate.rbi +16 -1
  25. data/sig/vatsense/models/create_invoice.rbs +6 -1
  26. data/sig/vatsense/models/invoice.rbs +8 -1
  27. data/sig/vatsense/models/invoice_create_params.rbs +13 -3
  28. data/sig/vatsense/models/rate_list_params.rbs +7 -1
  29. data/sig/vatsense/models/validate_check_params.rbs +31 -1
  30. data/sig/vatsense/models/validate_check_response.rbs +58 -0
  31. data/sig/vatsense/resources/invoice.rbs +2 -0
  32. data/sig/vatsense/resources/rates.rbs +1 -0
  33. data/sig/vatsense/resources/validate.rbs +5 -0
  34. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6cbb8615a5f3366f1abe2d7ccd2c4eae2dbcc4ef9b85f72f2ea990e9aafd3d5
4
- data.tar.gz: 97a498b7db5317fda34e1e4bcd508fc85a0654a1b64f4b1eac5d777b0cb2ab54
3
+ metadata.gz: 164e2707a56b5c4cb03e6fc79015f96aa3133f13458e6701409826106e6c9013
4
+ data.tar.gz: 56cd48fe7321d39b764b31a1b8a3a46337381885ce4a0f0d61139ab837918052
5
5
  SHA512:
6
- metadata.gz: 4ad0aaec6739477762e8d267919cf07fd3c863577c2394d982d99805804e7231fc318b09406d2e8cdef0d04c2fc432d14d0ab31bd7f267d15b6ae6f7318c7af2
7
- data.tar.gz: 510b64b88384f3440a3f811588f428f0f8cb808c284ce4f2e419cad596d73a007e733984aa3ac1cd0db659870b96af0a51e967e192bddcf6e80b3c55870c70d4
6
+ metadata.gz: 29cff49844c554c4972a2ee7f70b4d7b9858a595b7e07f277b17d6cc5831f33f48ec20dee21b887f643aab9bde21aad97c8d4f37515efc1270980f6d42064fb6
7
+ data.tar.gz: 886a0191c3a69fa2e81d50b2c8a8148c43f20a96b8ec8c1b88c2f83ed394116ab1f8bc27bfc20a55d5d3c75c1e7c8d0a874c461912f1aec124519126a60713f2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.0](https://github.com/VAT-Sense/vatsense-ruby/compare/v0.1.2...v0.2.0) (2026-11-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** company matching, provinces filter, Idempotency-Key and credit notes ([#5](https://github.com/VAT-Sense/vatsense-ruby/issues/5)) ([99de989](https://github.com/VAT-Sense/vatsense-ruby/commit/99de9895018cc3e8945d77958891a393d2c5bfc6))
9
+
10
+ ## 0.1.2 (2026-04-09)
11
+
12
+ Full Changelog: [v0.1.1...v0.1.2](https://github.com/VAT-Sense/vatsense-ruby/compare/v0.1.1...v0.1.2)
13
+
14
+ ### Bug Fixes
15
+
16
+ * multipart encoding for file arrays ([2dc86da](https://github.com/VAT-Sense/vatsense-ruby/commit/2dc86da62c4a9698622242616f0f27878155d035))
17
+
3
18
  ## 0.1.1 (2026-04-01)
4
19
 
5
20
  Full Changelog: [v0.1.0...v0.1.1](https://github.com/VAT-Sense/vatsense-ruby/compare/v0.1.0...v0.1.1)
@@ -610,6 +610,7 @@ module Vatsense
610
610
  #
611
611
  # @return [Array(String, Enumerable<String>)]
612
612
  private def encode_multipart_streaming(body)
613
+ # rubocop:disable Style/CaseEquality
613
614
  # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
614
615
  boundary = SecureRandom.urlsafe_base64(46)
615
616
 
@@ -619,7 +620,7 @@ module Vatsense
619
620
  in Hash
620
621
  body.each do |key, val|
621
622
  case val
622
- in Array if val.all? { primitive?(_1) }
623
+ in Array if val.all? { primitive?(_1) || Vatsense::Internal::Type::FileInput === _1 }
623
624
  val.each do |v|
624
625
  write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
625
626
  end
@@ -635,6 +636,7 @@ module Vatsense
635
636
 
636
637
  fused_io = fused_enum(strio) { closing.each(&:call) }
637
638
  [boundary, fused_io]
639
+ # rubocop:enable Style/CaseEquality
638
640
  end
639
641
 
640
642
  # @api private
@@ -72,6 +72,14 @@ module Vatsense
72
72
  # @return [String, nil]
73
73
  optional :notes, String
74
74
 
75
+ # @!attribute original_invoice_id
76
+ # For a credit note: the ID of your own sale invoice it credits. Only a `refund`
77
+ # can name one; anything else gets `400` "Invalid Original Invoice ID". The credit
78
+ # note is then headed "Credit note". Used on create only.
79
+ #
80
+ # @return [String, nil]
81
+ optional :original_invoice_id, String, nil?: true
82
+
75
83
  # @!attribute pad_invoice_number
76
84
  # Pad the auto-generated invoice number with leading zeros to this length.
77
85
  #
@@ -103,7 +111,7 @@ module Vatsense
103
111
  # @return [Boolean, nil]
104
112
  optional :zero_rated, Vatsense::Internal::Type::Boolean
105
113
 
106
- # @!method initialize(business:, currency_code:, date:, items:, tax_point:, conversion: nil, customer: nil, has_vat: nil, invoice_number: nil, is_copy: nil, is_reverse_charge: nil, notes: nil, pad_invoice_number: nil, serial: nil, tax_type: nil, type: nil, zero_rated: nil)
114
+ # @!method initialize(business:, currency_code:, date:, items:, tax_point:, conversion: nil, customer: nil, has_vat: nil, invoice_number: nil, is_copy: nil, is_reverse_charge: nil, notes: nil, pad_invoice_number: nil, serial: nil, tax_type: nil, type: nil, zero_rated: nil, original_invoice_id: nil)
107
115
  # Some parameter documentations has been truncated, see
108
116
  # {Vatsense::Models::CreateInvoice} for more details.
109
117
  #
@@ -49,7 +49,9 @@ module Vatsense
49
49
  optional :invoice_number, String
50
50
 
51
51
  # @!attribute invoice_url
52
- # Unique URL to view the invoice. Append "/pdf" to download a PDF copy.
52
+ # Unique, unguessable URL to view the invoice. Append "/pdf" to download a PDF
53
+ # copy. Invoices created before the November 2026 relaunch keep their earlier
54
+ # style of link.
53
55
  #
54
56
  # @return [String, nil]
55
57
  optional :invoice_url, String
@@ -84,6 +86,12 @@ module Vatsense
84
86
  # @return [Symbol, Vatsense::Models::InvoiceAPI::Object, nil]
85
87
  optional :object, enum: -> { Vatsense::InvoiceAPI::Object }
86
88
 
89
+ # @!attribute original_invoice_id
90
+ # On a credit note that names the sale invoice it credits: that invoice's ID.
91
+ #
92
+ # @return [String, nil]
93
+ optional :original_invoice_id, String
94
+
87
95
  # @!attribute tax_point
88
96
  #
89
97
  # @return [String, nil]
@@ -114,7 +122,7 @@ module Vatsense
114
122
  # @return [Boolean, nil]
115
123
  optional :zero_rated, Vatsense::Internal::Type::Boolean
116
124
 
117
- # @!method initialize(id: nil, business: nil, conversion: nil, created: nil, currency_code: nil, customer: nil, date: nil, has_vat: nil, invoice_number: nil, invoice_url: nil, is_copy: nil, is_reverse_charge: nil, items: nil, notes: nil, num_items: nil, object: nil, tax_point: nil, tax_type: nil, totals: nil, type: nil, updated: nil, zero_rated: nil)
125
+ # @!method initialize(id: nil, business: nil, conversion: nil, created: nil, currency_code: nil, customer: nil, date: nil, has_vat: nil, invoice_number: nil, invoice_url: nil, is_copy: nil, is_reverse_charge: nil, items: nil, notes: nil, num_items: nil, object: nil, tax_point: nil, tax_type: nil, totals: nil, type: nil, updated: nil, zero_rated: nil, original_invoice_id: nil)
118
126
  # @param id [String]
119
127
  #
120
128
  # @param business [Vatsense::Models::InvoiceAPI::Business]
@@ -133,7 +141,7 @@ module Vatsense
133
141
  #
134
142
  # @param invoice_number [String]
135
143
  #
136
- # @param invoice_url [String] Unique URL to view the invoice. Append "/pdf" to download a PDF copy.
144
+ # @param invoice_url [String] Unique, unguessable URL to view the invoice. Append "/pdf" to download a PDF
137
145
  #
138
146
  # @param is_copy [Boolean]
139
147
  #
@@ -7,7 +7,19 @@ module Vatsense
7
7
  extend Vatsense::Internal::Type::RequestParameters::Converter
8
8
  include Vatsense::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute idempotency_key
11
+ # Sent as the `Idempotency-Key` header to retry a create safely: a repeat with the
12
+ # same key and the same body, byte for byte, creates nothing and returns the
13
+ # invoice the first request made. The same key with a different body gets `422`
14
+ # "Idempotency Key Reused". 1 to 255 characters, unique to this invoice (such as
15
+ # your order number or a UUID).
16
+ #
17
+ # @return [String, nil]
18
+ optional :idempotency_key, String
19
+
20
+ # @!method initialize(idempotency_key: nil, request_options: {})
21
+ # @param idempotency_key [String] Sent as the `Idempotency-Key` header to retry a create safely.
22
+ #
11
23
  # @param request_options [Vatsense::RequestOptions, Hash{Symbol=>Object}]
12
24
  end
13
25
  end
@@ -33,7 +33,16 @@ module Vatsense
33
33
  # @return [Time, nil]
34
34
  optional :period, Time
35
35
 
36
- # @!method initialize(country_code: nil, eu: nil, ip_address: nil, period: nil, request_options: {})
36
+ # @!attribute provinces
37
+ # Whether to list province and territory rates (rate objects that carry a
38
+ # `province` property) in each country's `other` list. Pass false to leave them
39
+ # out, so only country-wide rates are listed; true, or omitting the parameter,
40
+ # lists them as before. The `standard` rate is always the country-wide one.
41
+ #
42
+ # @return [Boolean, nil]
43
+ optional :provinces, Vatsense::Internal::Type::Boolean
44
+
45
+ # @!method initialize(country_code: nil, eu: nil, ip_address: nil, period: nil, provinces: nil, request_options: {})
37
46
  # Some parameter documentations has been truncated, see
38
47
  # {Vatsense::Models::RateListParams} for more details.
39
48
  #
@@ -43,13 +43,13 @@ module Vatsense
43
43
  optional :remaining, Integer
44
44
 
45
45
  # @!attribute total
46
- # Total requests allowed on your plan.
46
+ # Requests available in the current billing period.
47
47
  #
48
48
  # @return [Integer, nil]
49
49
  optional :total, Integer
50
50
 
51
51
  # @!attribute used
52
- # Requests used in the last 30 days.
52
+ # Requests used so far in the current billing period.
53
53
  #
54
54
  # @return [Integer, nil]
55
55
  optional :used, Integer
@@ -57,9 +57,9 @@ module Vatsense
57
57
  # @!method initialize(remaining: nil, total: nil, used: nil)
58
58
  # @param remaining [Integer] Requests remaining before the limit is reached.
59
59
  #
60
- # @param total [Integer] Total requests allowed on your plan.
60
+ # @param total [Integer] Requests available in the current billing period.
61
61
  #
62
- # @param used [Integer] Requests used in the last 30 days.
62
+ # @param used [Integer] Requests used so far in the current billing period.
63
63
  end
64
64
  end
65
65
  end
@@ -14,6 +14,41 @@ module Vatsense
14
14
  # @return [String, nil]
15
15
  optional :eori_number, String
16
16
 
17
+ # @!attribute match_address
18
+ # The whole address you hold, as one line, matched against the registered
19
+ # address.
20
+ #
21
+ # @return [String, nil]
22
+ optional :match_address, String
23
+
24
+ # @!attribute match_city
25
+ # The town or city you hold, looked for in the registered address.
26
+ #
27
+ # @return [String, nil]
28
+ optional :match_city, String
29
+
30
+ # @!attribute match_company_name
31
+ # The company name you hold, matched against the registered name. Legal forms
32
+ # such as Ltd or GmbH, accents, punctuation and word order are ignored. Sending
33
+ # any `match_` parameter adds `match` to the response; matching costs nothing
34
+ # extra.
35
+ #
36
+ # @return [String, nil]
37
+ optional :match_company_name, String
38
+
39
+ # @!attribute match_postcode
40
+ # The postcode you hold, looked for in the registered address. Spaces are
41
+ # ignored.
42
+ #
43
+ # @return [String, nil]
44
+ optional :match_postcode, String
45
+
46
+ # @!attribute match_street
47
+ # The street line you hold, looked for in the registered address.
48
+ #
49
+ # @return [String, nil]
50
+ optional :match_street, String
51
+
17
52
  # @!attribute requester_vat_number
18
53
  # Your own VAT number. If supplied, the response will include a unique
19
54
  # consultation number issued by the relevant authority (VIES or HMRC). Must
@@ -32,7 +67,7 @@ module Vatsense
32
67
  # @return [String, nil]
33
68
  optional :vat_number, String
34
69
 
35
- # @!method initialize(eori_number: nil, requester_vat_number: nil, vat_number: nil, request_options: {})
70
+ # @!method initialize(eori_number: nil, requester_vat_number: nil, vat_number: nil, match_address: nil, match_city: nil, match_company_name: nil, match_postcode: nil, match_street: nil, request_options: {})
36
71
  # Some parameter documentations has been truncated, see
37
72
  # {Vatsense::Models::ValidateCheckParams} for more details.
38
73
  #
@@ -38,13 +38,19 @@ module Vatsense
38
38
  # @return [String, nil]
39
39
  optional :consultation_number, String, nil?: true
40
40
 
41
+ # @!attribute match
42
+ # Only when a `match_` parameter was sent.
43
+ #
44
+ # @return [Vatsense::Models::ValidateCheckResponse::Data::Match, nil]
45
+ optional :match, -> { Vatsense::Models::ValidateCheckResponse::Data::Match }
46
+
41
47
  # @!attribute valid
42
48
  # Whether the VAT/EORI number is valid.
43
49
  #
44
50
  # @return [Boolean, nil]
45
51
  optional :valid, Vatsense::Internal::Type::Boolean
46
52
 
47
- # @!method initialize(company: nil, consultation_number: nil, valid: nil)
53
+ # @!method initialize(company: nil, consultation_number: nil, match: nil, valid: nil)
48
54
  # Some parameter documentations has been truncated, see
49
55
  # {Vatsense::Models::ValidateCheckResponse::Data} for more details.
50
56
  #
@@ -54,6 +60,62 @@ module Vatsense
54
60
  #
55
61
  # @param valid [Boolean] Whether the VAT/EORI number is valid.
56
62
 
63
+ # @see Vatsense::Models::ValidateCheckResponse::Data#match
64
+ class Match < Vatsense::Internal::Type::BaseModel
65
+ # @!attribute fields
66
+ # One entry for each detail sent (company_name, address, street, postcode,
67
+ # city).
68
+ #
69
+ # @return [Hash{Symbol=>Vatsense::Models::ValidateCheckResponse::Data::Match::Field}, nil]
70
+ optional :fields,
71
+ -> { Vatsense::Internal::Type::HashOf[Vatsense::Models::ValidateCheckResponse::Data::Match::Field] }
72
+
73
+ # @!attribute result
74
+ # likely (a score of 80 or more, and the name, if sent, is not a no_match),
75
+ # possible (50 to 79), unlikely (under 50), or not_applicable when nothing could
76
+ # be compared.
77
+ #
78
+ # @return [String, nil]
79
+ optional :result, String
80
+
81
+ # @!attribute score
82
+ # The average of the details sent, with the name counting twice. nil when
83
+ # not_applicable.
84
+ #
85
+ # @return [Integer, nil]
86
+ optional :score, Integer, nil?: true
87
+
88
+ # @!method initialize(fields: nil, result: nil, score: nil)
89
+ # @param fields [Hash{Symbol=>Vatsense::Models::ValidateCheckResponse::Data::Match::Field}]
90
+ # @param result [String]
91
+ # @param score [Integer, nil]
92
+
93
+ class Field < Vatsense::Internal::Type::BaseModel
94
+ # @!attribute result
95
+ # One of "match", "partial", "no_match" or "not_applicable".
96
+ #
97
+ # @return [String, nil]
98
+ optional :result, String
99
+
100
+ # @!attribute score
101
+ #
102
+ # @return [Integer, nil]
103
+ optional :score, Integer, nil?: true
104
+
105
+ # @!attribute vies
106
+ # VIES's own answer for that detail on a live EU check ("valid", "invalid" or
107
+ # "not_processed"); nil when VIES said nothing.
108
+ #
109
+ # @return [String, nil]
110
+ optional :vies, String, nil?: true
111
+
112
+ # @!method initialize(result: nil, score: nil, vies: nil)
113
+ # @param result [String]
114
+ # @param score [Integer, nil]
115
+ # @param vies [String, nil]
116
+ end
117
+ end
118
+
57
119
  # @see Vatsense::Models::ValidateCheckResponse::Data#company
58
120
  module Company
59
121
  extend Vatsense::Internal::Type::Union
@@ -16,7 +16,11 @@ module Vatsense
16
16
  #
17
17
  # Not available with sandbox API keys.
18
18
  #
19
- # @overload create(business:, currency_code:, date:, items:, tax_point:, conversion: nil, customer: nil, has_vat: nil, invoice_number: nil, is_copy: nil, is_reverse_charge: nil, notes: nil, pad_invoice_number: nil, serial: nil, tax_type: nil, type: nil, zero_rated: nil, request_options: {})
19
+ # Pass `idempotency_key:` to retry a create safely: a repeat with the same key and
20
+ # the same body, byte for byte, creates nothing and returns the invoice the first
21
+ # request made.
22
+ #
23
+ # @overload create(business:, currency_code:, date:, items:, tax_point:, conversion: nil, customer: nil, has_vat: nil, invoice_number: nil, is_copy: nil, is_reverse_charge: nil, notes: nil, pad_invoice_number: nil, serial: nil, tax_type: nil, type: nil, zero_rated: nil, original_invoice_id: nil, idempotency_key: nil, request_options: {})
20
24
  #
21
25
  # @param business [Vatsense::Models::InvoiceBusinessInput]
22
26
  #
@@ -59,10 +63,12 @@ module Vatsense
59
63
  # @see Vatsense::Models::InvoiceCreateParams
60
64
  def create(params)
61
65
  parsed, options = Vatsense::InvoiceCreateParams.dump_request(params)
66
+ header_params = {idempotency_key: "idempotency-key"}
62
67
  @client.request(
63
68
  method: :post,
64
69
  path: "invoice",
65
- body: parsed,
70
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
71
+ body: parsed.except(*header_params.keys),
66
72
  model: Vatsense::InvoiceResponse,
67
73
  options: options
68
74
  )
@@ -13,7 +13,7 @@ module Vatsense
13
13
  #
14
14
  # You can optionally filter by country code, IP address, or EU membership.
15
15
  #
16
- # @overload list(country_code: nil, eu: nil, ip_address: nil, period: nil, request_options: {})
16
+ # @overload list(country_code: nil, eu: nil, ip_address: nil, period: nil, provinces: nil, request_options: {})
17
17
  #
18
18
  # @param country_code [String] A 2-character ISO 3166-1 alpha-2 country code (e.g. "GB", "FR").
19
19
  #
@@ -16,11 +16,16 @@ module Vatsense
16
16
  # **EORI validation** checks against UK and EU records only.
17
17
  #
18
18
  # If the external validation service is temporarily unavailable, the API returns a
19
- # `412` error and the request does not count against your usage quota.
19
+ # `412` error and the request does not count against your usage quota. It also
20
+ # returns the `412`, uncounted, when a check takes longer than 55 seconds for a
21
+ # number checked with VIES or the EU EORI service, or 25 seconds for any other.
22
+ # With a webhook endpoint taking `validation.completed`, a number that got the
23
+ # `412` keeps being checked and the answer is sent by webhook
24
+ # (https://vatsense.com/documentation#webhooks).
20
25
  #
21
26
  # Provide either `vat_number` or `eori_number`, but not both.
22
27
  #
23
- # @overload check(eori_number: nil, requester_vat_number: nil, vat_number: nil, request_options: {})
28
+ # @overload check(eori_number: nil, requester_vat_number: nil, vat_number: nil, match_address: nil, match_city: nil, match_company_name: nil, match_postcode: nil, match_street: nil, request_options: {})
24
29
  #
25
30
  # @param eori_number [String] The EORI number to validate. Must include the leading 2-character
26
31
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vatsense
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -77,6 +77,12 @@ module Vatsense
77
77
  sig { params(notes: String).void }
78
78
  attr_writer :notes
79
79
 
80
+ # For a credit note: the ID of your own sale invoice it credits. Only a `refund`
81
+ # can name one; anything else gets `400` "Invalid Original Invoice ID". The credit
82
+ # note is then headed "Credit note". Used on create only.
83
+ sig { returns(T.nilable(String)) }
84
+ attr_accessor :original_invoice_id
85
+
80
86
  # Pad the auto-generated invoice number with leading zeros to this length.
81
87
  sig { returns(T.nilable(Integer)) }
82
88
  attr_reader :pad_invoice_number
@@ -127,6 +133,7 @@ module Vatsense
127
133
  is_copy: T::Boolean,
128
134
  is_reverse_charge: T::Boolean,
129
135
  notes: String,
136
+ original_invoice_id: T.nilable(String),
130
137
  pad_invoice_number: Integer,
131
138
  serial: String,
132
139
  tax_type: Vatsense::CreateInvoice::TaxType::OrSymbol,
@@ -156,6 +163,7 @@ module Vatsense
156
163
  is_reverse_charge: nil,
157
164
  # Any additional notes for the invoice.
158
165
  notes: nil,
166
+ original_invoice_id: nil,
159
167
  # Pad the auto-generated invoice number with leading zeros to this length.
160
168
  pad_invoice_number: nil,
161
169
  # A serial prepended to the auto-generated invoice number. Each unique serial has
@@ -185,6 +193,7 @@ module Vatsense
185
193
  is_copy: T::Boolean,
186
194
  is_reverse_charge: T::Boolean,
187
195
  notes: String,
196
+ original_invoice_id: T.nilable(String),
188
197
  pad_invoice_number: Integer,
189
198
  serial: String,
190
199
  tax_type: Vatsense::CreateInvoice::TaxType::OrSymbol,
@@ -68,7 +68,7 @@ module Vatsense
68
68
  sig { params(invoice_number: String).void }
69
69
  attr_writer :invoice_number
70
70
 
71
- # Unique URL to view the invoice. Append "/pdf" to download a PDF copy.
71
+ # Unique, unguessable URL to view the invoice. Append "/pdf" for a PDF copy.
72
72
  sig { returns(T.nilable(String)) }
73
73
  attr_reader :invoice_url
74
74
 
@@ -110,6 +110,13 @@ module Vatsense
110
110
  sig { params(object: Vatsense::InvoiceAPI::Object::OrSymbol).void }
111
111
  attr_writer :object
112
112
 
113
+ # On a credit note that names the sale invoice it credits: that invoice's ID.
114
+ sig { returns(T.nilable(String)) }
115
+ attr_reader :original_invoice_id
116
+
117
+ sig { params(original_invoice_id: String).void }
118
+ attr_writer :original_invoice_id
119
+
113
120
  sig { returns(T.nilable(String)) }
114
121
  attr_reader :tax_point
115
122
 
@@ -164,6 +171,7 @@ module Vatsense
164
171
  notes: T.nilable(String),
165
172
  num_items: Integer,
166
173
  object: Vatsense::InvoiceAPI::Object::OrSymbol,
174
+ original_invoice_id: String,
167
175
  tax_point: String,
168
176
  tax_type: Vatsense::InvoiceAPI::TaxType::OrSymbol,
169
177
  totals: Vatsense::InvoiceAPI::Totals::OrHash,
@@ -182,7 +190,7 @@ module Vatsense
182
190
  date: nil,
183
191
  has_vat: nil,
184
192
  invoice_number: nil,
185
- # Unique URL to view the invoice. Append "/pdf" to download a PDF copy.
193
+ # Unique, unguessable URL to view the invoice. Append "/pdf" for a PDF copy.
186
194
  invoice_url: nil,
187
195
  is_copy: nil,
188
196
  is_reverse_charge: nil,
@@ -190,6 +198,7 @@ module Vatsense
190
198
  notes: nil,
191
199
  num_items: nil,
192
200
  object: nil,
201
+ original_invoice_id: nil,
193
202
  tax_point: nil,
194
203
  tax_type: nil,
195
204
  totals: nil,
@@ -218,6 +227,7 @@ module Vatsense
218
227
  notes: T.nilable(String),
219
228
  num_items: Integer,
220
229
  object: Vatsense::InvoiceAPI::Object::TaggedSymbol,
230
+ original_invoice_id: String,
221
231
  tax_point: String,
222
232
  tax_type: Vatsense::InvoiceAPI::TaxType::TaggedSymbol,
223
233
  totals: Vatsense::InvoiceAPI::Totals,
@@ -11,15 +11,27 @@ module Vatsense
11
11
  T.any(Vatsense::InvoiceCreateParams, Vatsense::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # Sent as the `Idempotency-Key` header to retry a create safely.
15
+ sig { returns(T.nilable(String)) }
16
+ attr_reader :idempotency_key
17
+
18
+ sig { params(idempotency_key: String).void }
19
+ attr_writer :idempotency_key
20
+
14
21
  sig do
15
- params(request_options: Vatsense::RequestOptions::OrHash).returns(
16
- T.attached_class
17
- )
22
+ params(
23
+ idempotency_key: String,
24
+ request_options: Vatsense::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
18
26
  end
19
- def self.new(request_options: {})
27
+ def self.new(idempotency_key: nil, request_options: {})
20
28
  end
21
29
 
22
- sig { override.returns({ request_options: Vatsense::RequestOptions }) }
30
+ sig do
31
+ override.returns(
32
+ { idempotency_key: String, request_options: Vatsense::RequestOptions }
33
+ )
34
+ end
23
35
  def to_hash
24
36
  end
25
37
  end
@@ -41,12 +41,23 @@ module Vatsense
41
41
  sig { params(period: Time).void }
42
42
  attr_writer :period
43
43
 
44
+ # Whether to list province and territory rates (rate objects that carry a
45
+ # `province` property) in each country's `other` list. Pass false to leave them
46
+ # out, so only country-wide rates are listed; true, or omitting the parameter,
47
+ # lists them as before. The `standard` rate is always the country-wide one.
48
+ sig { returns(T.nilable(T::Boolean)) }
49
+ attr_reader :provinces
50
+
51
+ sig { params(provinces: T::Boolean).void }
52
+ attr_writer :provinces
53
+
44
54
  sig do
45
55
  params(
46
56
  country_code: String,
47
57
  eu: T::Boolean,
48
58
  ip_address: String,
49
59
  period: Time,
60
+ provinces: T::Boolean,
50
61
  request_options: Vatsense::RequestOptions::OrHash
51
62
  ).returns(T.attached_class)
52
63
  end
@@ -61,6 +72,7 @@ module Vatsense
61
72
  # A historical date to retrieve rates for (format "YYYY-MM-DD HH:MM:SS"). Must be
62
73
  # a past date.
63
74
  period: nil,
75
+ provinces: nil,
64
76
  request_options: {}
65
77
  )
66
78
  end
@@ -72,6 +84,7 @@ module Vatsense
72
84
  eu: T::Boolean,
73
85
  ip_address: String,
74
86
  period: Time,
87
+ provinces: T::Boolean,
75
88
  request_options: Vatsense::RequestOptions
76
89
  }
77
90
  )
@@ -112,14 +112,14 @@ module Vatsense
112
112
  sig { params(remaining: Integer).void }
113
113
  attr_writer :remaining
114
114
 
115
- # Total requests allowed on your plan.
115
+ # Requests available in the current billing period.
116
116
  sig { returns(T.nilable(Integer)) }
117
117
  attr_reader :total
118
118
 
119
119
  sig { params(total: Integer).void }
120
120
  attr_writer :total
121
121
 
122
- # Requests used in the last 30 days.
122
+ # Requests used so far in the current billing period.
123
123
  sig { returns(T.nilable(Integer)) }
124
124
  attr_reader :used
125
125
 
@@ -134,9 +134,9 @@ module Vatsense
134
134
  def self.new(
135
135
  # Requests remaining before the limit is reached.
136
136
  remaining: nil,
137
- # Total requests allowed on your plan.
137
+ # Requests available in the current billing period.
138
138
  total: nil,
139
- # Requests used in the last 30 days.
139
+ # Requests used so far in the current billing period.
140
140
  used: nil
141
141
  )
142
142
  end
@@ -19,6 +19,46 @@ module Vatsense
19
19
  sig { params(eori_number: String).void }
20
20
  attr_writer :eori_number
21
21
 
22
+ # The whole address you hold, as one line, matched against the registered
23
+ # address.
24
+ sig { returns(T.nilable(String)) }
25
+ attr_reader :match_address
26
+
27
+ sig { params(match_address: String).void }
28
+ attr_writer :match_address
29
+
30
+ # The town or city you hold, looked for in the registered address.
31
+ sig { returns(T.nilable(String)) }
32
+ attr_reader :match_city
33
+
34
+ sig { params(match_city: String).void }
35
+ attr_writer :match_city
36
+
37
+ # The company name you hold, matched against the registered name. Legal forms
38
+ # such as Ltd or GmbH, accents, punctuation and word order are ignored. Sending
39
+ # any `match_` parameter adds `match` to the response; matching costs nothing
40
+ # extra.
41
+ sig { returns(T.nilable(String)) }
42
+ attr_reader :match_company_name
43
+
44
+ sig { params(match_company_name: String).void }
45
+ attr_writer :match_company_name
46
+
47
+ # The postcode you hold, looked for in the registered address. Spaces are
48
+ # ignored.
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :match_postcode
51
+
52
+ sig { params(match_postcode: String).void }
53
+ attr_writer :match_postcode
54
+
55
+ # The street line you hold, looked for in the registered address.
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :match_street
58
+
59
+ sig { params(match_street: String).void }
60
+ attr_writer :match_street
61
+
22
62
  # Your own VAT number. If supplied, the response will include a unique
23
63
  # consultation number issued by the relevant authority (VIES or HMRC). Must
24
64
  # include the leading 2-character country code.
@@ -42,6 +82,11 @@ module Vatsense
42
82
  sig do
43
83
  params(
44
84
  eori_number: String,
85
+ match_address: String,
86
+ match_city: String,
87
+ match_company_name: String,
88
+ match_postcode: String,
89
+ match_street: String,
45
90
  requester_vat_number: String,
46
91
  vat_number: String,
47
92
  request_options: Vatsense::RequestOptions::OrHash
@@ -51,6 +96,11 @@ module Vatsense
51
96
  # The EORI number to validate. Must include the leading 2-character country code
52
97
  # (e.g. "GB123456789123"). UK and EU only.
53
98
  eori_number: nil,
99
+ match_address: nil,
100
+ match_city: nil,
101
+ match_company_name: nil,
102
+ match_postcode: nil,
103
+ match_street: nil,
54
104
  # Your own VAT number. If supplied, the response will include a unique
55
105
  # consultation number issued by the relevant authority (VIES or HMRC). Must
56
106
  # include the leading 2-character country code.
@@ -69,6 +119,11 @@ module Vatsense
69
119
  override.returns(
70
120
  {
71
121
  eori_number: String,
122
+ match_address: String,
123
+ match_city: String,
124
+ match_company_name: String,
125
+ match_postcode: String,
126
+ match_street: String,
72
127
  requester_vat_number: String,
73
128
  vat_number: String,
74
129
  request_options: Vatsense::RequestOptions
@@ -87,6 +87,19 @@ module Vatsense
87
87
  sig { returns(T.nilable(String)) }
88
88
  attr_accessor :consultation_number
89
89
 
90
+ # Only when a `match_` parameter was sent.
91
+ sig do
92
+ returns(T.nilable(Vatsense::Models::ValidateCheckResponse::Data::Match))
93
+ end
94
+ attr_reader :match
95
+
96
+ sig do
97
+ params(
98
+ match: Vatsense::Models::ValidateCheckResponse::Data::Match::OrHash
99
+ ).void
100
+ end
101
+ attr_writer :match
102
+
90
103
  # Whether the VAT/EORI number is valid.
91
104
  sig { returns(T.nilable(T::Boolean)) }
92
105
  attr_reader :valid
@@ -102,6 +115,7 @@ module Vatsense
102
115
  Vatsense::Models::ValidateCheckResponse::Data::Company::EoriValidationCompany::OrHash
103
116
  ),
104
117
  consultation_number: T.nilable(String),
118
+ match: Vatsense::Models::ValidateCheckResponse::Data::Match::OrHash,
105
119
  valid: T::Boolean
106
120
  ).returns(T.attached_class)
107
121
  end
@@ -110,6 +124,8 @@ module Vatsense
110
124
  # Official consultation number (only returned when requester_vat_number is
111
125
  # provided).
112
126
  consultation_number: nil,
127
+ # Only when a `match_` parameter was sent.
128
+ match: nil,
113
129
  # Whether the VAT/EORI number is valid.
114
130
  valid: nil
115
131
  )
@@ -121,6 +137,7 @@ module Vatsense
121
137
  company:
122
138
  Vatsense::Models::ValidateCheckResponse::Data::Company::Variants,
123
139
  consultation_number: T.nilable(String),
140
+ match: Vatsense::Models::ValidateCheckResponse::Data::Match,
124
141
  valid: T::Boolean
125
142
  }
126
143
  )
@@ -128,6 +145,129 @@ module Vatsense
128
145
  def to_hash
129
146
  end
130
147
 
148
+ class Match < Vatsense::Internal::Type::BaseModel
149
+ OrHash =
150
+ T.type_alias do
151
+ T.any(
152
+ Vatsense::Models::ValidateCheckResponse::Data::Match,
153
+ Vatsense::Internal::AnyHash
154
+ )
155
+ end
156
+
157
+ # One entry for each detail sent (company_name, address, street, postcode,
158
+ # city).
159
+ sig do
160
+ returns(
161
+ T.nilable(
162
+ T::Hash[
163
+ Symbol,
164
+ Vatsense::Models::ValidateCheckResponse::Data::Match::Field
165
+ ]
166
+ )
167
+ )
168
+ end
169
+ attr_reader :fields
170
+
171
+ sig do
172
+ params(
173
+ fields:
174
+ T::Hash[
175
+ Symbol,
176
+ Vatsense::Models::ValidateCheckResponse::Data::Match::Field::OrHash
177
+ ]
178
+ ).void
179
+ end
180
+ attr_writer :fields
181
+
182
+ # likely, possible, unlikely or not_applicable.
183
+ sig { returns(T.nilable(String)) }
184
+ attr_reader :result
185
+
186
+ sig { params(result: String).void }
187
+ attr_writer :result
188
+
189
+ # The average of the details sent, with the name counting twice.
190
+ sig { returns(T.nilable(Integer)) }
191
+ attr_accessor :score
192
+
193
+ sig do
194
+ params(
195
+ fields:
196
+ T::Hash[
197
+ Symbol,
198
+ Vatsense::Models::ValidateCheckResponse::Data::Match::Field::OrHash
199
+ ],
200
+ result: String,
201
+ score: T.nilable(Integer)
202
+ ).returns(T.attached_class)
203
+ end
204
+ def self.new(fields: nil, result: nil, score: nil)
205
+ end
206
+
207
+ sig do
208
+ override.returns(
209
+ {
210
+ fields:
211
+ T::Hash[
212
+ Symbol,
213
+ Vatsense::Models::ValidateCheckResponse::Data::Match::Field
214
+ ],
215
+ result: String,
216
+ score: T.nilable(Integer)
217
+ }
218
+ )
219
+ end
220
+ def to_hash
221
+ end
222
+
223
+ class Field < Vatsense::Internal::Type::BaseModel
224
+ OrHash =
225
+ T.type_alias do
226
+ T.any(
227
+ Vatsense::Models::ValidateCheckResponse::Data::Match::Field,
228
+ Vatsense::Internal::AnyHash
229
+ )
230
+ end
231
+
232
+ # match, partial, no_match or not_applicable.
233
+ sig { returns(T.nilable(String)) }
234
+ attr_reader :result
235
+
236
+ sig { params(result: String).void }
237
+ attr_writer :result
238
+
239
+ sig { returns(T.nilable(Integer)) }
240
+ attr_accessor :score
241
+
242
+ # VIES's own answer for that detail on a live EU check; nil when VIES said
243
+ # nothing.
244
+ sig { returns(T.nilable(String)) }
245
+ attr_accessor :vies
246
+
247
+ sig do
248
+ params(
249
+ result: String,
250
+ score: T.nilable(Integer),
251
+ vies: T.nilable(String)
252
+ ).returns(T.attached_class)
253
+ end
254
+ def self.new(result: nil, score: nil, vies: nil)
255
+ end
256
+
257
+ sig do
258
+ override.returns(
259
+ {
260
+ result: String,
261
+ score: T.nilable(Integer),
262
+ vies: T.nilable(String)
263
+ }
264
+ )
265
+ end
266
+ def to_hash
267
+ end
268
+ end
269
+ end
270
+
131
271
  module Company
132
272
  extend Vatsense::Internal::Type::Union
133
273
 
@@ -26,6 +26,8 @@ module Vatsense
26
26
  is_copy: T::Boolean,
27
27
  is_reverse_charge: T::Boolean,
28
28
  notes: String,
29
+ original_invoice_id: T.nilable(String),
30
+ idempotency_key: String,
29
31
  pad_invoice_number: Integer,
30
32
  serial: String,
31
33
  tax_type: Vatsense::CreateInvoice::TaxType::OrSymbol,
@@ -56,6 +58,8 @@ module Vatsense
56
58
  is_reverse_charge: nil,
57
59
  # Any additional notes for the invoice.
58
60
  notes: nil,
61
+ original_invoice_id: nil,
62
+ idempotency_key: nil,
59
63
  # Pad the auto-generated invoice number with leading zeros to this length.
60
64
  pad_invoice_number: nil,
61
65
  # A serial prepended to the auto-generated invoice number. Each unique serial has
@@ -15,6 +15,7 @@ module Vatsense
15
15
  eu: T::Boolean,
16
16
  ip_address: String,
17
17
  period: Time,
18
+ provinces: T::Boolean,
18
19
  request_options: Vatsense::RequestOptions::OrHash
19
20
  ).returns(Vatsense::Models::RateListResponse)
20
21
  end
@@ -29,6 +30,7 @@ module Vatsense
29
30
  # A historical date to retrieve rates for (format "YYYY-MM-DD HH:MM:SS"). Must be
30
31
  # a past date.
31
32
  period: nil,
33
+ provinces: nil,
32
34
  request_options: {}
33
35
  )
34
36
  end
@@ -13,12 +13,22 @@ module Vatsense
13
13
  # **EORI validation** checks against UK and EU records only.
14
14
  #
15
15
  # If the external validation service is temporarily unavailable, the API returns a
16
- # `412` error and the request does not count against your usage quota.
16
+ # `412` error and the request does not count against your usage quota. It also
17
+ # returns the `412`, uncounted, when a check takes longer than 55 seconds for a
18
+ # number checked with VIES or the EU EORI service, or 25 seconds for any other.
19
+ # With a webhook endpoint taking `validation.completed`, a number that got the
20
+ # `412` keeps being checked and the answer is sent by webhook
21
+ # (https://vatsense.com/documentation#webhooks).
17
22
  #
18
23
  # Provide either `vat_number` or `eori_number`, but not both.
19
24
  sig do
20
25
  params(
21
26
  eori_number: String,
27
+ match_address: String,
28
+ match_city: String,
29
+ match_company_name: String,
30
+ match_postcode: String,
31
+ match_street: String,
22
32
  requester_vat_number: String,
23
33
  vat_number: String,
24
34
  request_options: Vatsense::RequestOptions::OrHash
@@ -28,6 +38,11 @@ module Vatsense
28
38
  # The EORI number to validate. Must include the leading 2-character country code
29
39
  # (e.g. "GB123456789123"). UK and EU only.
30
40
  eori_number: nil,
41
+ match_address: nil,
42
+ match_city: nil,
43
+ match_company_name: nil,
44
+ match_postcode: nil,
45
+ match_street: nil,
31
46
  # Your own VAT number. If supplied, the response will include a unique
32
47
  # consultation number issued by the relevant authority (VIES or HMRC). Must
33
48
  # include the leading 2-character country code.
@@ -18,7 +18,8 @@ module Vatsense
18
18
  serial: String,
19
19
  tax_type: Vatsense::Models::CreateInvoice::tax_type,
20
20
  type: Vatsense::Models::CreateInvoice::type_,
21
- zero_rated: bool
21
+ zero_rated: bool,
22
+ original_invoice_id: String?
22
23
  }
23
24
 
24
25
  class CreateInvoice < Vatsense::Internal::Type::BaseModel
@@ -64,6 +65,8 @@ module Vatsense
64
65
 
65
66
  def notes=: (String) -> String
66
67
 
68
+ attr_accessor original_invoice_id: String?
69
+
67
70
  attr_reader pad_invoice_number: Integer?
68
71
 
69
72
  def pad_invoice_number=: (Integer) -> Integer
@@ -101,6 +104,7 @@ module Vatsense
101
104
  ?is_copy: bool,
102
105
  ?is_reverse_charge: bool,
103
106
  ?notes: String,
107
+ ?original_invoice_id: String?,
104
108
  ?pad_invoice_number: Integer,
105
109
  ?serial: String,
106
110
  ?tax_type: Vatsense::Models::CreateInvoice::tax_type,
@@ -121,6 +125,7 @@ module Vatsense
121
125
  is_copy: bool,
122
126
  is_reverse_charge: bool,
123
127
  notes: String,
128
+ original_invoice_id: String?,
124
129
  pad_invoice_number: Integer,
125
130
  serial: String,
126
131
  tax_type: Vatsense::Models::CreateInvoice::tax_type,
@@ -23,7 +23,8 @@ module Vatsense
23
23
  totals: Vatsense::InvoiceAPI::Totals,
24
24
  type: Vatsense::Models::InvoiceAPI::type_,
25
25
  updated: Time,
26
- zero_rated: bool
26
+ zero_rated: bool,
27
+ original_invoice_id: String
27
28
  }
28
29
 
29
30
  class InvoiceAPI < Vatsense::Internal::Type::BaseModel
@@ -91,6 +92,10 @@ module Vatsense
91
92
  Vatsense::Models::InvoiceAPI::object
92
93
  ) -> Vatsense::Models::InvoiceAPI::object
93
94
 
95
+ attr_reader original_invoice_id: String?
96
+
97
+ def original_invoice_id=: (String) -> String
98
+
94
99
  attr_reader tax_point: String?
95
100
 
96
101
  def tax_point=: (String) -> String
@@ -138,6 +143,7 @@ module Vatsense
138
143
  ?notes: String?,
139
144
  ?num_items: Integer,
140
145
  ?object: Vatsense::Models::InvoiceAPI::object,
146
+ ?original_invoice_id: String,
141
147
  ?tax_point: String,
142
148
  ?tax_type: Vatsense::Models::InvoiceAPI::tax_type,
143
149
  ?totals: Vatsense::InvoiceAPI::Totals,
@@ -163,6 +169,7 @@ module Vatsense
163
169
  notes: String?,
164
170
  num_items: Integer,
165
171
  object: Vatsense::Models::InvoiceAPI::object,
172
+ original_invoice_id: String,
166
173
  tax_point: String,
167
174
  tax_type: Vatsense::Models::InvoiceAPI::tax_type,
168
175
  totals: Vatsense::InvoiceAPI::Totals,
@@ -1,15 +1,25 @@
1
1
  module Vatsense
2
2
  module Models
3
3
  type invoice_create_params =
4
- { } & Vatsense::Internal::Type::request_parameters
4
+ { idempotency_key: String } & Vatsense::Internal::Type::request_parameters
5
5
 
6
6
  class InvoiceCreateParams < Vatsense::Models::CreateInvoice
7
7
  extend Vatsense::Internal::Type::RequestParameters::Converter
8
8
  include Vatsense::Internal::Type::RequestParameters
9
9
 
10
- def initialize: (?request_options: Vatsense::request_opts) -> void
10
+ attr_reader idempotency_key: String?
11
11
 
12
- def to_hash: -> { request_options: Vatsense::RequestOptions }
12
+ def idempotency_key=: (String) -> String
13
+
14
+ def initialize: (
15
+ ?idempotency_key: String,
16
+ ?request_options: Vatsense::request_opts
17
+ ) -> void
18
+
19
+ def to_hash: -> {
20
+ idempotency_key: String,
21
+ request_options: Vatsense::RequestOptions
22
+ }
13
23
  end
14
24
  end
15
25
  end
@@ -1,7 +1,7 @@
1
1
  module Vatsense
2
2
  module Models
3
3
  type rate_list_params =
4
- { country_code: String, eu: bool, ip_address: String, period: Time }
4
+ { country_code: String, eu: bool, ip_address: String, period: Time, provinces: bool }
5
5
  & Vatsense::Internal::Type::request_parameters
6
6
 
7
7
  class RateListParams < Vatsense::Internal::Type::BaseModel
@@ -24,11 +24,16 @@ module Vatsense
24
24
 
25
25
  def period=: (Time) -> Time
26
26
 
27
+ attr_reader provinces: bool?
28
+
29
+ def provinces=: (bool) -> bool
30
+
27
31
  def initialize: (
28
32
  ?country_code: String,
29
33
  ?eu: bool,
30
34
  ?ip_address: String,
31
35
  ?period: Time,
36
+ ?provinces: bool,
32
37
  ?request_options: Vatsense::request_opts
33
38
  ) -> void
34
39
 
@@ -37,6 +42,7 @@ module Vatsense
37
42
  eu: bool,
38
43
  ip_address: String,
39
44
  period: Time,
45
+ provinces: bool,
40
46
  request_options: Vatsense::RequestOptions
41
47
  }
42
48
  end
@@ -1,7 +1,7 @@
1
1
  module Vatsense
2
2
  module Models
3
3
  type validate_check_params =
4
- { eori_number: String, requester_vat_number: String, vat_number: String }
4
+ { eori_number: String, requester_vat_number: String, vat_number: String, match_address: String, match_city: String, match_company_name: String, match_postcode: String, match_street: String }
5
5
  & Vatsense::Internal::Type::request_parameters
6
6
 
7
7
  class ValidateCheckParams < Vatsense::Internal::Type::BaseModel
@@ -12,6 +12,26 @@ module Vatsense
12
12
 
13
13
  def eori_number=: (String) -> String
14
14
 
15
+ attr_reader match_address: String?
16
+
17
+ def match_address=: (String) -> String
18
+
19
+ attr_reader match_city: String?
20
+
21
+ def match_city=: (String) -> String
22
+
23
+ attr_reader match_company_name: String?
24
+
25
+ def match_company_name=: (String) -> String
26
+
27
+ attr_reader match_postcode: String?
28
+
29
+ def match_postcode=: (String) -> String
30
+
31
+ attr_reader match_street: String?
32
+
33
+ def match_street=: (String) -> String
34
+
15
35
  attr_reader requester_vat_number: String?
16
36
 
17
37
  def requester_vat_number=: (String) -> String
@@ -22,6 +42,11 @@ module Vatsense
22
42
 
23
43
  def initialize: (
24
44
  ?eori_number: String,
45
+ ?match_address: String,
46
+ ?match_city: String,
47
+ ?match_company_name: String,
48
+ ?match_postcode: String,
49
+ ?match_street: String,
25
50
  ?requester_vat_number: String,
26
51
  ?vat_number: String,
27
52
  ?request_options: Vatsense::request_opts
@@ -29,6 +54,11 @@ module Vatsense
29
54
 
30
55
  def to_hash: -> {
31
56
  eori_number: String,
57
+ match_address: String,
58
+ match_city: String,
59
+ match_company_name: String,
60
+ match_postcode: String,
61
+ match_street: String,
32
62
  requester_vat_number: String,
33
63
  vat_number: String,
34
64
  request_options: Vatsense::RequestOptions
@@ -38,6 +38,7 @@ module Vatsense
38
38
  {
39
39
  company: Vatsense::Models::ValidateCheckResponse::Data::company,
40
40
  consultation_number: String?,
41
+ match: Vatsense::Models::ValidateCheckResponse::Data::Match,
41
42
  valid: bool
42
43
  }
43
44
 
@@ -50,6 +51,12 @@ module Vatsense
50
51
 
51
52
  attr_accessor consultation_number: String?
52
53
 
54
+ attr_reader match: Vatsense::Models::ValidateCheckResponse::Data::Match?
55
+
56
+ def match=: (
57
+ Vatsense::Models::ValidateCheckResponse::Data::Match
58
+ ) -> Vatsense::Models::ValidateCheckResponse::Data::Match
59
+
53
60
  attr_reader valid: bool?
54
61
 
55
62
  def valid=: (bool) -> bool
@@ -57,15 +64,66 @@ module Vatsense
57
64
  def initialize: (
58
65
  ?company: Vatsense::Models::ValidateCheckResponse::Data::company,
59
66
  ?consultation_number: String?,
67
+ ?match: Vatsense::Models::ValidateCheckResponse::Data::Match,
60
68
  ?valid: bool
61
69
  ) -> void
62
70
 
63
71
  def to_hash: -> {
64
72
  company: Vatsense::Models::ValidateCheckResponse::Data::company,
65
73
  consultation_number: String?,
74
+ match: Vatsense::Models::ValidateCheckResponse::Data::Match,
66
75
  valid: bool
67
76
  }
68
77
 
78
+ type match =
79
+ {
80
+ fields: ::Hash[Symbol, Vatsense::Models::ValidateCheckResponse::Data::Match::Field],
81
+ result: String,
82
+ score: Integer?
83
+ }
84
+
85
+ class Match < Vatsense::Internal::Type::BaseModel
86
+ attr_reader fields: ::Hash[Symbol, Vatsense::Models::ValidateCheckResponse::Data::Match::Field]?
87
+
88
+ def fields=: (
89
+ ::Hash[Symbol, Vatsense::Models::ValidateCheckResponse::Data::Match::Field]
90
+ ) -> ::Hash[Symbol, Vatsense::Models::ValidateCheckResponse::Data::Match::Field]
91
+
92
+ attr_reader result: String?
93
+
94
+ def result=: (String) -> String
95
+
96
+ attr_accessor score: Integer?
97
+
98
+ def initialize: (
99
+ ?fields: ::Hash[Symbol, Vatsense::Models::ValidateCheckResponse::Data::Match::Field],
100
+ ?result: String,
101
+ ?score: Integer?
102
+ ) -> void
103
+
104
+ def to_hash: -> {
105
+ fields: ::Hash[Symbol, Vatsense::Models::ValidateCheckResponse::Data::Match::Field],
106
+ result: String,
107
+ score: Integer?
108
+ }
109
+
110
+ type field = { result: String, score: Integer?, vies: String? }
111
+
112
+ class Field < Vatsense::Internal::Type::BaseModel
113
+ attr_reader result: String?
114
+
115
+ def result=: (String) -> String
116
+
117
+ attr_accessor score: Integer?
118
+
119
+ attr_accessor vies: String?
120
+
121
+ def initialize: (?result: String, ?score: Integer?, ?vies: String?) -> void
122
+
123
+ def to_hash: -> { result: String, score: Integer?, vies: String? }
124
+ end
125
+ end
126
+
69
127
  type company =
70
128
  Vatsense::Models::ValidateCheckResponse::Data::Company::ValidationCompany
71
129
  | Vatsense::Models::ValidateCheckResponse::Data::Company::EoriValidationCompany
@@ -16,6 +16,8 @@ module Vatsense
16
16
  ?is_copy: bool,
17
17
  ?is_reverse_charge: bool,
18
18
  ?notes: String,
19
+ ?original_invoice_id: String?,
20
+ ?idempotency_key: String,
19
21
  ?pad_invoice_number: Integer,
20
22
  ?serial: String,
21
23
  ?tax_type: Vatsense::Models::CreateInvoice::tax_type,
@@ -6,6 +6,7 @@ module Vatsense
6
6
  ?eu: bool,
7
7
  ?ip_address: String,
8
8
  ?period: Time,
9
+ ?provinces: bool,
9
10
  ?request_options: Vatsense::request_opts
10
11
  ) -> Vatsense::Models::RateListResponse
11
12
 
@@ -3,6 +3,11 @@ module Vatsense
3
3
  class Validate
4
4
  def check: (
5
5
  ?eori_number: String,
6
+ ?match_address: String,
7
+ ?match_city: String,
8
+ ?match_company_name: String,
9
+ ?match_postcode: String,
10
+ ?match_street: String,
6
11
  ?requester_vat_number: String,
7
12
  ?vat_number: String,
8
13
  ?request_options: Vatsense::request_opts
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vatsense
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vat Sense
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-04 00:00:00.000000000 Z
11
+ date: 2026-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi