Module: Taxjar::API::Customer

Includes:
Utils
Included in:
Client
Defined in:
lib/taxjar/api/customer.rb

Instance Method Summary collapse

Methods included from Utils

#perform_delete_with_object, #perform_get_with_array, #perform_get_with_object, #perform_get_with_objects, #perform_post_with_object, #perform_post_with_objects, #perform_put_with_object, #perform_request, #perform_request_with_array, #perform_request_with_object, #perform_request_with_objects

Instance Method Details

#create_customer(options = {}) ⇒ Object



16
17
18
# File 'lib/taxjar/api/customer.rb', line 16

def create_customer(options = {})
  perform_post_with_object("/v2/customers", 'customer', options, Taxjar::Customer)
end

#delete_customer(id, options = {}) ⇒ Object



25
26
27
# File 'lib/taxjar/api/customer.rb', line 25

def delete_customer(id, options={})
  perform_delete_with_object("/v2/customers/#{id}", 'customer', options, Taxjar::Customer)
end

#list_customers(options = {}) ⇒ Object



8
9
10
# File 'lib/taxjar/api/customer.rb', line 8

def list_customers(options = {})
  perform_get_with_array("/v2/customers", 'customers', options)
end

#show_customer(id, options = {}) ⇒ Object



12
13
14
# File 'lib/taxjar/api/customer.rb', line 12

def show_customer(id, options = {})
  perform_get_with_object("/v2/customers/#{id}", 'customer', options, Taxjar::Customer)
end

#update_customer(options = {}) ⇒ Object



20
21
22
23
# File 'lib/taxjar/api/customer.rb', line 20

def update_customer(options = {})
  id = options.fetch(:customer_id)
  perform_put_with_object("/v2/customers/#{id}", 'customer', options, Taxjar::Customer)
end