CalculateTaxRequest Class
Represents a request to an external tax engine to calculate tax. Extends the TaxTransactionRequest class and is the top-level request class.
Keep these considerations in mind when you use this class.
- If the
shouldVoidTaxproperty value is set totrue, then the operation returns a response withdocumentCodeproperty value updated toreferenceDocumentCodeproperty value that was originally sent in the request payload. The response also includes thetaxTransactionTypeproperty value asVoid. This indicates that the document specified in thereferenceDocumentCodeproperty value is voided. - If document is locked or you can’t void the tax transaction for any reason, then you can use the Tax Calculation request to perform another transaction such as a Credit Tax request. In this scenario, the response includes the
documentCodeproperty value that was sent in the request payload. - If the document that’s mentioned in the
referenceDocumentCodeproperty value isn’t available in the tax engine, then an error response occurs with ResultCode value asReferenceDocumentCodeMissing.
See TaxEngineAdapter Example Implementation for more details on how to access information from the CalculateTaxRequest class.
-
CalculateTaxRequest Constructors
Learn more about the constructors that are available with the
CalculateTaxRequestclass. This constructor is intended for test usage and throws an exception if used outside of the Apex test context. -
CalculateTaxRequest Properties
Learn more about the available properties with the
CalculateTaxRequestclass. -
Learn more about the available methods with the
CalculateTaxRequestclass.
Learn more about the constructors that are available with the CalculateTaxRequest class. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.
The CalculateTaxRequest class includes these constructors.
-
This constructor is intended for test usage only and throws an exception if used outside of the Apex test context.
This constructor is intended for test usage only and throws an exception if used outside of the Apex test context.
global CalculateTaxRequest(commercetax.CalculateTaxType taxType)
-
taxType:
Type: CalculateTaxType
Indicates whether the tax calculation is for estimated tax or actual tax.
Learn more about the available properties with the CalculateTaxRequest class.
The CalculateTaxRequest class includes these properties.
-
Indicates whether the tax calculation has to be committed or reported to government authorities.
-
Indicates whether header tax is enabled in the tax engine (
true) or not (false). -
Indicates whether to void the tax transaction associated with a document that’s mentioned in the
referenceDocumentCodeproperty value withtaxTypeproperty value set toActualandisCommitproperty value set totrue. -
Shows whether the tax transaction is for a credit or debit transaction.
-
Shows whether the tax calculation is for estimated or actual tax wherein only actual tax can be submitted.
Indicates whether the tax calculation has to be committed or reported to government authorities.
global Boolean isCommit {get; set;}
Type: Boolean
Indicates whether header tax is enabled in the tax engine (true) or not (false).
global Boolean isHeaderTaxRequested {get; set;}
Type: Boolean
Indicates whether to void the tax transaction associated with a document that’s mentioned in the referenceDocumentCode property value with taxType property value set to Actual and isCommit property value set to true.
global commercetax.CalculateTaxType shouldVoidTax {get; set;}
Type: Boolean
Shows whether the tax transaction is for a credit or debit transaction.
global commercetax.TaxTransactionType taxTransactionType {get; set;}
Type: TaxTransactionType
Shows whether the tax calculation is for estimated or actual tax wherein only actual tax can be submitted.
global commercetax.CalculateTaxType taxType {get; set;}
Type: CalculateTaxType
Learn more about the available methods with the CalculateTaxRequest class.
The CalculateTaxRequest class includes these methods.
-
Maintains the integrity of lists of type
CalculateTaxRequestby determining the equality of external objects in a list. This method is dynamic and is based on theequals()method in Java. -
Maintains the integrity of lists of type
CalculateTaxRequestby determining the uniqueness of the external object records in a list. -
Converts a value to a string.
Maintains the integrity of lists of type CalculateTaxRequest by determining the equality of external objects in a list. This method is dynamic and is based on the equals() method in Java.
global Boolean equals(Object obj)
-
obj:
Type:
Object External object whose key is to be validated.
Type: Boolean
Maintains the integrity of lists of type CalculateTaxRequest 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