Skip to content

Commit

Permalink
[UST-4371] Add USST fields to Invoices and Credit Notes endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeet-joy_xero committed Sep 16, 2024
1 parent 082df2e commit 593ef6e
Show file tree
Hide file tree
Showing 7 changed files with 399 additions and 0 deletions.
123 changes: 123 additions & 0 deletions docs/accounting/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2564,6 +2564,13 @@
"items" : {
"$ref" : "#/components/schemas/ValidationError"
}
},
"InvoiceAddresses" : {
"type" : "array",
"description" : "An array of addresses used to auto calculate sales tax",
"items" : {
"$ref" : "#/components/schemas/InvoiceAddress"
}
}
},
"description" : "",
Expand Down Expand Up @@ -3259,12 +3266,63 @@
"items" : {
"$ref" : "#/components/schemas/ValidationError"
}
},
"InvoiceAddresses" : {
"type" : "array",
"description" : "An array of addresses used to auto calculate sales tax",
"items" : {
"$ref" : "#/components/schemas/InvoiceAddress"
}
}
},
"description" : "",
"externalDocs" : {
"url" : "http://developer.xero.com/documentation/api/invoices/"
}
};
defs["InvoiceAddress"] = {
"title" : "",
"type" : "object",
"properties" : {
"InvoiceAddressType" : {
"type" : "string",
"description" : "Indicates whether the address is defined as origin (FROM) or destination (TO)",
"enum" : [ "FROM", "TO" ]
},
"AddressLine1" : {
"type" : "string",
"description" : "First line of a physical address"
},
"AddressLine2" : {
"type" : "string",
"description" : "Second line of a physical address"
},
"AddressLine3" : {
"type" : "string",
"description" : "Third line of a physical address"
},
"AddressLine4" : {
"type" : "string",
"description" : "Fourth line of a physical address"
},
"City" : {
"type" : "string",
"description" : "City of a physical address"
},
"Region" : {
"type" : "string",
"description" : "Region or state of a physical address"
},
"PostalCode" : {
"type" : "string",
"description" : "Postal code of a physical address"
},
"Country" : {
"type" : "string",
"description" : "Country of a physical address"
}
},
"description" : ""
};
defs["InvoiceReminder"] = {
"title" : "",
Expand Down Expand Up @@ -3660,6 +3718,22 @@
"description" : "The Xero identifier for a Repeating Invoice",
"format" : "uuid",
"example" : "00000000-0000-0000-0000-000000000000"
},
"Taxability" : {
"type" : "string",
"description" : "The type of taxability",
"enum" : [ "TAXABLE", "NON_TAXABLE", "EXEMPT", "PART_TAXABLE", "NOT_APPLICABLE" ]
},
"SalesTaxCodeId" : {
"type" : "number",
"description" : "The ID of the sales tax code"
},
"TaxBreakdown" : {
"type" : "array",
"description" : "An array of tax components defined for this line item",
"items" : {
"$ref" : "#/components/schemas/TaxBreakdownComponent"
}
}
},
"description" : "",
Expand Down Expand Up @@ -5699,6 +5773,55 @@
"externalDocs" : {
"url" : "https://developer.xero.com/documentation/api-guides/conversions"
}
};
defs["TaxBreakdownComponent"] = {
"title" : "",
"type" : "object",
"properties" : {
"TaxComponentId" : {
"type" : "string",
"description" : "The unique ID number of this component",
"format" : "uuid"
},
"Type" : {
"type" : "string",
"description" : "The type of the jurisdiction",
"enum" : [ "SYSGST/USCOUNTRY", "SYSGST/USSTATE", "SYSGST/USCOUNTY", "SYSGST/USCITY", "SYSGST/USSPECIAL" ]
},
"Name" : {
"type" : "string",
"description" : "The name of the jurisdiction"
},
"TaxPercentage" : {
"type" : "number",
"description" : "The percentage of the tax"
},
"TaxAmount" : {
"type" : "number",
"description" : "The amount of the tax"
},
"TaxableAmount" : {
"type" : "number",
"description" : "The amount that is taxable"
},
"NonTaxableAmount" : {
"type" : "number",
"description" : "The amount that is not taxable"
},
"ExemptAmount" : {
"type" : "number",
"description" : "The amount that is exempt"
},
"StateAssignedNo" : {
"type" : "string",
"description" : "The state assigned number of the jurisdiction"
},
"JurisdictionRegion" : {
"type" : "string",
"description" : "Name identifying the region within the country"
}
},
"description" : ""
};
defs["TaxComponent"] = {
"title" : "",
Expand Down
10 changes: 10 additions & 0 deletions src/gen/model/accounting/creditNote.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Allocation } from '././allocation';
import { Contact } from '././contact';
import { CurrencyCode } from '././currencyCode';
import { InvoiceAddress } from '././invoiceAddress';
import { LineAmountTypes } from '././lineAmountTypes';
import { LineItem } from '././lineItem';
import { Payment } from '././payment';
Expand Down Expand Up @@ -118,6 +119,10 @@ export class CreditNote {
* Displays array of warning messages from the API
*/
'warnings'?: Array<ValidationError>;
/**
* An array of addresses used to auto calculate sales tax
*/
'invoiceAddresses'?: Array<InvoiceAddress>;

static discriminator: string | undefined = undefined;

Expand Down Expand Up @@ -271,6 +276,11 @@ export class CreditNote {
"name": "warnings",
"baseName": "Warnings",
"type": "Array<ValidationError>"
},
{
"name": "invoiceAddresses",
"baseName": "InvoiceAddresses",
"type": "Array<InvoiceAddress>"
} ];

