module Epages::REST::Customers

implements the calls in developer.epages.com/apps/api-reference/resource-customers.html

Public Instance Methods

create_customer(options = {}) click to toggle source

call the API to creates a customer. If customer_number is not provided in the request, it will be generated automatically. implements the call developer.epages.com/apps/api-reference/post-shops-shopid-customers.html

@param options [Hash]

# File lib/epages/rest/customers.rb, line 21
def create_customer(options = {})
  perform_post_with_object('/customers', options, Epages::Customer)
end
customer(customer) click to toggle source

call the API and returns a specified customer implements the call developer.epages.com/apps/api-reference/get-shops-shopid-customers-customerid.html

@param customer [String], [Epages::Customer]

# File lib/epages/rest/customers.rb, line 29
def customer(customer)
  id = epages_id(customer)
  perform_get_with_object("/customers/#{id}", {}, Epages::Customer)
end
customers(options = {}) click to toggle source

call the API and return an array of Epages::Customer implements the call developer.epages.com/apps/api-reference/get-shops-shopid-customers.html

@param options [Hash]

# File lib/epages/rest/customers.rb, line 13
def customers(options = {})
  perform_get_with_object('/customers', options, Epages::CustomersResponse)
end
update_customer(customer, options = {}) click to toggle source

call the API to update the information for a single customer implements the call developer.epages.com/apps/api-reference/patch-shops-shopid-customers-customerid.html

@param customer [String], [Epages::Product] @param options [Hash]

# File lib/epages/rest/customers.rb, line 39
def update_customer(customer, options = {})
  id = epages_id(customer)
  perform_patch_with_object("/customers/#{id}", options, Epages::Customer)
end