class UltracartClient::CustomerApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/ultracart_api/api/customer_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end
new_using_api_key(simple_key, verify_ssl = true, debugging = false) click to toggle source
# File lib/ultracart_api/api/customer_api.rb, line 23
def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
  api_config = Configuration.new
  api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
  api_config.api_version = '2017-03-01'
  api_config.verify_ssl = verify_ssl

  api_client = ApiClient.new(api_config)
  api_client.config.debugging = debugging

  UltracartClient::CustomerApi.new(api_client)
end

Public Instance Methods

delete_customer(customer_profile_oid, opts = {}) click to toggle source

Delete a customer Delete a customer on the UltraCart account. @param customer_profile_oid The customer_profile_oid to delete. @param [Hash] opts the optional parameters @return [CustomerResponse]

# File lib/ultracart_api/api/customer_api.rb, line 40
def delete_customer(customer_profile_oid, opts = {})
  data, _status_code, _headers = delete_customer_with_http_info(customer_profile_oid, opts)
  data
end
delete_customer_with_http_info(customer_profile_oid, opts = {}) click to toggle source

Delete a customer Delete a customer on the UltraCart account. @param customer_profile_oid The customer_profile_oid to delete. @param [Hash] opts the optional parameters @return [Array<(CustomerResponse, Fixnum, Hash)>] CustomerResponse data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 50
def delete_customer_with_http_info(customer_profile_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.delete_customer ...'
  end
  # verify the required parameter 'customer_profile_oid' is set
  if @api_client.config.client_side_validation && customer_profile_oid.nil?
    fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.delete_customer"
  end
  # resource path
  local_var_path = '/customer/customers/{customer_profile_oid}'.sub('{' + 'customer_profile_oid' + '}', customer_profile_oid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomerResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#delete_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_customer(customer_profile_oid, opts = {}) click to toggle source

Retrieve a customer Retrieves a single customer using the specified customer profile oid. @param customer_profile_oid The customer oid to retrieve. @param [Hash] opts the optional parameters @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [CustomerResponse]

# File lib/ultracart_api/api/customer_api.rb, line 96
def get_customer(customer_profile_oid, opts = {})
  data, _status_code, _headers = get_customer_with_http_info(customer_profile_oid, opts)
  data
end
get_customer_by_email(email, opts = {}) click to toggle source

Retrieve a customer by Email Retrieves a single customer using the specified customer email address. @param email The email address of the customer to retrieve. @param [Hash] opts the optional parameters @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [CustomerResponse]

# File lib/ultracart_api/api/customer_api.rb, line 154
def get_customer_by_email(email, opts = {})
  data, _status_code, _headers = get_customer_by_email_with_http_info(email, opts)
  data
end
get_customer_by_email_with_http_info(email, opts = {}) click to toggle source

Retrieve a customer by Email Retrieves a single customer using the specified customer email address. @param email The email address of the customer to retrieve. @param [Hash] opts the optional parameters @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [Array<(CustomerResponse, Fixnum, Hash)>] CustomerResponse data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 165
def get_customer_by_email_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer_by_email ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling CustomerApi.get_customer_by_email"
  end
  # resource path
  local_var_path = '/customer/customers/by_email/{email}'.sub('{' + 'email' + '}', email.to_s)

  # query parameters
  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomerResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#get_customer_by_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_customer_editor_values(opts = {}) click to toggle source

Retrieve values needed for a customer profile editor Retrieve values needed for a customer profile editor. @param [Hash] opts the optional parameters @return [CustomerEditorValues]

# File lib/ultracart_api/api/customer_api.rb, line 210
def get_customer_editor_values(opts = {})
  data, _status_code, _headers = get_customer_editor_values_with_http_info(opts)
  data
end
get_customer_editor_values_with_http_info(opts = {}) click to toggle source

Retrieve values needed for a customer profile editor Retrieve values needed for a customer profile editor. @param [Hash] opts the optional parameters @return [Array<(CustomerEditorValues, Fixnum, Hash)>] CustomerEditorValues data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 219
def get_customer_editor_values_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer_editor_values ...'
  end
  # resource path
  local_var_path = '/customer/editor_values'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomerEditorValues')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#get_customer_editor_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_customer_email_lists(opts = {}) click to toggle source

Retrieve all email lists across all storefronts Retrieve all email lists across all storefronts @param [Hash] opts the optional parameters @return [EmailListsResponse]

# File lib/ultracart_api/api/customer_api.rb, line 259
def get_customer_email_lists(opts = {})
  data, _status_code, _headers = get_customer_email_lists_with_http_info(opts)
  data
end
get_customer_email_lists_with_http_info(opts = {}) click to toggle source

Retrieve all email lists across all storefronts Retrieve all email lists across all storefronts @param [Hash] opts the optional parameters @return [Array<(EmailListsResponse, Fixnum, Hash)>] EmailListsResponse data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 268
def get_customer_email_lists_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer_email_lists ...'
  end
  # resource path
  local_var_path = '/customer/email_lists'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'EmailListsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#get_customer_email_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_customer_with_http_info(customer_profile_oid, opts = {}) click to toggle source

Retrieve a customer Retrieves a single customer using the specified customer profile oid. @param customer_profile_oid The customer oid to retrieve. @param [Hash] opts the optional parameters @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [Array<(CustomerResponse, Fixnum, Hash)>] CustomerResponse data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 107
def get_customer_with_http_info(customer_profile_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer ...'
  end
  # verify the required parameter 'customer_profile_oid' is set
  if @api_client.config.client_side_validation && customer_profile_oid.nil?
    fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.get_customer"
  end
  # resource path
  local_var_path = '/customer/customers/{customer_profile_oid}'.sub('{' + 'customer_profile_oid' + '}', customer_profile_oid.to_s)

  # query parameters
  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomerResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#get_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_customers(opts = {}) click to toggle source

Retrieve customers Retrieves customers from the account. If no parameters are specified, all customers will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination. @param [Hash] opts the optional parameters @option opts [String] :email Email @option opts [String] :qb_class Quickbooks class @option opts [String] :quickbooks_code Quickbooks code @option opts [String] :last_modified_dts_start Last modified date start @option opts [String] :last_modified_dts_end Last modified date end @option opts [String] :signup_dts_start Signup date start @option opts [String] :signup_dts_end Signup date end @option opts [String] :billing_first_name Billing first name @option opts [String] :billing_last_name Billing last name @option opts [String] :billing_company Billing company @option opts [String] :billing_city Billing city @option opts [String] :billing_state Billing state @option opts [String] :billing_postal_code Billing postal code @option opts [String] :billing_country_code Billing country code @option opts [String] :billing_day_phone Billing day phone @option opts [String] :billing_evening_phone Billing evening phone @option opts [String] :shipping_first_name Shipping first name @option opts [String] :shipping_last_name Shipping last name @option opts [String] :shipping_company Shipping company @option opts [String] :shipping_city Shipping city @option opts [String] :shipping_state Shipping state @option opts [String] :shipping_postal_code Shipping postal code @option opts [String] :shipping_country_code Shipping country code @option opts [String] :shipping_day_phone Shipping day phone @option opts [String] :shipping_evening_phone Shipping evening phone @option opts [Integer] :pricing_tier_oid Pricing tier oid @option opts [String] :pricing_tier_name Pricing tier name @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Max 200) (default to 100) @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. (default to 0) @option opts [String] :_since Fetch customers that have been created/modified since this date/time. @option opts [String] :_sort The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [CustomersResponse]

# File lib/ultracart_api/api/customer_api.rb, line 340
def get_customers(opts = {})
  data, _status_code, _headers = get_customers_with_http_info(opts)
  data
end
get_customers_by_query(customer_query, opts = {}) click to toggle source

Retrieve customers by query Retrieves customers from the account. If no parameters are specified, all customers will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination. @param customer_query Customer query @param [Hash] opts the optional parameters @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Max 200) (default to 100) @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. (default to 0) @option opts [String] :_since Fetch customers that have been created/modified since this date/time. @option opts [String] :_sort The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [CustomersResponse]

# File lib/ultracart_api/api/customer_api.rb, line 459
def get_customers_by_query(customer_query, opts = {})
  data, _status_code, _headers = get_customers_by_query_with_http_info(customer_query, opts)
  data
end
get_customers_by_query_with_http_info(customer_query, opts = {}) click to toggle source

Retrieve customers by query Retrieves customers from the account. If no parameters are specified, all customers will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination. @param customer_query Customer query @param [Hash] opts the optional parameters @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Max 200) @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. @option opts [String] :_since Fetch customers that have been created/modified since this date/time. @option opts [String] :_sort The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [Array<(CustomersResponse, Fixnum, Hash)>] CustomersResponse data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 474
def get_customers_by_query_with_http_info(customer_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.get_customers_by_query ...'
  end
  # verify the required parameter 'customer_query' is set
  if @api_client.config.client_side_validation && customer_query.nil?
    fail ArgumentError, "Missing the required parameter 'customer_query' when calling CustomerApi.get_customers_by_query"
  end
  # resource path
  local_var_path = '/customer/customers/query'

  # query parameters
  query_params = {}
  query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
  query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
  query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?
  query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(customer_query)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomersResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#get_customers_by_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_customers_for_data_tables(opts = {}) click to toggle source

Retrieve customers for DataTables plugin Retrieves customers from the account. If no searches are specified, all customers will be returned. @param [Hash] opts the optional parameters @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [DataTablesServerSideResponse]

# File lib/ultracart_api/api/customer_api.rb, line 524
def get_customers_for_data_tables(opts = {})
  data, _status_code, _headers = get_customers_for_data_tables_with_http_info(opts)
  data
end
get_customers_for_data_tables_with_http_info(opts = {}) click to toggle source

Retrieve customers for DataTables plugin Retrieves customers from the account. If no searches are specified, all customers will be returned. @param [Hash] opts the optional parameters @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [Array<(DataTablesServerSideResponse, Fixnum, Hash)>] DataTablesServerSideResponse data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 534
def get_customers_for_data_tables_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.get_customers_for_data_tables ...'
  end
  # resource path
  local_var_path = '/customer/customers/dataTables'

  # query parameters
  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DataTablesServerSideResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#get_customers_for_data_tables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_customers_with_http_info(opts = {}) click to toggle source

Retrieve customers Retrieves customers from the account. If no parameters are specified, all customers will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination. @param [Hash] opts the optional parameters @option opts [String] :email Email @option opts [String] :qb_class Quickbooks class @option opts [String] :quickbooks_code Quickbooks code @option opts [String] :last_modified_dts_start Last modified date start @option opts [String] :last_modified_dts_end Last modified date end @option opts [String] :signup_dts_start Signup date start @option opts [String] :signup_dts_end Signup date end @option opts [String] :billing_first_name Billing first name @option opts [String] :billing_last_name Billing last name @option opts [String] :billing_company Billing company @option opts [String] :billing_city Billing city @option opts [String] :billing_state Billing state @option opts [String] :billing_postal_code Billing postal code @option opts [String] :billing_country_code Billing country code @option opts [String] :billing_day_phone Billing day phone @option opts [String] :billing_evening_phone Billing evening phone @option opts [String] :shipping_first_name Shipping first name @option opts [String] :shipping_last_name Shipping last name @option opts [String] :shipping_company Shipping company @option opts [String] :shipping_city Shipping city @option opts [String] :shipping_state Shipping state @option opts [String] :shipping_postal_code Shipping postal code @option opts [String] :shipping_country_code Shipping country code @option opts [String] :shipping_day_phone Shipping day phone @option opts [String] :shipping_evening_phone Shipping evening phone @option opts [Integer] :pricing_tier_oid Pricing tier oid @option opts [String] :pricing_tier_name Pricing tier name @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Max 200) @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. @option opts [String] :_since Fetch customers that have been created/modified since this date/time. @option opts [String] :_sort The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [Array<(CustomersResponse, Fixnum, Hash)>] CustomersResponse data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 381
def get_customers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.get_customers ...'
  end
  # resource path
  local_var_path = '/customer/customers'

  # query parameters
  query_params = {}
  query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?
  query_params[:'qb_class'] = opts[:'qb_class'] if !opts[:'qb_class'].nil?
  query_params[:'quickbooks_code'] = opts[:'quickbooks_code'] if !opts[:'quickbooks_code'].nil?
  query_params[:'last_modified_dts_start'] = opts[:'last_modified_dts_start'] if !opts[:'last_modified_dts_start'].nil?
  query_params[:'last_modified_dts_end'] = opts[:'last_modified_dts_end'] if !opts[:'last_modified_dts_end'].nil?
  query_params[:'signup_dts_start'] = opts[:'signup_dts_start'] if !opts[:'signup_dts_start'].nil?
  query_params[:'signup_dts_end'] = opts[:'signup_dts_end'] if !opts[:'signup_dts_end'].nil?
  query_params[:'billing_first_name'] = opts[:'billing_first_name'] if !opts[:'billing_first_name'].nil?
  query_params[:'billing_last_name'] = opts[:'billing_last_name'] if !opts[:'billing_last_name'].nil?
  query_params[:'billing_company'] = opts[:'billing_company'] if !opts[:'billing_company'].nil?
  query_params[:'billing_city'] = opts[:'billing_city'] if !opts[:'billing_city'].nil?
  query_params[:'billing_state'] = opts[:'billing_state'] if !opts[:'billing_state'].nil?
  query_params[:'billing_postal_code'] = opts[:'billing_postal_code'] if !opts[:'billing_postal_code'].nil?
  query_params[:'billing_country_code'] = opts[:'billing_country_code'] if !opts[:'billing_country_code'].nil?
  query_params[:'billing_day_phone'] = opts[:'billing_day_phone'] if !opts[:'billing_day_phone'].nil?
  query_params[:'billing_evening_phone'] = opts[:'billing_evening_phone'] if !opts[:'billing_evening_phone'].nil?
  query_params[:'shipping_first_name'] = opts[:'shipping_first_name'] if !opts[:'shipping_first_name'].nil?
  query_params[:'shipping_last_name'] = opts[:'shipping_last_name'] if !opts[:'shipping_last_name'].nil?
  query_params[:'shipping_company'] = opts[:'shipping_company'] if !opts[:'shipping_company'].nil?
  query_params[:'shipping_city'] = opts[:'shipping_city'] if !opts[:'shipping_city'].nil?
  query_params[:'shipping_state'] = opts[:'shipping_state'] if !opts[:'shipping_state'].nil?
  query_params[:'shipping_postal_code'] = opts[:'shipping_postal_code'] if !opts[:'shipping_postal_code'].nil?
  query_params[:'shipping_country_code'] = opts[:'shipping_country_code'] if !opts[:'shipping_country_code'].nil?
  query_params[:'shipping_day_phone'] = opts[:'shipping_day_phone'] if !opts[:'shipping_day_phone'].nil?
  query_params[:'shipping_evening_phone'] = opts[:'shipping_evening_phone'] if !opts[:'shipping_evening_phone'].nil?
  query_params[:'pricing_tier_oid'] = opts[:'pricing_tier_oid'] if !opts[:'pricing_tier_oid'].nil?
  query_params[:'pricing_tier_name'] = opts[:'pricing_tier_name'] if !opts[:'pricing_tier_name'].nil?
  query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
  query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
  query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?
  query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomersResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#get_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_email_verification_token(token_request, opts = {}) click to toggle source