static getAttributeTypeMap() {
Expand Down
10 changes: 10 additions & 0 deletions src/gen/model/accounting/invoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Attachment } from '././attachment';
import { Contact } from '././contact';
import { CreditNote } from '././creditNote';
import { CurrencyCode } from '././currencyCode';
import { InvoiceAddress } from '././invoiceAddress';
import { LineAmountTypes } from '././lineAmountTypes';
import { LineItem } from '././lineItem';
import { Overpayment } from '././overpayment';
Expand Down Expand Up @@ -161,6 +162,10 @@ export class Invoice {
* Displays array of warning messages from the API
*/
'warnings'?: Array<ValidationError>;
/**
* An array of addresses used to auto calculate sales tax
*/
'invoiceAddresses'?: Array<InvoiceAddress>;

static discriminator: string | undefined = undefined;

Expand Down Expand Up @@ -364,6 +369,11 @@ export class Invoice {
"name": "warnings",
"baseName": "Warnings",
"type": "Array<ValidationError>"
},
{
"name": "invoiceAddresses",
"baseName": "InvoiceAddresses",
"type": "Array<InvoiceAddress>"
} ];

static getAttributeTypeMap() {
Expand Down
99 changes: 99 additions & 0 deletions src/gen/model/accounting/invoiceAddress.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@

export class InvoiceAddress {
/**
* Indicates whether the address is defined as origin (FROM) or destination (TO)
*/
'invoiceAddressType'?: InvoiceAddress.InvoiceAddressTypeEnum;
/**
* First line of a physical address
*/
'addressLine1'?: string;
/**
* Second line of a physical address
*/
'addressLine2'?: string;
/**
* Third line of a physical address
*/
'addressLine3'?: string;
/**
* Fourth line of a physical address
*/
'addressLine4'?: string;
/**
* City of a physical address
*/
'city'?: string;
/**
* Region or state of a physical address
*/
'region'?: string;
/**
* Postal code of a physical address
*/
'postalCode'?: string;
/**
* Country of a physical address
*/
'country'?: string;

static discriminator: string | undefined = undefined;

static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "invoiceAddressType",
"baseName": "InvoiceAddressType",
"type": "InvoiceAddress.InvoiceAddressTypeEnum"
},
{
"name": "addressLine1",
"baseName": "AddressLine1",
"type": "string"
},
{
"name": "addressLine2",
"baseName": "AddressLine2",
"type": "string"
},
{
"name": "addressLine3",
"baseName": "AddressLine3",
"type": "string"
},
{
"name": "addressLine4",
"baseName": "AddressLine4",
"type": "string"
},
{
"name": "city",
"baseName": "City",
"type": "string"
},
{
"name": "region",
"baseName": "Region",
"type": "string"
},
{
"name": "postalCode",
"baseName": "PostalCode",
"type": "string"
},
{
"name": "country",
"baseName": "Country",
"type": "string"
} ];

static getAttributeTypeMap() {
return InvoiceAddress.attributeTypeMap;
}
}

export namespace InvoiceAddress {
export enum InvoiceAddressTypeEnum {
FROM = <any> 'FROM',
TO = <any> 'TO'
}
}
37 changes: 37 additions & 0 deletions src/gen/model/accounting/lineItem.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { LineItemItem } from '././lineItemItem';
import { LineItemTracking } from '././lineItemTracking';
import { TaxBreakdownComponent } from '././taxBreakdownComponent';

export class LineItem {
/**
Expand Down Expand Up @@ -59,6 +60,18 @@ export class LineItem {
* The Xero identifier for a Repeating Invoice
*/
'repeatingInvoiceID'?: string;
/**
* The type of taxability
*/
'taxability'?: LineItem.TaxabilityEnum;
/**
* The ID of the sales tax code
*/
'salesTaxCodeId'?: number;
/**
* An array of tax components defined for this line item
*/
'taxBreakdown'?: Array<TaxBreakdownComponent>;

static discriminator: string | undefined = undefined;

Expand Down Expand Up @@ -137,10 +150,34 @@ export class LineItem {
"name": "repeatingInvoiceID",
"baseName": "RepeatingInvoiceID",
"type": "string"
},
{
"name": "taxability",
"baseName": "Taxability",
"type": "LineItem.TaxabilityEnum"
},
{
"name": "salesTaxCodeId",
"baseName": "SalesTaxCodeId",
"type": "number"
},
{
"name": "taxBreakdown",
"baseName": "TaxBreakdown",
"type": "Array<TaxBreakdownComponent>"
} ];

static getAttributeTypeMap() {
return LineItem.attributeTypeMap;
}
}

export namespace LineItem {
export enum TaxabilityEnum {
TAXABLE = <any> 'TAXABLE',
NONTAXABLE = <any> 'NON_TAXABLE',
EXEMPT = <any> 'EXEMPT',
PARTTAXABLE = <any> 'PART_TAXABLE',
NOTAPPLICABLE = <any> 'NOT_APPLICABLE'
}
}
Loading

0 comments on commit 593ef6e

Please sign in to comment.