AbstractTransactionResponse Class

Abstract class that contains methods for setting tax fields based on the external tax provider’s response. Response classes that extend AbstractTransactionResponse inherit these methods.

CommerceTax

Learn more about the methods for AbstractTransactionResponse class.

The AbstractTransactionResponse class includes these methods.

  • setAddresses(addresses)

    Uses an instance of AddressesResponse to set the values of tax address fields.

  • setAmountDetails(amountDetails)

    Uses an instance of AmountDetailsResponse to set tax amount fields such as exemption amount and tax amount.

  • setCurrencyIsoCode(currencyIsoCode)

    Sets the currencyIsoCode field.

  • setCustomTaxAttributes(customTaxAttributes)

    Uses an instance of CustomTaxAttributesResponse class to include additional attributes in the tax response at the header level.

  • setDescription(dscptn)

    Sets the Description field.

  • setDocumentCode(documentCode)

    Sets the DocumentCode field. Document codes are often used to reference tax documents that the external tax engine uses in the tax calculation process. Document code acts as a unique link to chain-related transactions, such as amendment or refunds.

  • setEffectiveDate(effectiveDate)

    Sets the EffectiveDate field. Effective Date fields are optional fields that store the date that a transaction takes effect. We provide these fields only for recordkeeping purposes – for example, if you must report an effective date to an external general ledger system. Salesforce doesn’t use them to calculate any tax or payment values.

  • setLineItems(lineItems)

    Uses an instance of the LineItemResponse class to set a list of line items. Each line item represents an item sent to an external tax engine for tax calculation.

  • setReferenceDocumentCode(referenceDocumentCode)

    Sets the ReferenceDocumentCode field. Use this field to store the code of an additional document used in the tax calculation process. For example, use this field in case of a refund for a previously taxed purchase.

  • setReferenceEntityId(referenceEntityId)

    Sets the ID of a reference entity. In Commerce Tax, a reference entity represents a record related to the items sent to the external tax engine for tax calculation. For example, if you sent order items for tax calculation, you could define the parent order as the reference entity.

  • setTaxTransactionId(taxTrxnId)

    Sets the TaxTransactionId field using the ID of a tax transaction record. In Commerce Tax, a tax transaction record stores information about a specific tax calculation process.

  • setTransactionDate(transactionDate)

    Sets the TransactionDate field.

Uses an instance of AddressesResponse to set the values of tax address fields.

global void setAddresses(commercetax.AddressesResponse addresses)

  • addresses:

    Type: AddressesResponse

    Class that contains methods to set the Ship To, Ship From, and Sold To address information.

Type: void

Uses an instance of AmountDetailsResponse to set tax amount fields such as exemption amount and tax amount.

global void setAmountDetails(commercetax.AmountDetailsResponse amountDetails)

  • amountDetails:

    Type: AmountDetailsResponse

    Class that contains methods to set the tax exemption amount, tax amount, total amount, and total amount with tax.

Type: void

Sets the currencyIsoCode field.

global void setCurrencyIsoCode(String currencyIsoCode)

  • currencyIsoCode:

    Type: String

    Three-letter ISO 4217 currency code associated with a tax object.

Type: void

Uses an instance of CustomTaxAttributesResponse class to include additional attributes in the tax response at the header level.

global void setCustomTaxAttributes(commercetax.CustomTaxAttributesResponse customTaxAttributes)

Type: void

Sets the Description field.

global void setDescription(String dscptn)

  • dscptn:

    Type: String

    Optional field for providing additional information about a record.

Type: void

Sets the DocumentCode field. Document codes are often used to reference tax documents that the external tax engine uses in the tax calculation process. Document code acts as a unique link to chain-related transactions, such as amendment or refunds.

global void setDocumentCode(String documentCode)

  • documentCode:

    Type: String

    Code

    for a tax document used in the tax calculation process.

Type: void

Sets the EffectiveDate field. Effective Date fields are optional fields that store the date that a transaction takes effect. We provide these fields only for recordkeeping purposes – for example, if you must report an effective date to an external general ledger system. Salesforce doesn’t use them to calculate any tax or payment values.

global void setEffectiveDate(Datetime effectiveDate)

  • effectiveDate:

    Type: Datetime

    Optional field that stores the date that a transaction takes effect.

Type: void

Uses an instance of the LineItemResponse class to set a list of line items. Each line item represents an item sent to an external tax engine for tax calculation.

global void setLineItems(List<commercetax.LineItemResponse> lineItems)

  • lineItems:

    Type: List<LineItemResponse>

    A list of line items sent to an external tax engine for tax calculation.

Type: void

Sets the ReferenceDocumentCode field. Use this field to store the code of an additional document used in the tax calculation process. For example, use this field in case of a refund for a previously taxed purchase.

global void setReferenceDocumentCode(String referenceDocumentCode)

  • referenceDocumentCode:

    Type: String

    The code for a document used in the tax calculation process.

Type: void

Sets the ID of a reference entity. In Commerce Tax, a reference entity represents a record related to the items sent to the external tax engine for tax calculation. For example, if you sent order items for tax calculation, you could define the parent order as the reference entity.

global void setReferenceEntityId(String referenceEntityId)

  • referenceEntityId:

    Type: String

    ID of a record related to the items sent for tax calculation.

Type: void

Sets the TaxTransactionId field using the ID of a tax transaction record. In Commerce Tax, a tax transaction record stores information about a specific tax calculation process.

global void setTaxTransactionId(String taxTrxnId)

  • taxTrxnId:

    Type: String

    The ID of a tax transaction record in Commerce Tax.

Type: void

Sets the TransactionDate field.

global void setTransactionDate(Datetime transactionDate)

  • transactionDate:

    Type: Datetime

    Date that a tax transaction occurred.

Type: void