TaxTransactionRequest Class

Abstract class for storing customer details used in tax calculation and estimation requests.

CommerceTax

Specify the CommerceTax namespace when creating an instance of this class. The constructor of this class takes no arguments. For example, let’s say you create an instance of CalculateTaxRequest class, which extends the TaxTransactionRequest class.

Learn more about the available constructors with the TaxTransactionRequest class.

The TaxTransactionRequest class includes these constructors.

Initializes the request for the tax transaction. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.

global TaxTransactionRequest(commercetax.HeaderTaxAddressesRequest addresses, String currencyIsoCode, commercetax.TaxCustomerDetailsRequest customerDetails, String description, String documentCode, String referenceDocumentCode, Datetime transactionDate, Datetime effectiveDate, List<commercetax.TaxLineItemRequest> lineItems, String referenceEntityId, commercetax.TaxSellerDetailsRequest sellerDetails,Map<String,Object> customTaxAttributes)

  • addresses:

    Type: HeaderTaxAddressesRequest

    Tax addresses, such as Ship To and Bill From.

  • currencyIsoCode:

    Type: String

    Three-letter ISO 4217 currency code associated with the TaxTransactionRequest.

  • customerDetails:

    Type: TaxCustomerDetailsRequest

    Customer information used in tax calculation.

  • description:

    Type: String

    Optional user-defined description for providing more information about the tax transaction request.

  • documentCode:

    Type: String

    Code

    for documents that are used to provide more information in the tax calculation process.

  • referenceDocumentCode:

    Type: String

    Identifier that combines

    the original invoice ID, previous tax transaction type, and tax engine ID, used in tax calculations for negative invoice lines. For example, a referenceDocumentCode parameter value 3ttxx00000004Bh_Debit-4wAxx0000000001EAA indicates 3ttxx00000004Bh is the original invoice ID and 4wAxx0000000001EAA is the tax engine ID.

  • transactionDate:

    Type: Datetime

    The date that the tax transaction occurred.

  • effectiveDate:

    Type: Datetime

    The date that the tax transaction takes effect. User-defined and used only for reporting purposes.

  • lineItems:

    Type: List<TaxLineItemRequest>

    A list of line items on which tax is calculated.

  • referenceEntityId:

    Type: String

    ID of an object related to the line items sent for tax calculation.

  • sellerDetails:

    Type: TaxSellerDetailsRequest

    Contains tax code information used in a tax calculation request.

  • customTaxAttributes:

    Type: Map<String, Object> Customised tax contract to include additional attributes at the header level.

Learn more about the available properties with the TaxTransactionRequest class.

The TaxTransactionRequest class includes these properties.

  • addresses

    A list of addresses (such as Ship To and Sold To) used as part of the tax transaction.

  • currencyIsoCode

    Three-letter ISO 4217 currency code associated with the TaxTransactionRequest.

  • customerDetails

    Customer information used in tax calculation.

  • customTaxAttributes

    Customised tax contract to include additional attributes at the header level.

  • description

    Optional user-defined description for providing more information about the tax transaction request.

  • documentCode

    Code for documents used to provide more information in the tax calculation process.

  • effectiveDate

    The date that the tax transaction takes effect. User-defined and used only for reporting purposes.

  • lineItems

    A list of line items on which tax will be calculated.

  • referenceDocumentCode

    Identifier that combines the original invoice ID, previous tax transaction type, and tax engine ID, used in tax calculations for negative invoice lines.

  • referenceEntityId

    ID of an object related to the line items sent for tax calculation.

  • sellerDetails

    Contains tax code information used in a tax calculation request.

  • transactionDate

    The date that the tax transaction occurred.

A list of addresses (such as Ship To and Sold To) used as part of the tax transaction.

global commercetax.HeaderTaxAddressesRequest addresses {get; set;}

Type: HeaderTaxAddressesRequest

Three-letter ISO 4217 currency code associated with the TaxTransactionRequest.

global String currencyIsoCode {get; set;}

Type: String

Customer information used in tax calculation.

global CommerceTax.TaxCustomerDetailsRequest customerDetails {get; set;}

Type: TaxCustomerDetailsRequest

Customised tax contract to include additional attributes at the header level.

global commercetax.TaxTransactionRequest customTaxAttributes {get; set;}

Type: Map<String, Object>

Optional user-defined description for providing more information about the tax transaction request.

global String description {get; set;}

Type: String

Code for documents used to provide more information in the tax calculation process.

global String documentCode {get; set;}

Type: String

The date that the tax transaction takes effect. User-defined and used only for reporting purposes.

global Datetime effectiveDate {get; set;}

Type: Datetime

A list of line items on which tax will be calculated.

global List<CommerceTax.TaxLineItemRequest> lineItems {get; set;}

Type: List<TaxLineItemRequest>

Identifier that combines the original invoice ID, previous tax transaction type, and tax engine ID, used in tax calculations for negative invoice lines.

For example, a referenceDocumentCode parameter value 3ttxx00000004Bh_Debit-4wAxx0000000001EAA indicates 3ttxx00000004Bh is the original invoice ID and 4wAxx0000000001EAA is the tax engine ID.

global String referenceDocumentCode {get; set;}

Type: String

ID of an object related to the line items sent for tax calculation.

global String referenceEntityId {get; set;}

Type: String

Contains tax code information used in a tax calculation request.

global commercetax.TaxSellerDetailsRequest sellerDetails {get; set;}

Type: TaxSellerDetailsRequest

The date that the tax transaction occurred.

global Datetime transactionDate {get; set;}

Type: Datetime

The following are methods for TaxTransactionRequest.

  • equals(obj)

    Maintains the integrity of lists of type TaxTransactionRequest by determining the equality of external objects in a list. This method is dynamic and based on the equals() method in Java.

  • hashCode()

    Maintains the integrity of lists of type TaxTransactionRequest by determining the uniqueness of the external object records in a list.

  • toString()

    Converts a value to a string.

Maintains the integrity of lists of type TaxTransactionRequest by determining the equality of external objects in a list. This method is dynamic and based on the equals() method in Java.

global Boolean equals(Object obj)

  • obj:

    Type: Object

Type: Boolean

Maintains the integrity of lists of type TaxTransactionRequest by determining the uniqueness of the external object records in a list.

global Integer hashCode()

Type: Integer

Converts a value to a string.

global String toString()

Type: String