---
schema_version: "1"
id: 51d95acea16c71d4b0509cbdc4b7a9a707273a9569f32122c49e0e9b10dd7a73
title: ImpositionResponse Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_commercetax_ImpositionResponse.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_ImpositionResponse.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4d328264e8887124bcf0617174a641e520c17a81ca7c1662ebd090b61412e62e
description: Stores details of tax impositions from the external tax engine.Learn more about the available methods with the ImpositionResponse class.Sets the ID field of the ImpositionResponse class.Sets the Name field of the ImpositionResponse class.Sets the SubType field of the ImpositionResponse class.Sets the Type field of the ImpositionResponse class.
---
# ImpositionResponse Class

Stores details of tax impositions from the external tax engine.

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

## Example

In this mock adapter example, the adapter sets the TaxDetailsResponse.setImposition() method parameter to null if the request's document code indicates that the tax calculation didn't require any exceptions. Otherwise, it creates an instance of ImpositionResponse and sets its SubType and Type values, and then assigns it to TaxDetailsResponse.

if(request.DocumentCode == 'SetsNullForResponseWithoutException'){
  taxDetailsResponse.setImposition(null);
                     }else{
                        commercetax.ImpositionResponse imposition = new commercetax.ImpositionResponse();
                        imposition.setSubType('subtype');
                        imposition.setType('type');
                        taxDetailsResponse.setImposition(imposition);
                   }

- **[ImpositionResponse Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_ImpositionResponse.htm#apex_commercetax_ImpositionResponse_methods)**  
    Learn more about the available methods with the ImpositionResponse class.

## ImpositionResponse Methods

Learn more about the available methods with the ImpositionResponse class.

The ImpositionResponse class includes these methods.

- **[setId(id)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_ImpositionResponse.htm#apex_commercetax_ImpositionResponse_setId)**  
    Sets the ID field of the ImpositionResponse class.
- **[setName(name)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_ImpositionResponse.htm#apex_commercetax_ImpositionResponse_setName)**  
    Sets the Name field of the ImpositionResponse class.
- **[setSubType(subType)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_ImpositionResponse.htm#apex_commercetax_ImpositionResponse_setSubType)**  
    Sets the SubType field of the ImpositionResponse class.
- **[setType(type)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_ImpositionResponse.htm#apex_commercetax_ImpositionResponse_setType)**  
    Sets the Type field of the ImpositionResponse class.

### setId(id)

Sets the ID field of the ImpositionResponse class.

#### Signature

global void setId(String id)

#### Parameters

- **id**:
    
    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.")
    
    User-defined ID value used
    
    for referencing the tax imposition.

#### Return Value

Type: void

### setName(name)

Sets the Name field of the ImpositionResponse class.

#### Signature

global void setName(String name)

#### Parameters

- **name**:
    
    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 user-defined name for the tax imposition response.

#### Return Value

Type: void

### setSubType(subType)

Sets the SubType field of the ImpositionResponse class.

#### Signature

global void setSubType(String subType)

#### Parameters

- **subType**:
    
    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.")
    
    Many tax calculation organizations use types and subtypes to categorize their tax imposition procedures.
    
    If the tax engine you use follows this process, set the subtype with this parameter.

#### Return Value

Type: void

### setType(type)

Sets the Type field of the ImpositionResponse class.

#### Signature

public void setType(String type)

#### Parameters

- **type**:
    
    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.")
    
    Many tax calculation organizations use types and subtypes to categorize their tax imposition procedures.
    
    If the tax engine you use follows this process, set the type with this parameter.

#### Return Value

Type: void