Skip to content

Commit 8855188

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

File tree

6 files changed

+1440
-6
lines changed

6 files changed

+1440
-6
lines changed

docs/v4/accounting/index.html

+123
Original file line numberDiff line numberDiff line change
@@ -2562,6 +2562,13 @@
25622562
"items" : {
25632563
"$ref" : "#/components/schemas/ValidationError"
25642564
}
2565+
},
2566+
"InvoiceAddresses" : {
2567+
"type" : "array",
2568+
"description" : "An array of addresses used to auto calculate sales tax",
2569+
"items" : {
2570+
"$ref" : "#/components/schemas/InvoiceAddress"
2571+
}
25652572
}
25662573
},
25672574
"description" : "",
@@ -3257,12 +3264,63 @@
32573264
"items" : {
32583265
"$ref" : "#/components/schemas/ValidationError"
32593266
}
3267+
},
3268+
"InvoiceAddresses" : {
3269+
"type" : "array",
3270+
"description" : "An array of addresses used to auto calculate sales tax",
3271+
"items" : {
3272+
"$ref" : "#/components/schemas/InvoiceAddress"
3273+
}
32603274
}
32613275
},
32623276
"description" : "",
32633277
"externalDocs" : {
32643278
"url" : "http://developer.xero.com/documentation/api/invoices/"
32653279
}
3280+
};
3281+
defs["InvoiceAddress"] = {
3282+
"title" : "",
3283+
"type" : "object",
3284+
"properties" : {
3285+
"InvoiceAddressType" : {
3286+
"type" : "string",
3287+
"description" : "Indicates whether the address is defined as origin (FROM) or destination (TO)",
3288+
"enum" : [ "FROM", "TO" ]
3289+
},
3290+
"AddressLine1" : {
3291+
"type" : "string",
3292+
"description" : "First line of a physical address"
3293+
},
3294+
"AddressLine2" : {
3295+
"type" : "string",
3296+
"description" : "Second line of a physical address"
3297+
},
3298+
"AddressLine3" : {
3299+
"type" : "string",
3300+
"description" : "Third line of a physical address"
3301+
},
3302+
"AddressLine4" : {
3303+
"type" : "string",
3304+
"description" : "Fourth line of a physical address"
3305+
},
3306+
"City" : {
3307+
"type" : "string",
3308+
"description" : "City of a physical address"
3309+
},
3310+
"Region" : {
3311+
"type" : "string",
3312+
"description" : "Region or state of a physical address"
3313+
},
3314+
"PostalCode" : {
3315+
"type" : "string",
3316+
"description" : "Postal code of a physical address"
3317+
},
3318+
"Country" : {
3319+
"type" : "string",
3320+
"description" : "Country of a physical address"
3321+
}
3322+
},
3323+
"description" : ""
32663324
};
32673325
defs["InvoiceReminder"] = {
32683326
"title" : "",
@@ -3658,6 +3716,22 @@
36583716
"description" : "The Xero identifier for a Repeating Invoice",
36593717
"format" : "uuid",
36603718
"example" : "00000000-0000-0000-0000-000000000000"
3719+
},
3720+
"Taxability" : {
3721+
"type" : "string",
3722+
"description" : "The type of taxability",
3723+
"enum" : [ "TAXABLE", "NON_TAXABLE", "EXEMPT", "PART_TAXABLE", "NOT_APPLICABLE" ]
3724+
},
3725+
"SalesTaxCodeId" : {
3726+
"type" : "number",
3727+
"description" : "The ID of the sales tax code"
3728+
},
3729+
"TaxBreakdown" : {
3730+
"type" : "array",
3731+
"description" : "An array of tax components defined for this line item",
3732+
"items" : {
3733+
"$ref" : "#/components/schemas/TaxBreakdownComponent"
3734+
}
36613735
}
36623736
},
36633737
"description" : "",
@@ -5697,6 +5771,55 @@
56975771
"externalDocs" : {
56985772
"url" : "https://developer.xero.com/documentation/api-guides/conversions"
56995773
}
5774+
};
5775+
defs["TaxBreakdownComponent"] = {
5776+
"title" : "",
5777+
"type" : "object",
5778+
"properties" : {
5779+
"TaxComponentId" : {
5780+
"type" : "string",
5781+
"description" : "The unique ID number of this component",
5782+
"format" : "uuid"
5783+
},
5784+
"Type" : {
5785+
"type" : "string",
5786+
"description" : "The type of the jurisdiction",
5787+
"enum" : [ "SYSGST/USCOUNTRY", "SYSGST/USSTATE", "SYSGST/USCOUNTY", "SYSGST/USCITY", "SYSGST/USSPECIAL" ]
5788+
},
5789+
"Name" : {
5790+
"type" : "string",
5791+
"description" : "The name of the jurisdiction"
5792+
},
5793+
"TaxPercentage" : {
5794+
"type" : "number",
5795+
"description" : "The percentage of the tax"
5796+
},
5797+
"TaxAmount" : {
5798+
"type" : "number",
5799+
"description" : "The amount of the tax"
5800+
},
5801+
"TaxableAmount" : {
5802+
"type" : "number",
5803+
"description" : "The amount that is taxable"
5804+
},
5805+
"NonTaxableAmount" : {
5806+
"type" : "number",
5807+
"description" : "The amount that is not taxable"
5808+
},
5809+
"ExemptAmount" : {
5810+
"type" : "number",
5811+
"description" : "The amount that is exempt"
5812+
},
5813+
"StateAssignedNo" : {
5814+
"type" : "string",
5815+
"description" : "The state assigned number of the jurisdiction"
5816+
},
5817+
"JurisdictionRegion" : {
5818+
"type" : "string",
5819+
"description" : "Name identifying the region within the country"
5820+
}
5821+
},
5822+
"description" : ""
57005823
};
57015824
defs["TaxComponent"] = {
57025825
"title" : "",

src/main/java/com/xero/models/accounting/CreditNote.java

+57-2
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ public static StatusEnum fromValue(String value) {
229229

230230
@JsonProperty("Warnings")
231231
private List<ValidationError> warnings = new ArrayList<ValidationError>();
232+
233+
@JsonProperty("InvoiceAddresses")
234+
private List<InvoiceAddress> invoiceAddresses = new ArrayList<InvoiceAddress>();
232235
/**
233236
* See Credit Note Types
234237
*
@@ -1403,6 +1406,55 @@ public void setWarnings(List<ValidationError> warnings) {
14031406
this.warnings = warnings;
14041407
}
14051408

1409+
/**
1410+
* An array of addresses used to auto calculate sales tax
1411+
*
1412+
* @param invoiceAddresses List&lt;InvoiceAddress&gt;
1413+
* @return CreditNote
1414+
*/
1415+
public CreditNote invoiceAddresses(List<InvoiceAddress> invoiceAddresses) {
1416+
this.invoiceAddresses = invoiceAddresses;
1417+
return this;
1418+
}
1419+
1420+
/**
1421+
* An array of addresses used to auto calculate sales tax
1422+
*
1423+
* @param invoiceAddressesItem InvoiceAddress
1424+
* @return CreditNote
1425+
*/
1426+
public CreditNote addInvoiceAddressesItem(InvoiceAddress invoiceAddressesItem) {
1427+
if (this.invoiceAddresses == null) {
1428+
this.invoiceAddresses = new ArrayList<InvoiceAddress>();
1429+
}
1430+
this.invoiceAddresses.add(invoiceAddressesItem);
1431+
return this;
1432+
}
1433+
1434+
/**
1435+
* An array of addresses used to auto calculate sales tax
1436+
*
1437+
* @return invoiceAddresses
1438+
*/
1439+
@ApiModelProperty(value = "An array of addresses used to auto calculate sales tax")
1440+
/**
1441+
* An array of addresses used to auto calculate sales tax
1442+
*
1443+
* @return invoiceAddresses List<InvoiceAddress>
1444+
*/
1445+
public List<InvoiceAddress> getInvoiceAddresses() {
1446+
return invoiceAddresses;
1447+
}
1448+
1449+
/**
1450+
* An array of addresses used to auto calculate sales tax
1451+
*
1452+
* @param invoiceAddresses List&lt;InvoiceAddress&gt;
1453+
*/
1454+
public void setInvoiceAddresses(List<InvoiceAddress> invoiceAddresses) {
1455+
this.invoiceAddresses = invoiceAddresses;
1456+
}
1457+
14061458
@Override
14071459
public boolean equals(java.lang.Object o) {
14081460
if (this == o) {
@@ -1441,7 +1493,8 @@ public boolean equals(java.lang.Object o) {
14411493
&& Objects.equals(this.hasAttachments, creditNote.hasAttachments)
14421494
&& Objects.equals(this.hasErrors, creditNote.hasErrors)
14431495
&& Objects.equals(this.validationErrors, creditNote.validationErrors)
1444-
&& Objects.equals(this.warnings, creditNote.warnings);
1496+
&& Objects.equals(this.warnings, creditNote.warnings)
1497+
&& Objects.equals(this.invoiceAddresses, creditNote.invoiceAddresses);
14451498
}
14461499

14471500
@Override
@@ -1476,7 +1529,8 @@ public int hashCode() {
14761529
hasAttachments,
14771530
hasErrors,
14781531
validationErrors,
1479-
warnings);
1532+
warnings,
1533+
invoiceAddresses);
14801534
}
14811535

14821536
@Override
@@ -1515,6 +1569,7 @@ public String toString() {
15151569
sb.append(" hasErrors: ").append(toIndentedString(hasErrors)).append("\n");
15161570
sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n");
15171571
sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n");
1572+
sb.append(" invoiceAddresses: ").append(toIndentedString(invoiceAddresses)).append("\n");
15181573
sb.append("}");
15191574
return sb.toString();
15201575
}

src/main/java/com/xero/models/accounting/Invoice.java

+57-2
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ public static StatusEnum fromValue(String value) {
277277

278278
@JsonProperty("Warnings")
279279
private List<ValidationError> warnings = new ArrayList<ValidationError>();
280+
281+
@JsonProperty("InvoiceAddresses")
282+
private List<InvoiceAddress> invoiceAddresses = new ArrayList<InvoiceAddress>();
280283
/**
281284
* See Invoice Types
282285
*
@@ -1577,6 +1580,55 @@ public void setWarnings(List<ValidationError> warnings) {
15771580
this.warnings = warnings;
15781581
}
15791582

1583+
/**
1584+
* An array of addresses used to auto calculate sales tax
1585+
*
1586+
* @param invoiceAddresses List&lt;InvoiceAddress&gt;
1587+
* @return Invoice
1588+
*/
1589+
public Invoice invoiceAddresses(List<InvoiceAddress> invoiceAddresses) {
1590+
this.invoiceAddresses = invoiceAddresses;
1591+
return this;
1592+
}
1593+
1594+
/**
1595+
* An array of addresses used to auto calculate sales tax
1596+
*
1597+
* @param invoiceAddressesItem InvoiceAddress
1598+
* @return Invoice
1599+
*/
1600+
public Invoice addInvoiceAddressesItem(InvoiceAddress invoiceAddressesItem) {
1601+
if (this.invoiceAddresses == null) {
1602+
this.invoiceAddresses = new ArrayList<InvoiceAddress>();
1603+
}
1604+
this.invoiceAddresses.add(invoiceAddressesItem);
1605+
return this;
1606+
}
1607+
1608+
/**
1609+
* An array of addresses used to auto calculate sales tax
1610+
*
1611+
* @return invoiceAddresses
1612+
*/
1613+
@ApiModelProperty(value = "An array of addresses used to auto calculate sales tax")
1614+
/**
1615+
* An array of addresses used to auto calculate sales tax
1616+
*
1617+
* @return invoiceAddresses List<InvoiceAddress>
1618+
*/
1619+
public List<InvoiceAddress> getInvoiceAddresses() {
1620+
return invoiceAddresses;
1621+
}
1622+
1623+
/**
1624+
* An array of addresses used to auto calculate sales tax
1625+
*
1626+
* @param invoiceAddresses List&lt;InvoiceAddress&gt;
1627+
*/
1628+
public void setInvoiceAddresses(List<InvoiceAddress> invoiceAddresses) {
1629+
this.invoiceAddresses = invoiceAddresses;
1630+
}
1631+
15801632
@Override
15811633
public boolean equals(java.lang.Object o) {
15821634
if (this == o) {
@@ -1625,7 +1677,8 @@ public boolean equals(java.lang.Object o) {
16251677
&& Objects.equals(this.hasErrors, invoice.hasErrors)
16261678
&& Objects.equals(this.statusAttributeString, invoice.statusAttributeString)
16271679
&& Objects.equals(this.validationErrors, invoice.validationErrors)
1628-
&& Objects.equals(this.warnings, invoice.warnings);
1680+
&& Objects.equals(this.warnings, invoice.warnings)
1681+
&& Objects.equals(this.invoiceAddresses, invoice.invoiceAddresses);
16291682
}
16301683

16311684
@Override
@@ -1670,7 +1723,8 @@ public int hashCode() {
16701723
hasErrors,
16711724
statusAttributeString,
16721725
validationErrors,
1673-
warnings);
1726+
warnings,
1727+
invoiceAddresses);
16741728
}
16751729

16761730
@Override
@@ -1721,6 +1775,7 @@ public String toString() {
17211775
.append("\n");
17221776
sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n");
17231777
sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n");
1778+
sb.append(" invoiceAddresses: ").append(toIndentedString(invoiceAddresses)).append("\n");
17241779
sb.append("}");
17251780
return sb.toString();
17261781
}

0 commit comments

Comments
 (0)