Skip to content

Commit 593ef6e

Browse files
author
sangeet-joy_xero
committed
[UST-4371] Add USST fields to Invoices and Credit Notes endpoints
1 parent 082df2e commit 593ef6e

File tree

7 files changed

+399
-0
lines changed

7 files changed

+399
-0
lines changed

docs/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" : "",

src/gen/model/accounting/creditNote.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Allocation } from '././allocation';
22
import { Contact } from '././contact';
33
import { CurrencyCode } from '././currencyCode';
4+
import { InvoiceAddress } from '././invoiceAddress';
45
import { LineAmountTypes } from '././lineAmountTypes';
56
import { LineItem } from '././lineItem';
67
import { Payment } from '././payment';
@@ -118,6 +119,10 @@ export class CreditNote {
118119
* Displays array of warning messages from the API
119120
*/
120121
'warnings'?: Array<ValidationError>;
122+
/**
123+
* An array of addresses used to auto calculate sales tax
124+
*/
125+
'invoiceAddresses'?: Array<InvoiceAddress>;
121126

122127
static discriminator: string | undefined = undefined;
123128

@@ -271,6 +276,11 @@ export class CreditNote {
271276
"name": "warnings",
272277
"baseName": "Warnings",
273278
"type": "Array<ValidationError>"
279+
},
280+
{
281+
"name": "invoiceAddresses",
282+
"baseName": "InvoiceAddresses",
283+
"type": "Array<InvoiceAddress>"
274284
} ];
275285

276286
static getAttributeTypeMap() {

src/gen/model/accounting/invoice.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Attachment } from '././attachment';
22
import { Contact } from '././contact';
33
import { CreditNote } from '././creditNote';
44
import { CurrencyCode } from '././currencyCode';
5+
import { InvoiceAddress } from '././invoiceAddress';
56
import { LineAmountTypes } from '././lineAmountTypes';
67
import { LineItem } from '././lineItem';
78
import { Overpayment } from '././overpayment';
@@ -161,6 +162,10 @@ export class Invoice {
161162
* Displays array of warning messages from the API
162163
*/
163164
'warnings'?: Array<ValidationError>;
165+
/**
166+
* An array of addresses used to auto calculate sales tax
167+
*/
168+
'invoiceAddresses'?: Array<InvoiceAddress>;
164169

165170
static discriminator: string | undefined = undefined;
166171

@@ -364,6 +369,11 @@ export class Invoice {
364369
"name": "warnings",
365370
"baseName": "Warnings",
366371
"type": "Array<ValidationError>"
372+
},
373+
{
374+
"name": "invoiceAddresses",
375+
"baseName": "InvoiceAddresses",
376+
"type": "Array<InvoiceAddress>"
367377
} ];
368378

369379
static getAttributeTypeMap() {
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
2+
export class InvoiceAddress {
3+
/**
4+
* Indicates whether the address is defined as origin (FROM) or destination (TO)
5+
*/
6+
'invoiceAddressType'?: InvoiceAddress.InvoiceAddressTypeEnum;
7+
/**
8+
* First line of a physical address
9+
*/
10+
'addressLine1'?: string;
11+
/**
12+
* Second line of a physical address
13+
*/
14+
'addressLine2'?: string;
15+
/**
16+
* Third line of a physical address
17+
*/
18+
'addressLine3'?: string;
19+
/**
20+
* Fourth line of a physical address
21+
*/
22+
'addressLine4'?: string;
23+
/**
24+
* City of a physical address
25+
*/
26+
'city'?: string;
27+
/**
28+
* Region or state of a physical address
29+
*/
30+
'region'?: string;
31+
/**
32+
* Postal code of a physical address
33+
*/
34+
'postalCode'?: string;
35+
/**
36+
* Country of a physical address
37+
*/
38+
'country'?: string;
39+
40+
static discriminator: string | undefined = undefined;
41+
42+
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
43+
{
44+
"name": "invoiceAddressType",
45+
"baseName": "InvoiceAddressType",
46+
"type": "InvoiceAddress.InvoiceAddressTypeEnum"
47+
},
48+
{
49+
"name": "addressLine1",
50+
"baseName": "AddressLine1",
51+
"type": "string"
52+
},
53+
{
54+
"name": "addressLine2",
55+
"baseName": "AddressLine2",
56+
"type": "string"
57+
},
58+
{
59+
"name": "addressLine3",
60+
"baseName": "AddressLine3",
61+
"type": "string"
62+
},
63+
{
64+
"name": "addressLine4",
65+
"baseName": "AddressLine4",
66+
"type": "string"
67+
},
68+
{
69+
"name": "city",
70+
"baseName": "City",
71+
"type": "string"
72+
},
73+
{
74+
"name": "region",
75+
"baseName": "Region",
76+
"type": "string"
77+
},
78+
{
79+
"name": "postalCode",
80+
"baseName": "PostalCode",
81+
"type": "string"
82+
},
83+
{
84+
"name": "country",
85+
"baseName": "Country",
86+
"type": "string"
87+
} ];
88+
89+
static getAttributeTypeMap() {
90+
return InvoiceAddress.attributeTypeMap;
91+
}
92+
}
93+
94+
export namespace InvoiceAddress {
95+
export enum InvoiceAddressTypeEnum {
96+
FROM = <any> 'FROM',
97+
TO = <any> 'TO'
98+
}
99+
}

src/gen/model/accounting/lineItem.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { LineItemItem } from '././lineItemItem';
22
import { LineItemTracking } from '././lineItemTracking';
3+
import { TaxBreakdownComponent } from '././taxBreakdownComponent';
34

45
export class LineItem {
56
/**
@@ -59,6 +60,18 @@ export class LineItem {
5960
* The Xero identifier for a Repeating Invoice
6061
*/
6162
'repeatingInvoiceID'?: string;
63+
/**
64+
* The type of taxability
65+
*/
66+
'taxability'?: LineItem.TaxabilityEnum;
67+
/**
68+
* The ID of the sales tax code
69+
*/
70+
'salesTaxCodeId'?: number;
71+
/**
72+
* An array of tax components defined for this line item
73+
*/
74+
'taxBreakdown'?: Array<TaxBreakdownComponent>;
6275

6376
static discriminator: string | undefined = undefined;
6477

@@ -137,10 +150,34 @@ export class LineItem {
137150
"name": "repeatingInvoiceID",
138151
"baseName": "RepeatingInvoiceID",
139152
"type": "string"
153+
},
154+
{
155+
"name": "taxability",
156+
"baseName": "Taxability",
157+
"type": "LineItem.TaxabilityEnum"
158+
},
159+
{
160+
"name": "salesTaxCodeId",
161+
"baseName": "SalesTaxCodeId",
162+
"type": "number"
163+
},
164+
{
165+
"name": "taxBreakdown",
166+
"baseName": "TaxBreakdown",
167+
"type": "Array<TaxBreakdownComponent>"
140168
} ];
141169

142170
static getAttributeTypeMap() {
143171
return LineItem.attributeTypeMap;
144172
}
145173
}
146174

175+
export namespace LineItem {
176+
export enum TaxabilityEnum {
177+
TAXABLE = <any> 'TAXABLE',
178+
NONTAXABLE = <any> 'NON_TAXABLE',
179+
EXEMPT = <any> 'EXEMPT',
180+
PARTTAXABLE = <any> 'PART_TAXABLE',
181+
NOTAPPLICABLE = <any> 'NOT_APPLICABLE'
182+
}
183+
}

0 commit comments

Comments
 (0)