JurisdictionResponse Class

Stores details from the external tax engine about the tax jurisdiction used in the tax calculation process. A tax jurisdiction represents a government entity that collects tax.

Namespace

CommerceTax

Example

In this mock adapter example, the adapter sets the TaxDetailsResponse.setJurisdiction() 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 JurisdictionResponse and sets its address values. Because this code represents a mock adapter, the example defines the address parameters directly. In a standard implementation, the jurisdiction's setters receive values passed from the eternal tax engine.

1if(request.DocumentCode == 'SetsNullForResponseWithoutException'){
2                         taxDetailsResponse.setJurisdiction(null);
3                     }else{
4                        commercetax.JurisdictionResponse jurisdiction = new commercetax.JurisdictionResponse();
5                        jurisdiction.setCountry('country');
6                        jurisdiction.setRegion('region');                         
7                        jurisdiction.setName('name');
8                        jurisdiction.setStateAssignedNumber('stateAssignedNo');
9                        jurisdiction.setId('id');
10                        jurisdiction.setLevel('level');
11                        taxDetailsResponse.setJurisdiction(jurisdiction);                     
12}

JurisdictionResponse Methods

Learn more about the available methods with the JurisdictionResponse class.

The JurisdictionResponse class includes these methods.

setCountry(country)

Sets the Country field of the JurisdictionResponse class.

Signature

global void setCountry(String country)

Parameters

  • country:

    Type: String

    The country of the tax jurisdiction entity's address.

Return Value

Type: void

setId(id)

Sets the ID field of the JurisdictionResponse class.

Signature

global void setId(String id)

Parameters

  • id:

    Type: String

    User-defined Id value used to reference

    the jurisdiction response.

Return Value

Type: void

setLevel(level)

Sets the Level field of the JurisdictionResponse class.

Signature

global void setLevel(String level)

Parameters

  • level:

    Type: String

    Level value used in the jurisdiction entity's address.

Return Value

Type: void

setName(name)

Sets the Name field of the JurisdictionResponse class.

Signature

global void setName(String name)

Parameters

  • name:

    Type: String

    Optional user-defined name field for referencing the jurisdiction response.

Return Value

Type: void

setRegion(region)

Sets the Region value of the JurisdictionResponse class.

Signature

global void setRegion(String region)

Parameters

  • region:

    Type: String

    Region value used in the tax jurisdiction entity's address.

Return Value

Type: void

setStateAssignedNumber(stateAssignedNo)

Sets the StateAssignedNumber field of the JurisdictionResponse class.

Signature

global void setStateAssignedNumber(String stateAssignedNo)

Parameters

  • stateAssignedNo:

    Type: String

    State assigned number

    value of the tax jurisdiction entity's address.

Return Value

Type: void