Skip to content

Commit 49688ee

Browse files
author
sangeet-joy_xero
committed
[UST-4371] Add USST fields to Invoices and Credit Notes endpoints
1 parent b77a03f commit 49688ee

File tree

13 files changed

+994
-0
lines changed

13 files changed

+994
-0
lines changed

docs/v1/accounting/index.html

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,6 +2564,13 @@
25642564
"items" : {
25652565
"$ref" : "#/components/schemas/ValidationError"
25662566
}
2567+
},
2568+
"InvoiceAddresses" : {
2569+
"type" : "array",
2570+
"description" : "An array of addresses used to auto calculate sales tax",
2571+
"items" : {
2572+
"$ref" : "#/components/schemas/InvoiceAddress"
2573+
}
25672574
}
25682575
},
25692576
"description" : "",
@@ -3259,12 +3266,63 @@
32593266
"items" : {
32603267
"$ref" : "#/components/schemas/ValidationError"
32613268
}
3269+
},
3270+
"InvoiceAddresses" : {
3271+
"type" : "array",
3272+
"description" : "An array of addresses used to auto calculate sales tax",
3273+
"items" : {
3274+
"$ref" : "#/components/schemas/InvoiceAddress"
3275+
}
32623276
}
32633277
},
32643278
"description" : "",
32653279
"externalDocs" : {
32663280
"url" : "http://developer.xero.com/documentation/api/invoices/"
32673281
}
3282+
};
3283+
defs["InvoiceAddress"] = {
3284+
"title" : "",
3285+
"type" : "object",
3286+
"properties" : {
3287+
"InvoiceAddressType" : {
3288+
"type" : "string",
3289+
"description" : "Indicates whether the address is defined as origin (FROM) or destination (TO)",
3290+
"enum" : [ "FROM", "TO" ]
3291+
},
3292+
"AddressLine1" : {
3293+
"type" : "string",
3294+
"description" : "First line of a physical address"
3295+
},
3296+
"AddressLine2" : {
3297+
"type" : "string",
3298+
"description" : "Second line of a physical address"
3299+
},
3300+
"AddressLine3" : {
3301+
"type" : "string",
3302+
"description" : "Third line of a physical address"
3303+
},
3304+
"AddressLine4" : {
3305+
"type" : "string",
3306+
"description" : "Fourth line of a physical address"
3307+
},
3308+
"City" : {
3309+
"type" : "string",
3310+
"description" : "City of a physical address"
3311+
},
3312+
"Region" : {
3313+
"type" : "string",
3314+
"description" : "Region or state of a physical address"
3315+
},
3316+
"PostalCode" : {
3317+
"type" : "string",
3318+
"description" : "Postal code of a physical address"
3319+
},
3320+
"Country" : {
3321+
"type" : "string",
3322+
"description" : "Country of a physical address"
3323+
}
3324+
},
3325+
"description" : ""
32683326
};
32693327
defs["InvoiceReminder"] = {
32703328
"title" : "",
@@ -3660,6 +3718,22 @@
36603718
"description" : "The Xero identifier for a Repeating Invoice",
36613719
"format" : "uuid",
36623720
"example" : "00000000-0000-0000-0000-000000000000"
3721+
},
3722+
"Taxability" : {
3723+
"type" : "string",
3724+
"description" : "The type of taxability",
3725+
"enum" : [ "TAXABLE", "NON_TAXABLE", "EXEMPT", "PART_TAXABLE", "NOT_APPLICABLE" ]
3726+
},
3727+
"SalesTaxCodeId" : {
3728+
"type" : "number",
3729+
"description" : "The ID of the sales tax code"
3730+
},
3731+
"TaxBreakdown" : {
3732+
"type" : "array",
3733+
"description" : "An array of tax components defined for this line item",
3734+
"items" : {
3735+
"$ref" : "#/components/schemas/TaxBreakdownComponent"
3736+
}
36633737
}
36643738
},
36653739
"description" : "",
@@ -5699,6 +5773,55 @@
56995773
"externalDocs" : {
57005774
"url" : "https://developer.xero.com/documentation/api-guides/conversions"
57015775
}
5776+
};
5777+
defs["TaxBreakdownComponent"] = {
5778+
"title" : "",
5779+
"type" : "object",
5780+
"properties" : {
5781+
"TaxComponentId" : {
5782+
"type" : "string",
5783+
"description" : "The unique ID number of this component",
5784+
"format" : "uuid"
5785+
},
5786+
"Type" : {
5787+
"type" : "string",
5788+
"description" : "The type of the jurisdiction",
5789+
"enum" : [ "SYSGST/USCOUNTRY", "SYSGST/USSTATE", "SYSGST/USCOUNTY", "SYSGST/USCITY", "SYSGST/USSPECIAL" ]
5790+
},
5791+
"Name" : {
5792+
"type" : "string",
5793+
"description" : "The name of the jurisdiction"
5794+
},
5795+
"TaxPercentage" : {
5796+
"type" : "number",
5797+
"description" : "The percentage of the tax"
5798+
},
5799+
"TaxAmount" : {
5800+
"type" : "number",
5801+
"description" : "The amount of the tax"
5802+
},
5803+
"TaxableAmount" : {
5804+
"type" : "number",
5805+
"description" : "The amount that is taxable"
5806+
},
5807+
"NonTaxableAmount" : {
5808+
"type" : "number",
5809+
"description" : "The amount that is not taxable"
5810+
},
5811+
"ExemptAmount" : {
5812+
"type" : "number",
5813+
"description" : "The amount that is exempt"
5814+
},
5815+
"StateAssignedNo" : {
5816+
"type" : "string",
5817+
"description" : "The state assigned number of the jurisdiction"
5818+
},
5819+
"JurisdictionRegion" : {
5820+
"type" : "string",
5821+
"description" : "Name identifying the region within the country"
5822+
}
5823+
},
5824+
"description" : ""
57025825
};
57035826
defs["TaxComponent"] = {
57045827
"title" : "",

xero_python/accounting/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
ImportSummaryOrganisation,
8686
)
8787
from xero_python.accounting.models.invoice import Invoice
88+
from xero_python.accounting.models.invoice_address import InvoiceAddress
8889
from xero_python.accounting.models.invoice_reminder import InvoiceReminder
8990
from xero_python.accounting.models.invoice_reminders import InvoiceReminders
9091
from xero_python.accounting.models.invoices import Invoices
@@ -144,6 +145,7 @@
144145
from xero_python.accounting.models.sales_tracking_category import SalesTrackingCategory
145146
from xero_python.accounting.models.schedule import Schedule
146147
from xero_python.accounting.models.setup import Setup
148+
from xero_python.accounting.models.tax_breakdown_component import TaxBreakdownComponent
147149
from xero_python.accounting.models.tax_component import TaxComponent
148150
from xero_python.accounting.models.tax_rate import TaxRate
149151
from xero_python.accounting.models.tax_rates import TaxRates

