---
schema_version: "1"
id: 556cea50b5fccda2c21deb87c4ebd4c17224e866fe9b3e2a01ee3bcb85e37de3
title: AbstractTransactionResponse Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_commercetax_AbstractTransactionResponse.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 37a1b3d8dccbec701731b66f47513f34a0310f176be1f503a3a9a7e6242ea4e4
description: 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.Learn more about the methods for AbstractTransactionResponse class.Uses an instance of AddressesResponse to set the values of tax address fields.Uses an instance of AmountDetailsResponse to set tax amount fields such as exemption amount and tax amount.Sets the currencyIsoCode field.Uses an instance of CustomTaxAttributesResponse class to include additional attributes in the tax response at the header level.Sets the Description field.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.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.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.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.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.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.Sets the TransactionDate field.
---
# 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.

## Namespace

[CommerceTax](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_commercetax.htm "Manage the communication between Salesforce and an external tax engine.")

- **[AbstractTransactionResponse Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_methods)**  
    Learn more about the methods for AbstractTransactionResponse class.

## AbstractTransactionResponse Methods

Learn more about the methods for AbstractTransactionResponse class.

The AbstractTransactionResponse class includes these methods.

- **[setAddresses(addresses)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setAddresses)**  
    Uses an instance of AddressesResponse to set the values of tax address fields.
- **[setAmountDetails(amountDetails)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setAmountDetails)**  
    Uses an instance of AmountDetailsResponse to set tax amount fields such as exemption amount and tax amount.
- **[setCurrencyIsoCode(currencyIsoCode)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setCurrencyIsoCode)**  
    Sets the currencyIsoCode field.
- **[setCustomTaxAttributes(customTaxAttributes)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setCustomTaxAttributes)**  
    Uses an instance of CustomTaxAttributesResponse class to include additional attributes in the tax response at the header level.
- **[setDescription(dscptn)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setDescription)**  
    Sets the Description field.
- **[setDocumentCode(documentCode)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setDocumentCode)**  
    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)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setEffectiveDate)**  
    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)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setLineItems)**  
    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)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setReferenceDocumentCode)**  
    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)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setReferenceEntityId)**  
    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)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setTaxTransactionId)**  
    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)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AbstractTransactionResponse.htm#apex_commercetax_AbstractTransactionResponse_setTransactionDate)**  
    Sets the TransactionDate field.

### setAddresses(addresses)

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

#### Signature

global void setAddresses(commercetax.AddressesResponse addresses)

#### Parameters

- **addresses**:
    
    Type: [AddressesResponse](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AddressesResponse.htm#apex_class_commercetax_AddressesResponse "Sets the tax address fields based on a response from the external tax engine. Contains setter methods for the Ship From, Ship To, and Sold To addresses.")
    
    Class that contains methods to set the Ship To, Ship From, and Sold To address information.

#### Return Value

Type: void

### setAmountDetails(amountDetails)

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

#### Signature

global void setAmountDetails(commercetax.AmountDetailsResponse amountDetails)

#### Parameters

- **amountDetails**:
    
    Type: [AmountDetailsResponse](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_AmountDetailsResponse.htm#apex_class_commercetax_AmountDetailsResponse "Sets tax amount fields based on a response from the external tax engine.")
    
    Class that contains methods to set the tax exemption amount, tax amount, total amount, and total amount with tax.

#### Return Value

Type: void

### setCurrencyIsoCode(currencyIsoCode)

Sets the currencyIsoCode field.

#### Signature

global void setCurrencyIsoCode(String currencyIsoCode)

#### Parameters

- **currencyIsoCode**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Three-letter ISO 4217 currency code associated with a tax object.

#### Return Value

Type: void

### setCustomTaxAttributes(customTaxAttributes)

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

#### Signature

global void setCustomTaxAttributes(commercetax.CustomTaxAttributesResponse customTaxAttributes)

#### Parameters

- **customTaxAttributes**:
    
    Type: [CustomTaxAttributesResponse](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_CustomTaxAttributesResponse.htm#apex_class_commercetax_CustomTaxAttributesResponse "Sets additional data or custom attributes in the tax response.")
    
    Additional
    
    data or custom attributes to include in the tax response.

#### Return Value

Type: void

### setDescription(dscptn)

Sets the Description field.

#### Signature

global void setDescription(String dscptn)

#### Parameters

- **dscptn**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Optional field for providing additional information about a record.

#### Return Value

Type: void

### 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.

#### Signature

global void setDocumentCode(String documentCode)

#### Parameters

- **documentCode**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Code
    
    for a tax document used in the tax calculation process.

#### Return Value

Type: void

### 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.

#### Signature

global void setEffectiveDate(Datetime effectiveDate)

#### Parameters

- **effectiveDate**:
    
    Type: [Datetime](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_datetime.htm#apex_methods_system_datetime "Contains methods for the Datetime primitive data type.")
    
    Optional field that stores the date that a transaction takes effect.

#### Return Value

Type: void

### 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.

#### Signature

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

#### Parameters

- **lineItems**:
    
    Type: List<[LineItemResponse](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_LineItemResponse.htm#apex_class_commercetax_LineItemResponse "Response class that stores details of a list of one or more line items on which the tax engine has calculated tax.")\>
    
    A list of line items sent to an external tax engine for tax calculation.

#### Return Value

Type: void

### 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.

#### Signature

global void setReferenceDocumentCode(String referenceDocumentCode)

#### Parameters

- **referenceDocumentCode**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    The code for a document used in the tax calculation process.

#### Return Value

Type: void

### 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.

#### Signature

global void setReferenceEntityId(String referenceEntityId)

#### Parameters

- **referenceEntityId**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    ID of a record related to the items sent for tax calculation.

#### Return Value

Type: void

### 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.

#### Signature

global void setTaxTransactionId(String taxTrxnId)

#### Parameters

- **taxTrxnId**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    The ID of a tax transaction record in Commerce Tax.

#### Return Value

Type: void

### setTransactionDate(transactionDate)

Sets the TransactionDate field.

#### Signature

global void setTransactionDate(Datetime transactionDate)

#### Parameters

- **transactionDate**:
    
    Type: [Datetime](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_datetime.htm#apex_methods_system_datetime "Contains methods for the Datetime primitive data type.")
    
    Date that a tax transaction occurred.

#### Return Value

Type: void