AddressesResponse Class

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.

CommerceTax

Because AddressesResponse contains multiple addresses, we recommend using multiple instances of AddressResponse to set unique values for each address.

This code sample represents a portion of the code used in a mock tax adapter. In this example, you create three AddressResponse classes, set their location codes, and pass them to the Ship To, Ship From, and Sold To setter methods in AddressesResponse. In an actual implementation, your AddressResponse classes already have a location code based on the response from the external tax engine.

Learn more about the methods for AddressesResponse class.

The AddressesResponse class includes these methods.

Sets the value of a ShipFrom address field.

global void setShipFrom(commercetax.AddressResponse shipFrom)

  • shipFrom:

    Type: AddressResponse

    A single address. Use this generic address parameter to store any type of address, such as Ship From, Ship To, and Sold To details. Users set the specific address in an AddressResponse instance and then pass that instance to the AddressesResponse’s setShipTo(), setShipFrom(), and setSoldTo() methods as needed.

Type: void

Sets the value of a ShipTo address field.

global void setShipTo(commercetax.AddressResponse shipTo)

  • shipTo:

    Type: AddressResponse

    Stores

    a single address. This is a generic address parameter and can be used to store any type of address, such as Ship From, Ship To, and Sold To details. Users set the specific address in an AddressResponse instance and then pass that instance to the AddressesResponse’s setShipTo(), setShipFrom(), and setSoldTo() methods as needed.

Type: void

Sets the value of a SoldTo address field.

global void setSoldTo(commercetax.AddressResponse soldTo)

  • soldTo:

    Type: AddressResponse

    Stores

    a single address. This is a generic address parameter and can be used to store any type of address, such as Ship From, Ship To, Sold To details. Users set the specific address in an AddressResponse instance and then pass that instance to the AddressesResponse’s setShipTo(), setShipFrom(), and setSoldTo() methods as needed.

Type: void