xero_python/accounting/docs/CreditNote.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Name | Type | Description | Notes
3333
**has_errors** | **bool** | A boolean to indicate if a credit note has an validation errors | [optional] [default to False]
3434
**validation_errors** | [**list[ValidationError]**](ValidationError.md) | Displays array of validation error messages from the API | [optional]
3535
**warnings** | [**list[ValidationError]**](ValidationError.md) | Displays array of warning messages from the API | [optional]
36+
**invoice_addresses** | [**list[InvoiceAddress]**](InvoiceAddress.md) | An array of addresses used to auto calculate sales tax | [optional]
3637

3738
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
3839

xero_python/accounting/docs/Invoice.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Name | Type | Description | Notes
4343
**status_attribute_string** | **str** | A string to indicate if a invoice status | [optional]
4444
**validation_errors** | [**list[ValidationError]**](ValidationError.md) | Displays array of validation error messages from the API | [optional]
4545
**warnings** | [**list[ValidationError]**](ValidationError.md) | Displays array of warning messages from the API | [optional]
46+
**invoice_addresses** | [**list[InvoiceAddress]**](InvoiceAddress.md) | An array of addresses used to auto calculate sales tax | [optional]
4647

4748
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
4849

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# InvoiceAddress
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**invoice_address_type** | **str** | Indicates whether the address is defined as origin (FROM) or destination (TO) | [optional]
7+
**address_line1** | **str** | First line of a physical address | [optional]
8+
**address_line2** | **str** | Second line of a physical address | [optional]
9+
**address_line3** | **str** | Third line of a physical address | [optional]
10+
**address_line4** | **str** | Fourth line of a physical address | [optional]
11+
**city** | **str** | City of a physical address | [optional]
12+
**region** | **str** | Region or state of a physical address | [optional]
13+
**postal_code** | **str** | Postal code of a physical address | [optional]
14+
**country** | **str** | Country of a physical address | [optional]
15+
16+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
17+
18+

