Skip to content

Commit 35574d3

Browse files
feat(api): add currency fields (#119)
1 parent dffd253 commit 35574d3

25 files changed

+313
-19
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2023 Orb
189+
Copyright 2024 Orb
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

src/orb/resources/customers/credits/credits.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def list(
4444
self,
4545
customer_id: Optional[str],
4646
*,
47+
currency: Optional[str] | NotGiven = NOT_GIVEN,
4748
cursor: Optional[str] | NotGiven = NOT_GIVEN,
4849
limit: int | NotGiven = NOT_GIVEN,
4950
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -57,6 +58,8 @@ def list(
5758
Returns a paginated list of unexpired, non-zero credit blocks for a customer.
5859
5960
Args:
61+
currency: The ledger currency or custom pricing unit to use.
62+
6063
cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned
6164
from the initial request.
6265
@@ -80,6 +83,7 @@ def list(
8083
timeout=timeout,
8184
query=maybe_transform(
8285
{
86+
"currency": currency,
8387
"cursor": cursor,
8488
"limit": limit,
8589
},
@@ -93,6 +97,7 @@ def list_by_external_id(
9397
self,
9498
external_customer_id: Optional[str],
9599
*,
100+
currency: Optional[str] | NotGiven = NOT_GIVEN,
96101
cursor: Optional[str] | NotGiven = NOT_GIVEN,
97102
limit: int | NotGiven = NOT_GIVEN,
98103
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -106,6 +111,8 @@ def list_by_external_id(
106111
Returns a paginated list of unexpired, non-zero credit blocks for a customer.
107112
108113
Args:
114+
currency: The ledger currency or custom pricing unit to use.
115+
109116
cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned
110117
from the initial request.
111118
@@ -129,6 +136,7 @@ def list_by_external_id(
129136
timeout=timeout,
130137
query=maybe_transform(
131138
{
139+
"currency": currency,
132140
"cursor": cursor,
133141
"limit": limit,
134142
},
@@ -152,6 +160,7 @@ def list(
152160
self,
153161
customer_id: Optional[str],
154162
*,
163+
currency: Optional[str] | NotGiven = NOT_GIVEN,
155164
cursor: Optional[str] | NotGiven = NOT_GIVEN,
156165
limit: int | NotGiven = NOT_GIVEN,
157166
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -165,6 +174,8 @@ def list(
165174
Returns a paginated list of unexpired, non-zero credit blocks for a customer.
166175
167176
Args:
177+
currency: The ledger currency or custom pricing unit to use.
178+
168179
cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned
169180
from the initial request.
170181
@@ -188,6 +199,7 @@ def list(
188199
timeout=timeout,
189200
query=maybe_transform(
190201
{
202+
"currency": currency,
191203
"cursor": cursor,
192204
"limit": limit,
193205
},
@@ -201,6 +213,7 @@ def list_by_external_id(
201213
self,
202214
external_customer_id: Optional[str],
203215
*,
216+
currency: Optional[str] | NotGiven = NOT_GIVEN,
204217
cursor: Optional[str] | NotGiven = NOT_GIVEN,
205218
limit: int | NotGiven = NOT_GIVEN,
206219
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -214,6 +227,8 @@ def list_by_external_id(
214227
Returns a paginated list of unexpired, non-zero credit blocks for a customer.
215228
216229
Args:
230+
currency: The ledger currency or custom pricing unit to use.
231+
217232
cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned
218233
from the initial request.
219234
@@ -237,6 +252,7 @@ def list_by_external_id(
237252
timeout=timeout,
238253
query=maybe_transform(
239254
{
255+
"currency": currency,
240256
"cursor": cursor,
241257
"limit": limit,
242258
},

src/orb/resources/customers/credits/ledger.py

Lines changed: 96 additions & 0 deletions
Large diffs are not rendered by default.

src/orb/resources/customers/customers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def create(
139139
140140
| Country | Type | Description |
141141
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
142+
| Andorra | `ad_nrt` | Andorran NRT number |
142143
| Australia | `au_abn` | Australian Business Number (AU ABN) |
143144
| Australia | `au_arn` | Australian Taxation Office Reference Number |
144145
| Austria | `eu_vat` | European VAT number |
@@ -336,6 +337,7 @@ def update(
336337
337338
| Country | Type | Description |
338339
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
340+
| Andorra | `ad_nrt` | Andorran NRT number |
339341
| Australia | `au_abn` | Australian Business Number (AU ABN) |
340342
| Australia | `au_arn` | Australian Taxation Office Reference Number |
341343
| Austria | `eu_vat` | European VAT number |
@@ -712,6 +714,7 @@ def update_by_external_id(
712714
713715
| Country | Type | Description |
714716
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
717+
| Andorra | `ad_nrt` | Andorran NRT number |
715718
| Australia | `au_abn` | Australian Business Number (AU ABN) |
716719
| Australia | `au_arn` | Australian Taxation Office Reference Number |
717720
| Austria | `eu_vat` | European VAT number |
@@ -929,6 +932,7 @@ async def create(
929932
930933
| Country | Type | Description |
931934
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
935+
| Andorra | `ad_nrt` | Andorran NRT number |
932936
| Australia | `au_abn` | Australian Business Number (AU ABN) |
933937
| Australia | `au_arn` | Australian Taxation Office Reference Number |
934938
| Austria | `eu_vat` | European VAT number |
@@ -1126,6 +1130,7 @@ async def update(
11261130
11271131
| Country | Type | Description |
11281132
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
1133+
| Andorra | `ad_nrt` | Andorran NRT number |
11291134
| Australia | `au_abn` | Australian Business Number (AU ABN) |
11301135
| Australia | `au_arn` | Australian Taxation Office Reference Number |
11311136
| Austria | `eu_vat` | European VAT number |
@@ -1502,6 +1507,7 @@ async def update_by_external_id(
15021507
15031508
| Country | Type | Description |
15041509
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
1510+
| Andorra | `ad_nrt` | Andorran NRT number |
15051511
| Australia | `au_abn` | Australian Business Number (AU ABN) |
15061512
| Australia | `au_arn` | Australian Taxation Office Reference Number |
15071513
| Austria | `eu_vat` | European VAT number |

src/orb/resources/plans/plans.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def create(
5959
This endpoint allows creation of plans including their prices.
6060
6161
Args:
62-
currency: An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's
63-
prices.
62+
currency: An ISO 4217 currency string for invoices generated by subscriptions on this
63+
plan.
6464
6565
prices: Prices for this plan. If the plan has phases, this includes prices across all
6666
phases of the plan.
@@ -310,8 +310,8 @@ async def create(
310310
This endpoint allows creation of plans including their prices.
311311
312312
Args:
313-
currency: An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's
314-
prices.
313+
currency: An ISO 4217 currency string for invoices generated by subscriptions on this
314+
plan.
315315
316316
prices: Prices for this plan. If the plan has phases, this includes prices across all
317317
phases of the plan.

src/orb/types/customer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class ShippingAddress(BaseModel):
4747

4848
class TaxID(BaseModel):
4949
country: Literal[
50+
"AD",
5051
"AE",
5152
"AT",
5253
"AU",
@@ -110,6 +111,7 @@ class TaxID(BaseModel):
110111
]
111112

112113
type: Literal[
114+
"ad_nrt",
113115
"ae_trn",
114116
"eu_vat",
115117
"au_abn",
@@ -251,6 +253,7 @@ class Customer(BaseModel):
251253
252254
| Country | Type | Description |
253255
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
256+
| Andorra | `ad_nrt` | Andorran NRT number |
254257
| Australia | `au_abn` | Australian Business Number (AU ABN) |
255258
| Australia | `au_arn` | Australian Taxation Office Reference Number |
256259
| Austria | `eu_vat` | European VAT number |

src/orb/types/customer_create_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class CustomerCreateParams(TypedDict, total=False):
9292
9393
| Country | Type | Description |
9494
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
95+
| Andorra | `ad_nrt` | Andorran NRT number |
9596
| Australia | `au_abn` | Australian Business Number (AU ABN) |
9697
| Australia | `au_arn` | Australian Taxation Office Reference Number |
9798
| Austria | `eu_vat` | European VAT number |
@@ -226,6 +227,7 @@ class ShippingAddress(TypedDict, total=False):
226227
class TaxID(TypedDict, total=False):
227228
country: Required[
228229
Literal[
230+
"AD",
229231
"AE",
230232
"AT",
231233
"AU",
@@ -291,6 +293,7 @@ class TaxID(TypedDict, total=False):
291293

292294
type: Required[
293295
Literal[
296+
"ad_nrt",
294297
"ae_trn",
295298
"eu_vat",
296299
"au_abn",

src/orb/types/customer_update_by_external_id_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False):
8585
8686
| Country | Type | Description |
8787
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
88+
| Andorra | `ad_nrt` | Andorran NRT number |
8889
| Australia | `au_abn` | Australian Business Number (AU ABN) |
8990
| Australia | `au_arn` | Australian Taxation Office Reference Number |
9091
| Austria | `eu_vat` | European VAT number |
@@ -212,6 +213,7 @@ class ShippingAddress(TypedDict, total=False):
212213
class TaxID(TypedDict, total=False):
213214
country: Required[
214215
Literal[
216+
"AD",
215217
"AE",
216218
"AT",
217219
"AU",
@@ -277,6 +279,7 @@ class TaxID(TypedDict, total=False):
277279

278280
type: Required[
279281
Literal[
282+
"ad_nrt",
280283
"ae_trn",
281284
"eu_vat",
282285
"au_abn",

src/orb/types/customer_update_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class CustomerUpdateParams(TypedDict, total=False):
8585
8686
| Country | Type | Description |
8787
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
88+
| Andorra | `ad_nrt` | Andorran NRT number |
8889
| Australia | `au_abn` | Australian Business Number (AU ABN) |
8990
| Australia | `au_arn` | Australian Taxation Office Reference Number |
9091
| Austria | `eu_vat` | European VAT number |
@@ -212,6 +213,7 @@ class ShippingAddress(TypedDict, total=False):
212213
class TaxID(TypedDict, total=False):
213214
country: Required[
214215
Literal[
216+
"AD",
215217
"AE",
216218
"AT",
217219
"AU",
@@ -277,6 +279,7 @@ class TaxID(TypedDict, total=False):
277279

278280
type: Required[
279281
Literal[
282+
"ad_nrt",
280283
"ae_trn",
281284
"eu_vat",
282285
"au_abn",

src/orb/types/customers/credit_list_by_external_id_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010

1111
class CreditListByExternalIDParams(TypedDict, total=False):
12+
currency: Optional[str]
13+
"""The ledger currency or custom pricing unit to use."""
14+
1215
cursor: Optional[str]
1316
"""Cursor for pagination.
1417

0 commit comments

Comments
 (0)