Module: Epages::REST::Customers
Overview
implements the calls in developer.epages.com/apps/api-reference/resource-customers.html
Instance Method Summary collapse
-
#create_customer(options = {}) ⇒ Object
call the API to creates a customer.
-
#customer(customer) ⇒ Object
call the API and returns a specified customer implements the call developer.epages.com/apps/api-reference/get-shops-shopid-customers-customerid.html.
-
#customers(options = {}) ⇒ Object
call the API and return an array of Epages::Customer implements the call developer.epages.com/apps/api-reference/get-shops-shopid-customers.html.
-
#update_customer(customer, options = {}) ⇒ Object
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.
Methods included from Utils
#epages_id, #format_date, #format_dates_options, #parse_legal_info, #parse_links, #parse_price_info, #parse_product_lowest_price, #parse_product_variations, #parse_suggestions_to_products, #parse_variation_object, #parse_variations, #perform_delete_request, #perform_delete_with_object, #perform_get_request, #perform_get_with_key_and_objects, #perform_get_with_object, #perform_get_with_objects, #perform_multipart_post_with_objects, #perform_patch_with_object, #perform_post_request, #perform_post_with_key_and_objects, #perform_post_with_object, #perform_post_with_objects, #perform_put_request, #perform_put_with_object, #perform_request, #perform_request_with_key_and_objects, #perform_request_with_object, #perform_request_with_objects, #process_thread
Instance Method Details
#create_customer(options = {}) ⇒ Object
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
21 22 23 |
# File 'lib/epages/rest/customers.rb', line 21 def create_customer( = {}) perform_post_with_object('/customers', , Epages::Customer) end |
#customer(customer) ⇒ Object
call the API and returns a specified customer implements the call developer.epages.com/apps/api-reference/get-shops-shopid-customers-customerid.html
29 30 31 32 |
# 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 = {}) ⇒ Object
call the API and return an array of Epages::Customer implements the call developer.epages.com/apps/api-reference/get-shops-shopid-customers.html
13 14 15 |
# File 'lib/epages/rest/customers.rb', line 13 def customers( = {}) perform_get_with_object('/customers', , Epages::CustomersResponse) end |
#update_customer(customer, options = {}) ⇒ Object
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
39 40 41 42 |
# File 'lib/epages/rest/customers.rb', line 39 def update_customer(customer, = {}) id = epages_id(customer) perform_patch_with_object("/customers/#{id}", , Epages::Customer) end |