xero_python/accounting/docs/LineItem.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Name | Type | Description | Notes
1818
**discount_rate** | **float** | Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts | [optional]
1919
**discount_amount** | **float** | Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts. | [optional]
2020
**repeating_invoice_id** | **str** | The Xero identifier for a Repeating Invoice | [optional]
21+
**taxability** | **str** | The type of taxability | [optional]
22+
**sales_tax_code_id** | **float** | The ID of the sales tax code | [optional]
23+
**tax_breakdown** | [**list[TaxBreakdownComponent]**](TaxBreakdownComponent.md) | An array of tax components defined for this line item | [optional]
2124

2225
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
2326

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# TaxBreakdownComponent
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**tax_component_id** | **str** | The unique ID number of this component | [optional]
7+
**type** | **str** | The type of the jurisdiction | [optional]
8+
**name** | **str** | The name of the jurisdiction | [optional]
9+
**tax_percentage** | **float** | The percentage of the tax | [optional]
10+
**tax_amount** | **float** | The amount of the tax | [optional]
11+
**taxable_amount** | **float** | The amount that is taxable | [optional]
12+
**non_taxable_amount** | **float** | The amount that is not taxable | [optional]
13+
**exempt_amount** | **float** | The amount that is exempt | [optional]
14+
**state_assigned_no** | **str** | The state assigned number of the jurisdiction | [optional]
15+
**jurisdiction_region** | **str** | Name identifying the region within the country | [optional]
16+
17+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
18+
19+

xero_python/accounting/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
ImportSummaryOrganisation,
8181
)
8282
from xero_python.accounting.models.invoice import Invoice
83+
from xero_python.accounting.models.invoice_address import InvoiceAddress
8384
from xero_python.accounting.models.invoice_reminder import InvoiceReminder
8485
from xero_python.accounting.models.invoice_reminders import InvoiceReminders
8586
from xero_python.accounting.models.invoices import Invoices
@@ -139,6 +140,7 @@
139140
from xero_python.accounting.models.sales_tracking_category import SalesTrackingCategory
140141
from xero_python.accounting.models.schedule import Schedule
141142
from xero_python.accounting.models.setup import Setup
143+
from xero_python.accounting.models.tax_breakdown_component import TaxBreakdownComponent
142144
from xero_python.accounting.models.tax_component import TaxComponent
143145
from xero_python.accounting.models.tax_rate import TaxRate
144146
from xero_python.accounting.models.tax_rates import TaxRates

xero_python/accounting/models/credit_note.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class CreditNote(BaseModel):
6060
"has_errors": "bool",
6161
"validation_errors": "list[ValidationError]",
6262
"warnings": "list[ValidationError]",
63+
"invoice_addresses": "list[InvoiceAddress]",
6364
}
6465

6566
attribute_map = {
@@ -93,6 +94,7 @@ class CreditNote(BaseModel):
9394
"has_errors": "HasErrors",
9495
"validation_errors": "ValidationErrors",
9596
"warnings": "Warnings",
97+
"invoice_addresses": "InvoiceAddresses",
9698
}
9799

