fiscalrail 0.4.0 → 0.5.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/CHANGELOG.md +6 -0
- data/README.md +8 -7
- data/lib/fiscalrail/client.rb +2 -1
- data/lib/fiscalrail/generated/contract.rb +92 -80
- data/lib/fiscalrail/generated/models.rb +17 -10
- data/lib/fiscalrail/resources/accounts.rb +16 -10
- data/lib/fiscalrail/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4d9fcbcf8bfd05d48cce8ca79c50e6053d989ef54c0a2b67b5c386764f71b8a0
|
|
4
|
+
data.tar.gz: e1026a8001318bfb1914add9feb13409818b1f8d54937fc7569c4776474763a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 85026a467a16b3bc54a33306720743d41aba4ea63b7e3072e30240f2b4d67bb6d54cf38293d92098b9ad0b05da755e671c39e6e559bd0675c942a5fe78c05995
|
|
7
|
+
data.tar.gz: ef408ec27b12fe12d907de2abaa8d15a9be13485437f1c5985f442d94fde4615dc519975805221c266acbfdb1834aaaa0c8ee8f39918db98c743bf3d9371f43a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0 — 2026-09-28
|
|
4
|
+
|
|
5
|
+
- Match the deployed current-account API routes and split invoicing settings into a dedicated resource.
|
|
6
|
+
- Use `/tax-ids/{id}` for tax ID retrieval.
|
|
7
|
+
- Regenerate response and request types from the updated FiscalRail OpenAPI contract.
|
|
8
|
+
|
|
3
9
|
## 0.4.0 — 2026-09-07
|
|
4
10
|
|
|
5
11
|
- Start at 0.4.0 to match the Python SDK release with full resource coverage.
|
data/README.md
CHANGED
|
@@ -5,7 +5,7 @@ A Ruby client for issuing immutable invoices through FiscalRail. Ruby 3.3 or lat
|
|
|
5
5
|
Install with Bundler:
|
|
6
6
|
|
|
7
7
|
```ruby
|
|
8
|
-
gem "fiscalrail", "~> 0.
|
|
8
|
+
gem "fiscalrail", "~> 0.5.0"
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Issue an invoice
|
|
@@ -83,9 +83,10 @@ By default, the SDK makes at most two retries for connection failures, timeouts,
|
|
|
83
83
|
|
|
84
84
|
| Resource | Methods |
|
|
85
85
|
| --- | --- |
|
|
86
|
-
| `accounts` | `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
86
|
+
| `accounts` | `retrieve`, `update` |
|
|
87
|
+
| `account_invoicing` | `retrieve`, `update` |
|
|
88
|
+
| `balances` | `retrieve` |
|
|
89
|
+
| `account_tax_regimes` | `retrieve` |
|
|
89
90
|
| `api_keys` | `list`, `create`, `retrieve`, `delete` |
|
|
90
91
|
| `customers` | `list`, `create`, `retrieve`, `update`, `delete` |
|
|
91
92
|
| `event_destinations` | `list`, `create`, `retrieve`, `update`, `delete`, `enable`, `disable` |
|
|
@@ -114,7 +115,7 @@ end
|
|
|
114
115
|
first_ten = client.customers.auto_paging_each.lazy.take(10).to_a
|
|
115
116
|
```
|
|
116
117
|
|
|
117
|
-
Automatic iteration proceeds forward and preserves filters. Use `list(starting_after: ...)` or `list(ending_before: ...)` to manage cursors yourself.
|
|
118
|
+
Automatic iteration proceeds forward and preserves filters. Use `list(starting_after: ...)` or `list(ending_before: ...)` to manage cursors yourself. Account, account invoicing, balance, and account tax regime resources return single objects.
|
|
118
119
|
|
|
119
120
|
## Payment instructions
|
|
120
121
|
|
|
@@ -129,7 +130,7 @@ instruction = client.payment_instructions.create(
|
|
|
129
130
|
}
|
|
130
131
|
)
|
|
131
132
|
|
|
132
|
-
client.
|
|
133
|
+
client.account_invoicing.update(default_payment_instructions: [instruction.id])
|
|
133
134
|
|
|
134
135
|
invoice = client.invoices.issue(
|
|
135
136
|
payment_terms: { due_date: Date.new(2026, 9, 30) },
|
|
@@ -182,7 +183,7 @@ FiscalRail::Client.open(
|
|
|
182
183
|
write_timeout: 30,
|
|
183
184
|
max_retries: 2
|
|
184
185
|
) do |client|
|
|
185
|
-
client.accounts.
|
|
186
|
+
client.accounts.retrieve
|
|
186
187
|
end
|
|
187
188
|
```
|
|
188
189
|
|
data/lib/fiscalrail/client.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module FiscalRail
|
|
4
4
|
class Client
|
|
5
|
-
attr_reader :accounts, :balances, :account_tax_regimes, :api_keys, :customers,
|
|
5
|
+
attr_reader :accounts, :account_invoicing, :balances, :account_tax_regimes, :api_keys, :customers,
|
|
6
6
|
:event_destinations, :events, :invoice_series, :invoices, :invoice_pdfs,
|
|
7
7
|
:payment_instructions, :tax_ids, :tax_regimes
|
|
8
8
|
|
|
@@ -20,6 +20,7 @@ module FiscalRail
|
|
|
20
20
|
@adapter = adapter || NetHTTPAdapter.new(open_timeout: open_timeout, read_timeout: read_timeout, write_timeout: write_timeout)
|
|
21
21
|
transport = Transport.new(api_key: api_key, base_url: base_url, max_retries: max_retries, adapter: @adapter)
|
|
22
22
|
@accounts = Resources::Accounts.new(transport)
|
|
23
|
+
@account_invoicing = Resources::AccountInvoicing.new(transport)
|
|
23
24
|
@balances = Resources::Balances.new(transport)
|
|
24
25
|
@account_tax_regimes = Resources::AccountTaxRegimes.new(transport)
|
|
25
26
|
@api_keys = Resources::ApiKeys.new(transport)
|
|
@@ -19,15 +19,6 @@ module FiscalRail
|
|
|
19
19
|
"format": "date-time",
|
|
20
20
|
"type": "string"
|
|
21
21
|
},
|
|
22
|
-
"default_payment_instructions": {
|
|
23
|
-
"items": {
|
|
24
|
-
"$ref": "#/components/schemas/PaymentInstructionId"
|
|
25
|
-
},
|
|
26
|
-
"type": "array"
|
|
27
|
-
},
|
|
28
|
-
"default_series": {
|
|
29
|
-
"$ref": "#/components/schemas/AccountDefaultSeries"
|
|
30
|
-
},
|
|
31
22
|
"email": {
|
|
32
23
|
"type": [
|
|
33
24
|
"string",
|
|
@@ -37,12 +28,6 @@ module FiscalRail
|
|
|
37
28
|
"id": {
|
|
38
29
|
"$ref": "#/components/schemas/AccountId"
|
|
39
30
|
},
|
|
40
|
-
"invoice_locale": {
|
|
41
|
-
"type": "string"
|
|
42
|
-
},
|
|
43
|
-
"invoice_numbering_scope": {
|
|
44
|
-
"$ref": "#/components/schemas/AccountInvoiceNumberingScope"
|
|
45
|
-
},
|
|
46
31
|
"live": {
|
|
47
32
|
"$ref": "#/components/schemas/Live"
|
|
48
33
|
},
|
|
@@ -84,10 +69,6 @@ module FiscalRail
|
|
|
84
69
|
"address",
|
|
85
70
|
"tax_regime",
|
|
86
71
|
"timezone",
|
|
87
|
-
"invoice_locale",
|
|
88
|
-
"invoice_numbering_scope",
|
|
89
|
-
"default_series",
|
|
90
|
-
"default_payment_instructions",
|
|
91
72
|
"created_at",
|
|
92
73
|
"updated_at"
|
|
93
74
|
],
|
|
@@ -133,30 +114,72 @@ module FiscalRail
|
|
|
133
114
|
"AccountInvoiceNumberingScope": {
|
|
134
115
|
"type": "string"
|
|
135
116
|
},
|
|
136
|
-
"
|
|
137
|
-
"model": "
|
|
117
|
+
"AccountInvoicing": {
|
|
118
|
+
"model": "AccountInvoicing",
|
|
138
119
|
"properties": {
|
|
139
|
-
"
|
|
120
|
+
"default_payment_instructions": {
|
|
140
121
|
"items": {
|
|
141
|
-
"$ref": "#/components/schemas/
|
|
122
|
+
"$ref": "#/components/schemas/PaymentInstructionId"
|
|
142
123
|
},
|
|
143
124
|
"type": "array"
|
|
144
125
|
},
|
|
145
|
-
"
|
|
146
|
-
"
|
|
126
|
+
"default_series": {
|
|
127
|
+
"$ref": "#/components/schemas/AccountDefaultSeries"
|
|
128
|
+
},
|
|
129
|
+
"footer": {
|
|
130
|
+
"type": [
|
|
131
|
+
"string",
|
|
132
|
+
"null"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"locale": {
|
|
136
|
+
"type": "string"
|
|
137
|
+
},
|
|
138
|
+
"numbering_scope": {
|
|
139
|
+
"$ref": "#/components/schemas/AccountInvoiceNumberingScope"
|
|
147
140
|
},
|
|
148
141
|
"object": {
|
|
149
|
-
"const": "
|
|
142
|
+
"const": "account_invoicing",
|
|
150
143
|
"type": "string"
|
|
151
144
|
}
|
|
152
145
|
},
|
|
153
146
|
"required": [
|
|
154
147
|
"object",
|
|
155
|
-
"
|
|
156
|
-
"
|
|
148
|
+
"locale",
|
|
149
|
+
"footer",
|
|
150
|
+
"numbering_scope",
|
|
151
|
+
"default_series",
|
|
152
|
+
"default_payment_instructions"
|
|
157
153
|
],
|
|
158
154
|
"type": "object"
|
|
159
155
|
},
|
|
156
|
+
"AccountInvoicingUpdate": {
|
|
157
|
+
"model": "AccountInvoicingUpdate",
|
|
158
|
+
"properties": {
|
|
159
|
+
"default_payment_instructions": {
|
|
160
|
+
"items": {
|
|
161
|
+
"$ref": "#/components/schemas/PaymentInstructionId"
|
|
162
|
+
},
|
|
163
|
+
"type": "array"
|
|
164
|
+
},
|
|
165
|
+
"default_series": {
|
|
166
|
+
"$ref": "#/components/schemas/AccountDefaultSeries"
|
|
167
|
+
},
|
|
168
|
+
"footer": {
|
|
169
|
+
"type": [
|
|
170
|
+
"string",
|
|
171
|
+
"null"
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"locale": {
|
|
175
|
+
"type": "string"
|
|
176
|
+
},
|
|
177
|
+
"numbering_scope": {
|
|
178
|
+
"$ref": "#/components/schemas/AccountInvoiceNumberingScope"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"type": "object"
|
|
182
|
+
},
|
|
160
183
|
"AccountNotConfiguredErrorResponse": {
|
|
161
184
|
"model": "AccountNotConfiguredErrorResponse",
|
|
162
185
|
"properties": {
|
|
@@ -206,17 +229,20 @@ module FiscalRail
|
|
|
206
229
|
"address": {
|
|
207
230
|
"$ref": "#/components/schemas/AddressUpdate"
|
|
208
231
|
},
|
|
209
|
-
"
|
|
210
|
-
"
|
|
211
|
-
"
|
|
212
|
-
|
|
213
|
-
|
|
232
|
+
"email": {
|
|
233
|
+
"type": [
|
|
234
|
+
"string",
|
|
235
|
+
"null"
|
|
236
|
+
]
|
|
214
237
|
},
|
|
215
|
-
"
|
|
216
|
-
"
|
|
238
|
+
"name": {
|
|
239
|
+
"type": "string"
|
|
217
240
|
},
|
|
218
|
-
"
|
|
219
|
-
"
|
|
241
|
+
"phone": {
|
|
242
|
+
"type": [
|
|
243
|
+
"string",
|
|
244
|
+
"null"
|
|
245
|
+
]
|
|
220
246
|
}
|
|
221
247
|
},
|
|
222
248
|
"type": "object"
|
|
@@ -3056,16 +3082,6 @@ module FiscalRail
|
|
|
3056
3082
|
}
|
|
3057
3083
|
}
|
|
3058
3084
|
},
|
|
3059
|
-
"listAccounts": {
|
|
3060
|
-
"method": "GET",
|
|
3061
|
-
"path": "/accounts",
|
|
3062
|
-
"parameters": [],
|
|
3063
|
-
"responses": {
|
|
3064
|
-
"200": {
|
|
3065
|
-
"$ref": "#/components/schemas/AccountList"
|
|
3066
|
-
}
|
|
3067
|
-
}
|
|
3068
|
-
},
|
|
3069
3085
|
"listApiKeys": {
|
|
3070
3086
|
"method": "GET",
|
|
3071
3087
|
"path": "/api-keys",
|
|
@@ -3290,30 +3306,28 @@ module FiscalRail
|
|
|
3290
3306
|
},
|
|
3291
3307
|
"retrieveAccount": {
|
|
3292
3308
|
"method": "GET",
|
|
3293
|
-
"path": "/
|
|
3294
|
-
"parameters": [
|
|
3295
|
-
{
|
|
3296
|
-
"name": "id",
|
|
3297
|
-
"in": "path",
|
|
3298
|
-
"required": true
|
|
3299
|
-
}
|
|
3300
|
-
],
|
|
3309
|
+
"path": "/account",
|
|
3310
|
+
"parameters": [],
|
|
3301
3311
|
"responses": {
|
|
3302
3312
|
"200": {
|
|
3303
3313
|
"$ref": "#/components/schemas/Account"
|
|
3304
3314
|
}
|
|
3305
3315
|
}
|
|
3306
3316
|
},
|
|
3307
|
-
"
|
|
3317
|
+
"retrieveAccountInvoicing": {
|
|
3308
3318
|
"method": "GET",
|
|
3309
|
-
"path": "/
|
|
3310
|
-
"parameters": [
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
"
|
|
3314
|
-
"required": true
|
|
3319
|
+
"path": "/account/invoicing",
|
|
3320
|
+
"parameters": [],
|
|
3321
|
+
"responses": {
|
|
3322
|
+
"200": {
|
|
3323
|
+
"$ref": "#/components/schemas/AccountInvoicing"
|
|
3315
3324
|
}
|
|
3316
|
-
|
|
3325
|
+
}
|
|
3326
|
+
},
|
|
3327
|
+
"retrieveAccountTaxRegime": {
|
|
3328
|
+
"method": "GET",
|
|
3329
|
+
"path": "/account/tax-regime",
|
|
3330
|
+
"parameters": [],
|
|
3317
3331
|
"responses": {
|
|
3318
3332
|
"200": {
|
|
3319
3333
|
"$ref": "#/components/schemas/AccountTaxRegime"
|
|
@@ -3338,14 +3352,8 @@ module FiscalRail
|
|
|
3338
3352
|
},
|
|
3339
3353
|
"retrieveBalance": {
|
|
3340
3354
|
"method": "GET",
|
|
3341
|
-
"path": "/
|
|
3342
|
-
"parameters": [
|
|
3343
|
-
{
|
|
3344
|
-
"name": "account_id",
|
|
3345
|
-
"in": "path",
|
|
3346
|
-
"required": true
|
|
3347
|
-
}
|
|
3348
|
-
],
|
|
3355
|
+
"path": "/account/balance",
|
|
3356
|
+
"parameters": [],
|
|
3349
3357
|
"responses": {
|
|
3350
3358
|
"200": {
|
|
3351
3359
|
"$ref": "#/components/schemas/Balance"
|
|
@@ -3466,7 +3474,7 @@ module FiscalRail
|
|
|
3466
3474
|
},
|
|
3467
3475
|
"retrieveTaxId": {
|
|
3468
3476
|
"method": "GET",
|
|
3469
|
-
"path": "/
|
|
3477
|
+
"path": "/tax-ids/{id}",
|
|
3470
3478
|
"parameters": [
|
|
3471
3479
|
{
|
|
3472
3480
|
"name": "id",
|
|
@@ -3498,20 +3506,24 @@ module FiscalRail
|
|
|
3498
3506
|
},
|
|
3499
3507
|
"updateAccount": {
|
|
3500
3508
|
"method": "PATCH",
|
|
3501
|
-
"path": "/
|
|
3502
|
-
"parameters": [
|
|
3503
|
-
{
|
|
3504
|
-
"name": "id",
|
|
3505
|
-
"in": "path",
|
|
3506
|
-
"required": true
|
|
3507
|
-
}
|
|
3508
|
-
],
|
|
3509
|
+
"path": "/account",
|
|
3510
|
+
"parameters": [],
|
|
3509
3511
|
"responses": {
|
|
3510
3512
|
"200": {
|
|
3511
3513
|
"$ref": "#/components/schemas/Account"
|
|
3512
3514
|
}
|
|
3513
3515
|
}
|
|
3514
3516
|
},
|
|
3517
|
+
"updateAccountInvoicing": {
|
|
3518
|
+
"method": "PATCH",
|
|
3519
|
+
"path": "/account/invoicing",
|
|
3520
|
+
"parameters": [],
|
|
3521
|
+
"responses": {
|
|
3522
|
+
"200": {
|
|
3523
|
+
"$ref": "#/components/schemas/AccountInvoicing"
|
|
3524
|
+
}
|
|
3525
|
+
}
|
|
3526
|
+
},
|
|
3515
3527
|
"updateCustomer": {
|
|
3516
3528
|
"method": "PATCH",
|
|
3517
3529
|
"path": "/customers/{id}",
|
|
@@ -6,12 +6,8 @@ module FiscalRail
|
|
|
6
6
|
class Account < Model
|
|
7
7
|
def address = self["address"]
|
|
8
8
|
def created_at = self["created_at"]
|
|
9
|
-
def default_payment_instructions = self["default_payment_instructions"]
|
|
10
|
-
def default_series = self["default_series"]
|
|
11
9
|
def email = self["email"]
|
|
12
10
|
def id = self["id"]
|
|
13
|
-
def invoice_locale = self["invoice_locale"]
|
|
14
|
-
def invoice_numbering_scope = self["invoice_numbering_scope"]
|
|
15
11
|
def live = self["live"]
|
|
16
12
|
def name = self["name"]
|
|
17
13
|
def object = self["object"]
|
|
@@ -28,12 +24,23 @@ module FiscalRail
|
|
|
28
24
|
def invoice = self["invoice"]
|
|
29
25
|
end
|
|
30
26
|
|
|
31
|
-
class
|
|
32
|
-
def
|
|
33
|
-
def
|
|
27
|
+
class AccountInvoicing < Model
|
|
28
|
+
def default_payment_instructions = self["default_payment_instructions"]
|
|
29
|
+
def default_series = self["default_series"]
|
|
30
|
+
def footer = self["footer"]
|
|
31
|
+
def locale = self["locale"]
|
|
32
|
+
def numbering_scope = self["numbering_scope"]
|
|
34
33
|
def object = self["object"]
|
|
35
34
|
end
|
|
36
35
|
|
|
36
|
+
class AccountInvoicingUpdate < Model
|
|
37
|
+
def default_payment_instructions = self["default_payment_instructions"]
|
|
38
|
+
def default_series = self["default_series"]
|
|
39
|
+
def footer = self["footer"]
|
|
40
|
+
def locale = self["locale"]
|
|
41
|
+
def numbering_scope = self["numbering_scope"]
|
|
42
|
+
end
|
|
43
|
+
|
|
37
44
|
class AccountNotConfiguredError < Model
|
|
38
45
|
def code = self["code"]
|
|
39
46
|
def message = self["message"]
|
|
@@ -45,9 +52,9 @@ module FiscalRail
|
|
|
45
52
|
|
|
46
53
|
class AccountUpdate < Model
|
|
47
54
|
def address = self["address"]
|
|
48
|
-
def
|
|
49
|
-
def
|
|
50
|
-
def
|
|
55
|
+
def email = self["email"]
|
|
56
|
+
def name = self["name"]
|
|
57
|
+
def phone = self["phone"]
|
|
51
58
|
end
|
|
52
59
|
|
|
53
60
|
class Address < Model
|
|
@@ -3,28 +3,34 @@
|
|
|
3
3
|
module FiscalRail
|
|
4
4
|
module Resources
|
|
5
5
|
class Accounts < Resource
|
|
6
|
-
def
|
|
7
|
-
request("
|
|
6
|
+
def retrieve
|
|
7
|
+
request("retrieveAccount", retry_safe: true)
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def
|
|
11
|
-
request("
|
|
10
|
+
def update(**params)
|
|
11
|
+
request("updateAccount", body: params)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class AccountInvoicing < Resource
|
|
16
|
+
def retrieve
|
|
17
|
+
request("retrieveAccountInvoicing", retry_safe: true)
|
|
12
18
|
end
|
|
13
19
|
|
|
14
|
-
def update(
|
|
15
|
-
request("
|
|
20
|
+
def update(**params)
|
|
21
|
+
request("updateAccountInvoicing", body: params)
|
|
16
22
|
end
|
|
17
23
|
end
|
|
18
24
|
|
|
19
25
|
class Balances < Resource
|
|
20
|
-
def retrieve
|
|
21
|
-
request("retrieveBalance",
|
|
26
|
+
def retrieve
|
|
27
|
+
request("retrieveBalance", retry_safe: true)
|
|
22
28
|
end
|
|
23
29
|
end
|
|
24
30
|
|
|
25
31
|
class AccountTaxRegimes < Resource
|
|
26
|
-
def retrieve
|
|
27
|
-
request("retrieveAccountTaxRegime",
|
|
32
|
+
def retrieve
|
|
33
|
+
request("retrieveAccountTaxRegime", retry_safe: true)
|
|
28
34
|
end
|
|
29
35
|
end
|
|
30
36
|
end
|
data/lib/fiscalrail/version.rb
CHANGED