ImpositionResponse Class

Stores details of tax impositions from the external tax engine.

Namespace

CommerceTax

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.

1if(request.DocumentCode == 'SetsNullForResponseWithoutException'){
2  taxDetailsResponse.setImposition(null);
3                     }else{
4                        commercetax.ImpositionResponse imposition = new commercetax.ImpositionResponse();
5                        imposition.setSubType('subtype');
6                        imposition.setType('type');
7                        taxDetailsResponse.setImposition(imposition);
8                   }

ImpositionResponse Methods

Learn more about the available methods with the ImpositionResponse class.

The ImpositionResponse class includes these methods.

setId(id)

Sets the ID field of the ImpositionResponse class.

Signature

global void setId(String id)

Parameters

  • id:

    Type: String

    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

    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

    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

    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