98100
def __init__(
@@ -127,6 +129,7 @@ def __init__(
127129
has_errors=False,
128130
validation_errors=None,
129131
warnings=None,
132+
invoice_addresses=None,
130133
): # noqa: E501
131134
"""CreditNote - a model defined in OpenAPI""" # noqa: E501
132135

@@ -160,6 +163,7 @@ def __init__(
160163
self._has_errors = None
161164
self._validation_errors = None
162165
self._warnings = None
166+
self._invoice_addresses = None
163167
self.discriminator = None
164168

165169
if type is not None:
@@ -222,6 +226,8 @@ def __init__(
222226
self.validation_errors = validation_errors
223227
if warnings is not None:
224228
self.warnings = warnings
229+
if invoice_addresses is not None:
230+
self.invoice_addresses = invoice_addresses
225231

226232
@property
227233
def type(self):
@@ -932,3 +938,26 @@ def warnings(self, warnings):
932938
"""
933939

934940
self._warnings = warnings
941+
942+
@property
943+
def invoice_addresses(self):
944+
"""Gets the invoice_addresses of this CreditNote. # noqa: E501
945+
946+
An array of addresses used to auto calculate sales tax # noqa: E501
947+
948+
:return: The invoice_addresses of this CreditNote. # noqa: E501
949+
:rtype: list[InvoiceAddress]
950+
"""
951+
return self._invoice_addresses
952+
953+
@invoice_addresses.setter
954+
def invoice_addresses(self, invoice_addresses):
955+
"""Sets the invoice_addresses of this CreditNote.
956+
957+
An array of addresses used to auto calculate sales tax # noqa: E501
958+
959+
:param invoice_addresses: The invoice_addresses of this CreditNote. # noqa: E501
960+
:type: list[InvoiceAddress]
961+
"""
962+
963+
self._invoice_addresses = invoice_addresses

xero_python/accounting/models/invoice.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class Invoice(BaseModel):
7070
"status_attribute_string": "str",
7171
"validation_errors": "list[ValidationError]",
7272
"warnings": "list[ValidationError]",
73+
"invoice_addresses": "list[InvoiceAddress]",
7374
}
7475

7576
attribute_map = {
@@ -113,6 +114,7 @@ class Invoice(BaseModel):
113114
"status_attribute_string": "StatusAttributeString",
114115
"validation_errors": "ValidationErrors",
115116
"warnings": "Warnings",
117+
"invoice_addresses": "InvoiceAddresses",
116118
}
117119

118120
def __init__(
@@ -157,6 +159,7 @@ def __init__(
157159
status_attribute_string=None,
158160
validation_errors=None,
159161
warnings=None,
162+
invoice_addresses=None,
160163
): # noqa: E501
161164
"""Invoice - a model defined in OpenAPI""" # noqa: E501
162165

@@ -200,6 +203,7 @@ def __init__(
200203
self._status_attribute_string = None
201204
self._validation_errors = None
202205
self._warnings = None
206+
self._invoice_addresses = None
203207
self.discriminator = None
204208

205209
if type is not None:
@@ -282,6 +286,8 @@ def __init__(
282286
self.validation_errors = validation_errors
283287
if warnings is not None:
284288
self.warnings = warnings
289+
if invoice_addresses is not None:
290+
self.invoice_addresses = invoice_addresses
285291

286292
@property
287293
def type(self):
@@ -1237,3 +1243,26 @@ def warnings(self, warnings):
12371243
"""
12381244

12391245
self._warnings = warnings
1246+
1247+
@property
1248+
def invoice_addresses(self):
1249+
"""Gets the invoice_addresses of this Invoice. # noqa: E501
1250+
1251+
An array of addresses used to auto calculate sales tax # noqa: E501
1252+
1253+
:return: The invoice_addresses of this Invoice. # noqa: E501
1254+
:rtype: list[InvoiceAddress]
1255+
"""
1256+
return self._invoice_addresses
1257+
1258+
@invoice_addresses.setter
1259+
def invoice_addresses(self, invoice_addresses):
1260+
"""Sets the invoice_addresses of this Invoice.
1261+
1262+
An array of addresses used to auto calculate sales tax # noqa: E501
1263+
1264+
:param invoice_addresses: The invoice_addresses of this Invoice. # noqa: E501
1265+
:type: list[InvoiceAddress]
1266+
"""
1267+
1268+
self._invoice_addresses = invoice_addresses

0 commit comments

Comments
 (0)