Class: NewStoreApi::TaxDefinitionsController

Inherits:
BaseController show all
Defined in:
lib/new_store_api/controllers/tax_definitions_controller.rb

Overview

TaxDefinitionsController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from NewStoreApi::BaseController

Instance Method Details

#list_tax_exemption_classes(store_id: nil, countries: nil) ⇒ TaxExemptionClassesDto

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
List valid tax exemption classes for the given tenant/store. of countries that will be used to filter the exemption classes.

Parameters:

  • store_id (String) (defaults to: nil)

    Optional parameter: Store identifier.

  • countries (Array[String]) (defaults to: nil)

    Optional parameter: Comma separated array

Returns:



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/new_store_api/controllers/tax_definitions_controller.rb', line 23

def list_tax_exemption_classes(store_id: nil,
                               countries: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/taxes/definitions/exemption-classes',
                                 Server::API)
               .header_param(new_parameter(store_id, key: 'store-id'))
               .query_param(new_parameter(countries, key: 'countries'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth'))
               .array_serialization_format(ArraySerializationFormat::PLAIN))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(TaxExemptionClassesDto.method(:from_hash)))
    .execute
end