Create a token that can be used to verify a customer email address Create a token that can be used to verify a customer email address. The implementation of how a customer interacts with this token is left to the merchant. @param token_request Token request @param [Hash] opts the optional parameters @return [EmailVerifyTokenResponse]

# File lib/ultracart_api/api/customer_api.rb, line 576
def get_email_verification_token(token_request, opts = {})
  data, _status_code, _headers = get_email_verification_token_with_http_info(token_request, opts)
  data
end
get_email_verification_token_with_http_info(token_request, opts = {}) click to toggle source

Create a token that can be used to verify a customer email address Create a token that can be used to verify a customer email address. The implementation of how a customer interacts with this token is left to the merchant. @param token_request Token request @param [Hash] opts the optional parameters @return [Array<(EmailVerifyTokenResponse, Fixnum, Hash)>] EmailVerifyTokenResponse data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 586
def get_email_verification_token_with_http_info(token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.get_email_verification_token ...'
  end
  # verify the required parameter 'token_request' is set
  if @api_client.config.client_side_validation && token_request.nil?
    fail ArgumentError, "Missing the required parameter 'token_request' when calling CustomerApi.get_email_verification_token"
  end
  # resource path
  local_var_path = '/customer/customers/email_verify/get_token'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(token_request)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'EmailVerifyTokenResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#get_email_verification_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
insert_customer(customer, opts = {}) click to toggle source

Insert a customer Insert a customer on the UltraCart account. @param customer Customer to insert @param [Hash] opts the optional parameters @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [CustomerResponse]

# File lib/ultracart_api/api/customer_api.rb, line 632
def insert_customer(customer, opts = {})
  data, _status_code, _headers = insert_customer_with_http_info(customer, opts)
  data
end
insert_customer_with_http_info(customer, opts = {}) click to toggle source

Insert a customer Insert a customer on the UltraCart account. @param customer Customer to insert @param [Hash] opts the optional parameters @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [Array<(CustomerResponse, Fixnum, Hash)>] CustomerResponse data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 643
def insert_customer_with_http_info(customer, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.insert_customer ...'
  end
  # verify the required parameter 'customer' is set
  if @api_client.config.client_side_validation && customer.nil?
    fail ArgumentError, "Missing the required parameter 'customer' when calling CustomerApi.insert_customer"
  end
  # resource path
  local_var_path = '/customer/customers'

  # query parameters
  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(customer)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomerResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#insert_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_customer(customer, customer_profile_oid, opts = {}) click to toggle source

Update a customer Update a customer on the UltraCart account. @param customer Customer to update @param customer_profile_oid The customer_profile_oid to update. @param [Hash] opts the optional parameters @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [CustomerResponse]

# File lib/ultracart_api/api/customer_api.rb, line 691
def update_customer(customer, customer_profile_oid, opts = {})
  data, _status_code, _headers = update_customer_with_http_info(customer, customer_profile_oid, opts)
  data
end
update_customer_email_lists(customer_profile_oid, list_changes, opts = {}) click to toggle source

Update email list subscriptions for a customer Update email list subscriptions for a customer @param customer_profile_oid The customer profile oid @param list_changes List changes @param [Hash] opts the optional parameters @return [CustomerEmailListChanges]

# File lib/ultracart_api/api/customer_api.rb, line 754
def update_customer_email_lists(customer_profile_oid, list_changes, opts = {})
  data, _status_code, _headers = update_customer_email_lists_with_http_info(customer_profile_oid, list_changes, opts)
  data
end
update_customer_email_lists_with_http_info(customer_profile_oid, list_changes, opts = {}) click to toggle source

Update email list subscriptions for a customer Update email list subscriptions for a customer @param customer_profile_oid The customer profile oid @param list_changes List changes @param [Hash] opts the optional parameters @return [Array<(CustomerEmailListChanges, Fixnum, Hash)>] CustomerEmailListChanges data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 765
def update_customer_email_lists_with_http_info(customer_profile_oid, list_changes, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.update_customer_email_lists ...'
  end
  # verify the required parameter 'customer_profile_oid' is set
  if @api_client.config.client_side_validation && customer_profile_oid.nil?
    fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.update_customer_email_lists"
  end
  # verify the required parameter 'list_changes' is set
  if @api_client.config.client_side_validation && list_changes.nil?
    fail ArgumentError, "Missing the required parameter 'list_changes' when calling CustomerApi.update_customer_email_lists"
  end
  # resource path
  local_var_path = '/customer/customers/{customer_profile_oid}/email_lists'.sub('{' + 'customer_profile_oid' + '}', customer_profile_oid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(list_changes)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomerEmailListChanges')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#update_customer_email_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_customer_with_http_info(customer, customer_profile_oid, opts = {}) click to toggle source

Update a customer Update a customer on the UltraCart account. @param customer Customer to update @param customer_profile_oid The customer_profile_oid to update. @param [Hash] opts the optional parameters @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples @return [Array<(CustomerResponse, Fixnum, Hash)>] CustomerResponse data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 703
def update_customer_with_http_info(customer, customer_profile_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.update_customer ...'
  end
  # verify the required parameter 'customer' is set
  if @api_client.config.client_side_validation && customer.nil?
    fail ArgumentError, "Missing the required parameter 'customer' when calling CustomerApi.update_customer"
  end
  # verify the required parameter 'customer_profile_oid' is set
  if @api_client.config.client_side_validation && customer_profile_oid.nil?
    fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.update_customer"
  end
  # resource path
  local_var_path = '/customer/customers/{customer_profile_oid}'.sub('{' + 'customer_profile_oid' + '}', customer_profile_oid.to_s)

  # query parameters
  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(customer)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomerResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#update_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
validate_email_verification_token(validation_request, opts = {}) click to toggle source

Validate a token that can be used to verify a customer email address Validate a token that can be used to verify a customer email address. The implementation of how a customer interacts with this token is left to the merchant. @param validation_request Token validation request @param [Hash] opts the optional parameters @return [EmailVerifyTokenValidateResponse]

# File lib/ultracart_api/api/customer_api.rb, line 814
def validate_email_verification_token(validation_request, opts = {})
  data, _status_code, _headers = validate_email_verification_token_with_http_info(validation_request, opts)
  data
end
validate_email_verification_token_with_http_info(validation_request, opts = {}) click to toggle source

Validate a token that can be used to verify a customer email address Validate a token that can be used to verify a customer email address. The implementation of how a customer interacts with this token is left to the merchant. @param validation_request Token validation request @param [Hash] opts the optional parameters @return [Array<(EmailVerifyTokenValidateResponse, Fixnum, Hash)>] EmailVerifyTokenValidateResponse data, response status code and response headers

# File lib/ultracart_api/api/customer_api.rb, line 824
def validate_email_verification_token_with_http_info(validation_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.validate_email_verification_token ...'
  end
  # verify the required parameter 'validation_request' is set
  if @api_client.config.client_side_validation && validation_request.nil?
    fail ArgumentError, "Missing the required parameter 'validation_request' when calling CustomerApi.validate_email_verification_token"
  end
  # resource path
  local_var_path = '/customer/customers/email_verify/validate_token'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(validation_request)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'EmailVerifyTokenValidateResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#validate_email_verification_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end