From 9402a7abf06181a383c9bfccb95fef4fd9cf6dd1 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Mon, 1 Jan 2024 15:25:01 +0000 Subject: [PATCH] feat(api): add currency fields --- LICENSE | 2 +- .../resources/customers/credits/credits.py | 16 ++++ src/orb/resources/customers/credits/ledger.py | 96 +++++++++++++++++++ src/orb/resources/customers/customers.py | 6 ++ src/orb/resources/plans/plans.py | 8 +- src/orb/types/customer.py | 3 + src/orb/types/customer_create_params.py | 3 + .../customer_update_by_external_id_params.py | 3 + src/orb/types/customer_update_params.py | 3 + .../credit_list_by_external_id_params.py | 3 + src/orb/types/customers/credit_list_params.py | 3 + ...dger_create_entry_by_external_id_params.py | 35 +++++++ ...er_create_entry_by_external_id_response.py | 14 +++ .../credits/ledger_create_entry_params.py | 35 +++++++ .../credits/ledger_create_entry_response.py | 14 +++ .../ledger_list_by_external_id_params.py | 1 + .../ledger_list_by_external_id_response.py | 14 +++ .../customers/credits/ledger_list_params.py | 1 + .../customers/credits/ledger_list_response.py | 14 +++ src/orb/types/invoice.py | 3 + .../types/invoice_fetch_upcoming_response.py | 3 + src/orb/types/plan_create_params.py | 4 +- .../customers/credits/test_ledger.py | 20 ++++ tests/api_resources/customers/test_credits.py | 4 + tests/api_resources/test_customers.py | 24 ++--- 25 files changed, 313 insertions(+), 19 deletions(-) diff --git a/LICENSE b/LICENSE index 0576d5b8..782200ee 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2023 Orb + Copyright 2024 Orb Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/orb/resources/customers/credits/credits.py b/src/orb/resources/customers/credits/credits.py index 3d94d710..deb0a2ea 100644 --- a/src/orb/resources/customers/credits/credits.py +++ b/src/orb/resources/customers/credits/credits.py @@ -44,6 +44,7 @@ def list( self, customer_id: Optional[str], *, + currency: Optional[str] | NotGiven = NOT_GIVEN, cursor: Optional[str] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, # 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( Returns a paginated list of unexpired, non-zero credit blocks for a customer. Args: + currency: The ledger currency or custom pricing unit to use. + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. @@ -80,6 +83,7 @@ def list( timeout=timeout, query=maybe_transform( { + "currency": currency, "cursor": cursor, "limit": limit, }, @@ -93,6 +97,7 @@ def list_by_external_id( self, external_customer_id: Optional[str], *, + currency: Optional[str] | NotGiven = NOT_GIVEN, cursor: Optional[str] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, # 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( Returns a paginated list of unexpired, non-zero credit blocks for a customer. Args: + currency: The ledger currency or custom pricing unit to use. + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. @@ -129,6 +136,7 @@ def list_by_external_id( timeout=timeout, query=maybe_transform( { + "currency": currency, "cursor": cursor, "limit": limit, }, @@ -152,6 +160,7 @@ def list( self, customer_id: Optional[str], *, + currency: Optional[str] | NotGiven = NOT_GIVEN, cursor: Optional[str] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, # 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( Returns a paginated list of unexpired, non-zero credit blocks for a customer. Args: + currency: The ledger currency or custom pricing unit to use. + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. @@ -188,6 +199,7 @@ def list( timeout=timeout, query=maybe_transform( { + "currency": currency, "cursor": cursor, "limit": limit, }, @@ -201,6 +213,7 @@ def list_by_external_id( self, external_customer_id: Optional[str], *, + currency: Optional[str] | NotGiven = NOT_GIVEN, cursor: Optional[str] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, # 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( Returns a paginated list of unexpired, non-zero credit blocks for a customer. Args: + currency: The ledger currency or custom pricing unit to use. + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. @@ -237,6 +252,7 @@ def list_by_external_id( timeout=timeout, query=maybe_transform( { + "currency": currency, "cursor": cursor, "limit": limit, }, diff --git a/src/orb/resources/customers/credits/ledger.py b/src/orb/resources/customers/credits/ledger.py index 34e87443..aeb87522 100644 --- a/src/orb/resources/customers/credits/ledger.py +++ b/src/orb/resources/customers/credits/ledger.py @@ -154,6 +154,8 @@ def list( entry will be added to the ledger to indicate the adjustment of credits. Args: + currency: The ledger currency or custom pricing unit to use. + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. @@ -201,6 +203,7 @@ def create_entry( *, amount: float, entry_type: Literal["increment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, @@ -331,6 +334,9 @@ def create_entry( amount: The number of credits to effect. Note that this is required for increment, decrement, void, or undo operations. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -372,6 +378,7 @@ def create_entry( *, amount: float, entry_type: Literal["decrement"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -497,6 +504,9 @@ def create_entry( amount: The number of credits to effect. Note that this is required for increment, decrement, void, or undo operations. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -527,6 +537,7 @@ def create_entry( target_expiry_date: Union[str, date], amount: Optional[float] | NotGiven = NOT_GIVEN, block_id: Optional[str] | NotGiven = NOT_GIVEN, + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -662,6 +673,9 @@ def create_entry( block_id: The ID of the block affected by an expiration_change, used to differentiate between multiple blocks with the same `expiry_date`. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -690,6 +704,7 @@ def create_entry( amount: float, block_id: str, entry_type: Literal["void"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, void_reason: Optional[Literal["refund"]] | NotGiven = NOT_GIVEN, @@ -818,6 +833,9 @@ def create_entry( block_id: The ID of the block to void. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -848,6 +866,7 @@ def create_entry( amount: float, block_id: str, entry_type: Literal["amendment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -975,6 +994,9 @@ def create_entry( block_id: The ID of the block to reverse a decrement from. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -1012,6 +1034,7 @@ def create_entry( | Literal["expiration_change"] | Literal["void"] | Literal["amendment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, @@ -1038,6 +1061,7 @@ def create_entry( { "amount": amount, "entry_type": entry_type, + "currency": currency, "description": description, "effective_date": effective_date, "expiry_date": expiry_date, @@ -1070,6 +1094,7 @@ def create_entry_by_external_id( *, amount: float, entry_type: Literal["increment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, @@ -1202,6 +1227,9 @@ def create_entry_by_external_id( amount: The number of credits to effect. Note that this is required for increment, decrement, void, or undo operations. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -1243,6 +1271,7 @@ def create_entry_by_external_id( *, amount: float, entry_type: Literal["decrement"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1368,6 +1397,9 @@ def create_entry_by_external_id( amount: The number of credits to effect. Note that this is required for increment, decrement, void, or undo operations. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -1398,6 +1430,7 @@ def create_entry_by_external_id( target_expiry_date: Union[str, date], amount: Optional[float] | NotGiven = NOT_GIVEN, block_id: Optional[str] | NotGiven = NOT_GIVEN, + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1533,6 +1566,9 @@ def create_entry_by_external_id( block_id: The ID of the block affected by an expiration_change, used to differentiate between multiple blocks with the same `expiry_date`. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -1561,6 +1597,7 @@ def create_entry_by_external_id( amount: float, block_id: str, entry_type: Literal["void"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, void_reason: Optional[Literal["refund"]] | NotGiven = NOT_GIVEN, @@ -1689,6 +1726,9 @@ def create_entry_by_external_id( block_id: The ID of the block to void. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -1719,6 +1759,7 @@ def create_entry_by_external_id( amount: float, block_id: str, entry_type: Literal["amendment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1846,6 +1887,9 @@ def create_entry_by_external_id( block_id: The ID of the block to reverse a decrement from. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -1883,6 +1927,7 @@ def create_entry_by_external_id( | Literal["expiration_change"] | Literal["void"] | Literal["amendment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, @@ -1911,6 +1956,7 @@ def create_entry_by_external_id( { "amount": amount, "entry_type": entry_type, + "currency": currency, "description": description, "effective_date": effective_date, "expiry_date": expiry_date, @@ -2052,6 +2098,8 @@ def list_by_external_id( entry will be added to the ledger to indicate the adjustment of credits. Args: + currency: The ledger currency or custom pricing unit to use. + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. @@ -2218,6 +2266,8 @@ def list( entry will be added to the ledger to indicate the adjustment of credits. Args: + currency: The ledger currency or custom pricing unit to use. + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. @@ -2265,6 +2315,7 @@ async def create_entry( *, amount: float, entry_type: Literal["increment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, @@ -2395,6 +2446,9 @@ async def create_entry( amount: The number of credits to effect. Note that this is required for increment, decrement, void, or undo operations. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -2436,6 +2490,7 @@ async def create_entry( *, amount: float, entry_type: Literal["decrement"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2561,6 +2616,9 @@ async def create_entry( amount: The number of credits to effect. Note that this is required for increment, decrement, void, or undo operations. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -2591,6 +2649,7 @@ async def create_entry( target_expiry_date: Union[str, date], amount: Optional[float] | NotGiven = NOT_GIVEN, block_id: Optional[str] | NotGiven = NOT_GIVEN, + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2726,6 +2785,9 @@ async def create_entry( block_id: The ID of the block affected by an expiration_change, used to differentiate between multiple blocks with the same `expiry_date`. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -2754,6 +2816,7 @@ async def create_entry( amount: float, block_id: str, entry_type: Literal["void"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, void_reason: Optional[Literal["refund"]] | NotGiven = NOT_GIVEN, @@ -2882,6 +2945,9 @@ async def create_entry( block_id: The ID of the block to void. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -2912,6 +2978,7 @@ async def create_entry( amount: float, block_id: str, entry_type: Literal["amendment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3039,6 +3106,9 @@ async def create_entry( block_id: The ID of the block to reverse a decrement from. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -3076,6 +3146,7 @@ async def create_entry( | Literal["expiration_change"] | Literal["void"] | Literal["amendment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, @@ -3102,6 +3173,7 @@ async def create_entry( { "amount": amount, "entry_type": entry_type, + "currency": currency, "description": description, "effective_date": effective_date, "expiry_date": expiry_date, @@ -3134,6 +3206,7 @@ async def create_entry_by_external_id( *, amount: float, entry_type: Literal["increment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, @@ -3266,6 +3339,9 @@ async def create_entry_by_external_id( amount: The number of credits to effect. Note that this is required for increment, decrement, void, or undo operations. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -3307,6 +3383,7 @@ async def create_entry_by_external_id( *, amount: float, entry_type: Literal["decrement"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3432,6 +3509,9 @@ async def create_entry_by_external_id( amount: The number of credits to effect. Note that this is required for increment, decrement, void, or undo operations. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -3462,6 +3542,7 @@ async def create_entry_by_external_id( target_expiry_date: Union[str, date], amount: Optional[float] | NotGiven = NOT_GIVEN, block_id: Optional[str] | NotGiven = NOT_GIVEN, + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3597,6 +3678,9 @@ async def create_entry_by_external_id( block_id: The ID of the block affected by an expiration_change, used to differentiate between multiple blocks with the same `expiry_date`. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -3625,6 +3709,7 @@ async def create_entry_by_external_id( amount: float, block_id: str, entry_type: Literal["void"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, void_reason: Optional[Literal["refund"]] | NotGiven = NOT_GIVEN, @@ -3753,6 +3838,9 @@ async def create_entry_by_external_id( block_id: The ID of the block to void. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -3783,6 +3871,7 @@ async def create_entry_by_external_id( amount: float, block_id: str, entry_type: Literal["amendment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3910,6 +3999,9 @@ async def create_entry_by_external_id( block_id: The ID of the block to reverse a decrement from. + currency: The currency or custom pricing unit to use for this ledger entry. If this is a + real-world currency, it must match the customer's invoicing currency. + description: Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. @@ -3947,6 +4039,7 @@ async def create_entry_by_external_id( | Literal["expiration_change"] | Literal["void"] | Literal["amendment"], + currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, @@ -3975,6 +4068,7 @@ async def create_entry_by_external_id( { "amount": amount, "entry_type": entry_type, + "currency": currency, "description": description, "effective_date": effective_date, "expiry_date": expiry_date, @@ -4116,6 +4210,8 @@ def list_by_external_id( entry will be added to the ledger to indicate the adjustment of credits. Args: + currency: The ledger currency or custom pricing unit to use. + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. diff --git a/src/orb/resources/customers/customers.py b/src/orb/resources/customers/customers.py index f228b1b0..86e31f01 100644 --- a/src/orb/resources/customers/customers.py +++ b/src/orb/resources/customers/customers.py @@ -139,6 +139,7 @@ def create( | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | @@ -336,6 +337,7 @@ def update( | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | @@ -712,6 +714,7 @@ def update_by_external_id( | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | @@ -929,6 +932,7 @@ async def create( | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | @@ -1126,6 +1130,7 @@ async def update( | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | @@ -1502,6 +1507,7 @@ async def update_by_external_id( | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | diff --git a/src/orb/resources/plans/plans.py b/src/orb/resources/plans/plans.py index 2f2051da..c377062a 100644 --- a/src/orb/resources/plans/plans.py +++ b/src/orb/resources/plans/plans.py @@ -59,8 +59,8 @@ def create( This endpoint allows creation of plans including their prices. Args: - currency: An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's - prices. + currency: An ISO 4217 currency string for invoices generated by subscriptions on this + plan. prices: Prices for this plan. If the plan has phases, this includes prices across all phases of the plan. @@ -310,8 +310,8 @@ async def create( This endpoint allows creation of plans including their prices. Args: - currency: An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's - prices. + currency: An ISO 4217 currency string for invoices generated by subscriptions on this + plan. prices: Prices for this plan. If the plan has phases, this includes prices across all phases of the plan. diff --git a/src/orb/types/customer.py b/src/orb/types/customer.py index 0698e1cb..9dbe92c4 100644 --- a/src/orb/types/customer.py +++ b/src/orb/types/customer.py @@ -47,6 +47,7 @@ class ShippingAddress(BaseModel): class TaxID(BaseModel): country: Literal[ + "AD", "AE", "AT", "AU", @@ -110,6 +111,7 @@ class TaxID(BaseModel): ] type: Literal[ + "ad_nrt", "ae_trn", "eu_vat", "au_abn", @@ -251,6 +253,7 @@ class Customer(BaseModel): | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | diff --git a/src/orb/types/customer_create_params.py b/src/orb/types/customer_create_params.py index cbcdc4ad..1f561be1 100644 --- a/src/orb/types/customer_create_params.py +++ b/src/orb/types/customer_create_params.py @@ -92,6 +92,7 @@ class CustomerCreateParams(TypedDict, total=False): | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | @@ -226,6 +227,7 @@ class ShippingAddress(TypedDict, total=False): class TaxID(TypedDict, total=False): country: Required[ Literal[ + "AD", "AE", "AT", "AU", @@ -291,6 +293,7 @@ class TaxID(TypedDict, total=False): type: Required[ Literal[ + "ad_nrt", "ae_trn", "eu_vat", "au_abn", diff --git a/src/orb/types/customer_update_by_external_id_params.py b/src/orb/types/customer_update_by_external_id_params.py index 56578a4e..ac3d60c3 100644 --- a/src/orb/types/customer_update_by_external_id_params.py +++ b/src/orb/types/customer_update_by_external_id_params.py @@ -85,6 +85,7 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | @@ -212,6 +213,7 @@ class ShippingAddress(TypedDict, total=False): class TaxID(TypedDict, total=False): country: Required[ Literal[ + "AD", "AE", "AT", "AU", @@ -277,6 +279,7 @@ class TaxID(TypedDict, total=False): type: Required[ Literal[ + "ad_nrt", "ae_trn", "eu_vat", "au_abn", diff --git a/src/orb/types/customer_update_params.py b/src/orb/types/customer_update_params.py index 41e0eaaa..e98b1754 100644 --- a/src/orb/types/customer_update_params.py +++ b/src/orb/types/customer_update_params.py @@ -85,6 +85,7 @@ class CustomerUpdateParams(TypedDict, total=False): | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | @@ -212,6 +213,7 @@ class ShippingAddress(TypedDict, total=False): class TaxID(TypedDict, total=False): country: Required[ Literal[ + "AD", "AE", "AT", "AU", @@ -277,6 +279,7 @@ class TaxID(TypedDict, total=False): type: Required[ Literal[ + "ad_nrt", "ae_trn", "eu_vat", "au_abn", diff --git a/src/orb/types/customers/credit_list_by_external_id_params.py b/src/orb/types/customers/credit_list_by_external_id_params.py index 1a108160..f87f201e 100644 --- a/src/orb/types/customers/credit_list_by_external_id_params.py +++ b/src/orb/types/customers/credit_list_by_external_id_params.py @@ -9,6 +9,9 @@ class CreditListByExternalIDParams(TypedDict, total=False): + currency: Optional[str] + """The ledger currency or custom pricing unit to use.""" + cursor: Optional[str] """Cursor for pagination. diff --git a/src/orb/types/customers/credit_list_params.py b/src/orb/types/customers/credit_list_params.py index 340ccdb7..7ff57767 100644 --- a/src/orb/types/customers/credit_list_params.py +++ b/src/orb/types/customers/credit_list_params.py @@ -9,6 +9,9 @@ class CreditListParams(TypedDict, total=False): + currency: Optional[str] + """The ledger currency or custom pricing unit to use.""" + cursor: Optional[str] """Cursor for pagination. diff --git a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py index 6c04efd8..233e7628 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py @@ -28,6 +28,13 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False): entry_type: Required[Literal["increment"]] + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + description: Optional[str] """Optional metadata that can be specified when adding ledger results via the API. @@ -96,6 +103,13 @@ class AddDecrementCreditLedgerEntryRequestParams(TypedDict, total=False): entry_type: Required[Literal["decrement"]] + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + description: Optional[str] """Optional metadata that can be specified when adding ledger results via the API. @@ -139,6 +153,13 @@ class AddExpirationChangeCreditLedgerEntryRequestParams(TypedDict, total=False): between multiple blocks with the same `expiry_date`. """ + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + description: Optional[str] """Optional metadata that can be specified when adding ledger results via the API. @@ -166,6 +187,13 @@ class AddVoidCreditLedgerEntryRequestParams(TypedDict, total=False): entry_type: Required[Literal["void"]] + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + description: Optional[str] """Optional metadata that can be specified when adding ledger results via the API. @@ -196,6 +224,13 @@ class AddAmendmentCreditLedgerEntryRequestParams(TypedDict, total=False): entry_type: Required[Literal["amendment"]] + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + description: Optional[str] """Optional metadata that can be specified when adding ledger results via the API. diff --git a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py index db2e61c2..d7dd844f 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py +++ b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py @@ -55,6 +55,8 @@ class IncrementLedgerEntry(BaseModel): credit_block: IncrementLedgerEntryCreditBlock + currency: str + customer: IncrementLedgerEntryCustomer description: Optional[str] @@ -101,6 +103,8 @@ class DecrementLedgerEntry(BaseModel): credit_block: DecrementLedgerEntryCreditBlock + currency: str + customer: DecrementLedgerEntryCustomer description: Optional[str] @@ -153,6 +157,8 @@ class ExpirationChangeLedgerEntry(BaseModel): credit_block: ExpirationChangeLedgerEntryCreditBlock + currency: str + customer: ExpirationChangeLedgerEntryCustomer description: Optional[str] @@ -201,6 +207,8 @@ class CreditBlockExpiryLedgerEntry(BaseModel): credit_block: CreditBlockExpiryLedgerEntryCreditBlock + currency: str + customer: CreditBlockExpiryLedgerEntryCustomer description: Optional[str] @@ -247,6 +255,8 @@ class VoidLedgerEntry(BaseModel): credit_block: VoidLedgerEntryCreditBlock + currency: str + customer: VoidLedgerEntryCustomer description: Optional[str] @@ -297,6 +307,8 @@ class VoidInitiatedLedgerEntry(BaseModel): credit_block: VoidInitiatedLedgerEntryCreditBlock + currency: str + customer: VoidInitiatedLedgerEntryCustomer description: Optional[str] @@ -349,6 +361,8 @@ class AmendmentLedgerEntry(BaseModel): credit_block: AmendmentLedgerEntryCreditBlock + currency: str + customer: AmendmentLedgerEntryCustomer description: Optional[str] diff --git a/src/orb/types/customers/credits/ledger_create_entry_params.py b/src/orb/types/customers/credits/ledger_create_entry_params.py index cfe67844..2ad3f7e8 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_params.py @@ -28,6 +28,13 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False): entry_type: Required[Literal["increment"]] + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + description: Optional[str] """Optional metadata that can be specified when adding ledger results via the API. @@ -96,6 +103,13 @@ class AddDecrementCreditLedgerEntryRequestParams(TypedDict, total=False): entry_type: Required[Literal["decrement"]] + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + description: Optional[str] """Optional metadata that can be specified when adding ledger results via the API. @@ -139,6 +153,13 @@ class AddExpirationChangeCreditLedgerEntryRequestParams(TypedDict, total=False): between multiple blocks with the same `expiry_date`. """ + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + description: Optional[str] """Optional metadata that can be specified when adding ledger results via the API. @@ -166,6 +187,13 @@ class AddVoidCreditLedgerEntryRequestParams(TypedDict, total=False): entry_type: Required[Literal["void"]] + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + description: Optional[str] """Optional metadata that can be specified when adding ledger results via the API. @@ -196,6 +224,13 @@ class AddAmendmentCreditLedgerEntryRequestParams(TypedDict, total=False): entry_type: Required[Literal["amendment"]] + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + description: Optional[str] """Optional metadata that can be specified when adding ledger results via the API. diff --git a/src/orb/types/customers/credits/ledger_create_entry_response.py b/src/orb/types/customers/credits/ledger_create_entry_response.py index 6ceb58f7..aed45870 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_response.py +++ b/src/orb/types/customers/credits/ledger_create_entry_response.py @@ -55,6 +55,8 @@ class IncrementLedgerEntry(BaseModel): credit_block: IncrementLedgerEntryCreditBlock + currency: str + customer: IncrementLedgerEntryCustomer description: Optional[str] @@ -101,6 +103,8 @@ class DecrementLedgerEntry(BaseModel): credit_block: DecrementLedgerEntryCreditBlock + currency: str + customer: DecrementLedgerEntryCustomer description: Optional[str] @@ -153,6 +157,8 @@ class ExpirationChangeLedgerEntry(BaseModel): credit_block: ExpirationChangeLedgerEntryCreditBlock + currency: str + customer: ExpirationChangeLedgerEntryCustomer description: Optional[str] @@ -201,6 +207,8 @@ class CreditBlockExpiryLedgerEntry(BaseModel): credit_block: CreditBlockExpiryLedgerEntryCreditBlock + currency: str + customer: CreditBlockExpiryLedgerEntryCustomer description: Optional[str] @@ -247,6 +255,8 @@ class VoidLedgerEntry(BaseModel): credit_block: VoidLedgerEntryCreditBlock + currency: str + customer: VoidLedgerEntryCustomer description: Optional[str] @@ -297,6 +307,8 @@ class VoidInitiatedLedgerEntry(BaseModel): credit_block: VoidInitiatedLedgerEntryCreditBlock + currency: str + customer: VoidInitiatedLedgerEntryCustomer description: Optional[str] @@ -349,6 +361,8 @@ class AmendmentLedgerEntry(BaseModel): credit_block: AmendmentLedgerEntryCreditBlock + currency: str + customer: AmendmentLedgerEntryCustomer description: Optional[str] diff --git a/src/orb/types/customers/credits/ledger_list_by_external_id_params.py b/src/orb/types/customers/credits/ledger_list_by_external_id_params.py index b3654908..15974c7c 100644 --- a/src/orb/types/customers/credits/ledger_list_by_external_id_params.py +++ b/src/orb/types/customers/credits/ledger_list_by_external_id_params.py @@ -21,6 +21,7 @@ class LedgerListByExternalIDParams(TypedDict, total=False): created_at_lte: Annotated[Union[str, datetime, None], PropertyInfo(alias="created_at[lte]", format="iso8601")] currency: Optional[str] + """The ledger currency or custom pricing unit to use.""" cursor: Optional[str] """Cursor for pagination. diff --git a/src/orb/types/customers/credits/ledger_list_by_external_id_response.py b/src/orb/types/customers/credits/ledger_list_by_external_id_response.py index e56be083..2cfcbcb6 100644 --- a/src/orb/types/customers/credits/ledger_list_by_external_id_response.py +++ b/src/orb/types/customers/credits/ledger_list_by_external_id_response.py @@ -55,6 +55,8 @@ class IncrementLedgerEntry(BaseModel): credit_block: IncrementLedgerEntryCreditBlock + currency: str + customer: IncrementLedgerEntryCustomer description: Optional[str] @@ -101,6 +103,8 @@ class DecrementLedgerEntry(BaseModel): credit_block: DecrementLedgerEntryCreditBlock + currency: str + customer: DecrementLedgerEntryCustomer description: Optional[str] @@ -153,6 +157,8 @@ class ExpirationChangeLedgerEntry(BaseModel): credit_block: ExpirationChangeLedgerEntryCreditBlock + currency: str + customer: ExpirationChangeLedgerEntryCustomer description: Optional[str] @@ -201,6 +207,8 @@ class CreditBlockExpiryLedgerEntry(BaseModel): credit_block: CreditBlockExpiryLedgerEntryCreditBlock + currency: str + customer: CreditBlockExpiryLedgerEntryCustomer description: Optional[str] @@ -247,6 +255,8 @@ class VoidLedgerEntry(BaseModel): credit_block: VoidLedgerEntryCreditBlock + currency: str + customer: VoidLedgerEntryCustomer description: Optional[str] @@ -297,6 +307,8 @@ class VoidInitiatedLedgerEntry(BaseModel): credit_block: VoidInitiatedLedgerEntryCreditBlock + currency: str + customer: VoidInitiatedLedgerEntryCustomer description: Optional[str] @@ -349,6 +361,8 @@ class AmendmentLedgerEntry(BaseModel): credit_block: AmendmentLedgerEntryCreditBlock + currency: str + customer: AmendmentLedgerEntryCustomer description: Optional[str] diff --git a/src/orb/types/customers/credits/ledger_list_params.py b/src/orb/types/customers/credits/ledger_list_params.py index 1307e7c0..7928f126 100644 --- a/src/orb/types/customers/credits/ledger_list_params.py +++ b/src/orb/types/customers/credits/ledger_list_params.py @@ -21,6 +21,7 @@ class LedgerListParams(TypedDict, total=False): created_at_lte: Annotated[Union[str, datetime, None], PropertyInfo(alias="created_at[lte]", format="iso8601")] currency: Optional[str] + """The ledger currency or custom pricing unit to use.""" cursor: Optional[str] """Cursor for pagination. diff --git a/src/orb/types/customers/credits/ledger_list_response.py b/src/orb/types/customers/credits/ledger_list_response.py index b40f4bbd..911f6866 100644 --- a/src/orb/types/customers/credits/ledger_list_response.py +++ b/src/orb/types/customers/credits/ledger_list_response.py @@ -55,6 +55,8 @@ class IncrementLedgerEntry(BaseModel): credit_block: IncrementLedgerEntryCreditBlock + currency: str + customer: IncrementLedgerEntryCustomer description: Optional[str] @@ -101,6 +103,8 @@ class DecrementLedgerEntry(BaseModel): credit_block: DecrementLedgerEntryCreditBlock + currency: str + customer: DecrementLedgerEntryCustomer description: Optional[str] @@ -153,6 +157,8 @@ class ExpirationChangeLedgerEntry(BaseModel): credit_block: ExpirationChangeLedgerEntryCreditBlock + currency: str + customer: ExpirationChangeLedgerEntryCustomer description: Optional[str] @@ -201,6 +207,8 @@ class CreditBlockExpiryLedgerEntry(BaseModel): credit_block: CreditBlockExpiryLedgerEntryCreditBlock + currency: str + customer: CreditBlockExpiryLedgerEntryCustomer description: Optional[str] @@ -247,6 +255,8 @@ class VoidLedgerEntry(BaseModel): credit_block: VoidLedgerEntryCreditBlock + currency: str + customer: VoidLedgerEntryCustomer description: Optional[str] @@ -297,6 +307,8 @@ class VoidInitiatedLedgerEntry(BaseModel): credit_block: VoidInitiatedLedgerEntryCreditBlock + currency: str + customer: VoidInitiatedLedgerEntryCustomer description: Optional[str] @@ -349,6 +361,8 @@ class AmendmentLedgerEntry(BaseModel): credit_block: AmendmentLedgerEntryCreditBlock + currency: str + customer: AmendmentLedgerEntryCustomer description: Optional[str] diff --git a/src/orb/types/invoice.py b/src/orb/types/invoice.py index 1d4492ba..62e9fc2a 100644 --- a/src/orb/types/invoice.py +++ b/src/orb/types/invoice.py @@ -153,6 +153,7 @@ class CustomerBalanceTransaction(BaseModel): class CustomerTaxID(BaseModel): country: Literal[ + "AD", "AE", "AT", "AU", @@ -216,6 +217,7 @@ class CustomerTaxID(BaseModel): ] type: Literal[ + "ad_nrt", "ae_trn", "eu_vat", "au_abn", @@ -748,6 +750,7 @@ class Invoice(BaseModel): | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | diff --git a/src/orb/types/invoice_fetch_upcoming_response.py b/src/orb/types/invoice_fetch_upcoming_response.py index 80cf3f2f..a6fc93ae 100644 --- a/src/orb/types/invoice_fetch_upcoming_response.py +++ b/src/orb/types/invoice_fetch_upcoming_response.py @@ -153,6 +153,7 @@ class CustomerBalanceTransaction(BaseModel): class CustomerTaxID(BaseModel): country: Literal[ + "AD", "AE", "AT", "AU", @@ -216,6 +217,7 @@ class CustomerTaxID(BaseModel): ] type: Literal[ + "ad_nrt", "ae_trn", "eu_vat", "au_abn", @@ -748,6 +750,7 @@ class InvoiceFetchUpcomingResponse(BaseModel): | Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index 9f43b5d0..32afdefc 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -39,8 +39,8 @@ class PlanCreateParams(TypedDict, total=False): currency: Required[str] """ - An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's - prices. + An ISO 4217 currency string for invoices generated by subscriptions on this + plan. """ name: Required[str] diff --git a/tests/api_resources/customers/credits/test_ledger.py b/tests/api_resources/customers/credits/test_ledger.py index 26bdc150..33d0fbc3 100644 --- a/tests/api_resources/customers/credits/test_ledger.py +++ b/tests/api_resources/customers/credits/test_ledger.py @@ -75,6 +75,7 @@ def test_method_create_entry_with_all_params_overload_1(self, client: Orb) -> No "string", amount=0, entry_type="increment", + currency="string", description="string", effective_date=parse_date("2019-12-27"), expiry_date=parse_date("2019-12-27"), @@ -114,6 +115,7 @@ def test_method_create_entry_with_all_params_overload_2(self, client: Orb) -> No "string", amount=0, entry_type="decrement", + currency="string", description="string", metadata={"foo": "string"}, ) @@ -149,6 +151,7 @@ def test_method_create_entry_with_all_params_overload_3(self, client: Orb) -> No target_expiry_date=parse_date("2019-12-27"), amount=0, block_id="string", + currency="string", description="string", metadata={"foo": "string"}, ) @@ -183,6 +186,7 @@ def test_method_create_entry_with_all_params_overload_4(self, client: Orb) -> No amount=0, block_id="string", entry_type="void", + currency="string", description="string", metadata={"foo": "string"}, void_reason="refund", @@ -218,6 +222,7 @@ def test_method_create_entry_with_all_params_overload_5(self, client: Orb) -> No amount=0, block_id="string", entry_type="amendment", + currency="string", description="string", metadata={"foo": "string"}, ) @@ -250,6 +255,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_1(self, cli "string", amount=0, entry_type="increment", + currency="string", description="string", effective_date=parse_date("2019-12-27"), expiry_date=parse_date("2019-12-27"), @@ -289,6 +295,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_2(self, cli "string", amount=0, entry_type="decrement", + currency="string", description="string", metadata={"foo": "string"}, ) @@ -324,6 +331,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_3(self, cli target_expiry_date=parse_date("2019-12-27"), amount=0, block_id="string", + currency="string", description="string", metadata={"foo": "string"}, ) @@ -358,6 +366,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_4(self, cli amount=0, block_id="string", entry_type="void", + currency="string", description="string", metadata={"foo": "string"}, void_reason="refund", @@ -393,6 +402,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_5(self, cli amount=0, block_id="string", entry_type="amendment", + currency="string", description="string", metadata={"foo": "string"}, ) @@ -497,6 +507,7 @@ async def test_method_create_entry_with_all_params_overload_1(self, client: Asyn "string", amount=0, entry_type="increment", + currency="string", description="string", effective_date=parse_date("2019-12-27"), expiry_date=parse_date("2019-12-27"), @@ -536,6 +547,7 @@ async def test_method_create_entry_with_all_params_overload_2(self, client: Asyn "string", amount=0, entry_type="decrement", + currency="string", description="string", metadata={"foo": "string"}, ) @@ -571,6 +583,7 @@ async def test_method_create_entry_with_all_params_overload_3(self, client: Asyn target_expiry_date=parse_date("2019-12-27"), amount=0, block_id="string", + currency="string", description="string", metadata={"foo": "string"}, ) @@ -605,6 +618,7 @@ async def test_method_create_entry_with_all_params_overload_4(self, client: Asyn amount=0, block_id="string", entry_type="void", + currency="string", description="string", metadata={"foo": "string"}, void_reason="refund", @@ -640,6 +654,7 @@ async def test_method_create_entry_with_all_params_overload_5(self, client: Asyn amount=0, block_id="string", entry_type="amendment", + currency="string", description="string", metadata={"foo": "string"}, ) @@ -672,6 +687,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_1(sel "string", amount=0, entry_type="increment", + currency="string", description="string", effective_date=parse_date("2019-12-27"), expiry_date=parse_date("2019-12-27"), @@ -711,6 +727,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_2(sel "string", amount=0, entry_type="decrement", + currency="string", description="string", metadata={"foo": "string"}, ) @@ -746,6 +763,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_3(sel target_expiry_date=parse_date("2019-12-27"), amount=0, block_id="string", + currency="string", description="string", metadata={"foo": "string"}, ) @@ -780,6 +798,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_4(sel amount=0, block_id="string", entry_type="void", + currency="string", description="string", metadata={"foo": "string"}, void_reason="refund", @@ -815,6 +834,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_5(sel amount=0, block_id="string", entry_type="amendment", + currency="string", description="string", metadata={"foo": "string"}, ) diff --git a/tests/api_resources/customers/test_credits.py b/tests/api_resources/customers/test_credits.py index f93c02d9..b796197c 100644 --- a/tests/api_resources/customers/test_credits.py +++ b/tests/api_resources/customers/test_credits.py @@ -32,6 +32,7 @@ def test_method_list(self, client: Orb) -> None: def test_method_list_with_all_params(self, client: Orb) -> None: credit = client.customers.credits.list( "string", + currency="string", cursor="string", limit=0, ) @@ -57,6 +58,7 @@ def test_method_list_by_external_id(self, client: Orb) -> None: def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: credit = client.customers.credits.list_by_external_id( "string", + currency="string", cursor="string", limit=0, ) @@ -88,6 +90,7 @@ async def test_method_list(self, client: AsyncOrb) -> None: async def test_method_list_with_all_params(self, client: AsyncOrb) -> None: credit = await client.customers.credits.list( "string", + currency="string", cursor="string", limit=0, ) @@ -113,6 +116,7 @@ async def test_method_list_by_external_id(self, client: AsyncOrb) -> None: async def test_method_list_by_external_id_with_all_params(self, client: AsyncOrb) -> None: credit = await client.customers.credits.list_by_external_id( "string", + currency="string", cursor="string", limit=0, ) diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index b5f0e278..52cda742 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -78,8 +78,8 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "country": "string", }, tax_id={ - "country": "AE", - "type": "ae_trn", + "country": "AD", + "type": "ad_nrt", "value": "string", }, timezone="string", @@ -151,8 +151,8 @@ def test_method_update_with_all_params(self, client: Orb) -> None: "country": "string", }, tax_id={ - "country": "AE", - "type": "ae_trn", + "country": "AD", + "type": "ad_nrt", "value": "string", }, ) @@ -294,8 +294,8 @@ def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None "country": "string", }, tax_id={ - "country": "AE", - "type": "ae_trn", + "country": "AD", + "type": "ad_nrt", "value": "string", }, ) @@ -372,8 +372,8 @@ async def test_method_create_with_all_params(self, client: AsyncOrb) -> None: "country": "string", }, tax_id={ - "country": "AE", - "type": "ae_trn", + "country": "AD", + "type": "ad_nrt", "value": "string", }, timezone="string", @@ -445,8 +445,8 @@ async def test_method_update_with_all_params(self, client: AsyncOrb) -> None: "country": "string", }, tax_id={ - "country": "AE", - "type": "ae_trn", + "country": "AD", + "type": "ad_nrt", "value": "string", }, ) @@ -588,8 +588,8 @@ async def test_method_update_by_external_id_with_all_params(self, client: AsyncO "country": "string", }, tax_id={ - "country": "AE", - "type": "ae_trn", + "country": "AD", + "type": "ad_nrt", "value": "string", }, )