class MailchimpMarketing::EcommerceApi

Attributes

api_client[RW]

Public Class Methods

new(api_client) click to toggle source
# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 19
def initialize(api_client)
  @api_client = api_client
end

Public Instance Methods

add_cart_line_item(store_id, cart_id, body, opts = {}) click to toggle source

Add cart line item

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 833
def add_cart_line_item(store_id, cart_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}/lines'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s)
  data = @api_client.call_api(:POST, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
add_order_line_item(store_id, order_id, body, opts = {}) click to toggle source

Add order line item

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 879
def add_order_line_item(store_id, order_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}/lines'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s)
  data = @api_client.call_api(:POST, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
add_product_image(store_id, product_id, body, opts = {}) click to toggle source

Add product image

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 910
def add_product_image(store_id, product_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/images'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s)
  data = @api_client.call_api(:POST, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
add_product_variant(store_id, product_id, variant_id, body, opts = {}) click to toggle source

Add or update product variant

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 989
def add_product_variant(store_id, product_id, variant_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, "Missing required param: 'variant_id'" if variant_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants/{variant_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'variant_id' + '}', variant_id.to_s)
  data = @api_client.call_api(:PUT, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
add_product_variants(store_id, product_id, body, opts = {}) click to toggle source

Add product variant

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 926
def add_product_variants(store_id, product_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s)
  data = @api_client.call_api(:POST, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
add_promo_code(store_id, promo_rule_id, body, opts = {}) click to toggle source

Add promo code

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 942
def add_promo_code(store_id, promo_rule_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s)
  data = @api_client.call_api(:POST, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
add_promo_rules(store_id, body, opts = {}) click to toggle source

Add promo rule

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 958
def add_promo_rules(store_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/promo-rules'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:POST, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
add_store(body, opts = {}) click to toggle source

Add store

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 804
def add_store(body, opts = {})
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores'
  data = @api_client.call_api(:POST, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
add_store_cart(store_id, body, opts = {}) click to toggle source

Add cart

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 818
def add_store_cart(store_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/carts'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:POST, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
add_store_customer(store_id, body, opts = {}) click to toggle source

Add customer

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 849
def add_store_customer(store_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/customers'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:POST, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
add_store_order(store_id, body, opts = {}) click to toggle source

Add order

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 864
def add_store_order(store_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/orders'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:POST, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
add_store_product(store_id, body, opts = {}) click to toggle source

Add product

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 895
def add_store_product(store_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/products'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:POST, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
delete_cart_line_item(store_id, cart_id, line_id, opts = {}) click to toggle source

Delete cart line item

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 53
def delete_cart_line_item(store_id, cart_id, line_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil?
  fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s)
  data = @api_client.call_api(:DELETE, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
delete_order(store_id, order_id, opts = {}) click to toggle source

Delete order

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 84
def delete_order(store_id, order_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s)
  data = @api_client.call_api(:DELETE, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
delete_order_line_item(store_id, order_id, line_id, opts = {}) click to toggle source

Delete order line item

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 99
def delete_order_line_item(store_id, order_id, line_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil?
  fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s)
  data = @api_client.call_api(:DELETE, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
delete_product_image(store_id, product_id, image_id, opts = {}) click to toggle source

Delete product image

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 130
def delete_product_image(store_id, product_id, image_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, "Missing required param: 'image_id'" if image_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/images/{image_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'image_id' + '}', image_id.to_s)
  data = @api_client.call_api(:DELETE, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
delete_product_variant(store_id, product_id, variant_id, opts = {}) click to toggle source

Delete product variant

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 146
def delete_product_variant(store_id, product_id, variant_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, "Missing required param: 'variant_id'" if variant_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants/{variant_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'variant_id' + '}', variant_id.to_s)
  data = @api_client.call_api(:DELETE, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
delete_promo_code(store_id, promo_rule_id, promo_code_id, opts = {}) click to toggle source

Delete promo code

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 162
def delete_promo_code(store_id, promo_rule_id, promo_code_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil?
  fail ArgumentError, "Missing required param: 'promo_code_id'" if promo_code_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes/{promo_code_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s).sub('{' + 'promo_code_id' + '}', promo_code_id.to_s)
  data = @api_client.call_api(:DELETE, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
delete_promo_rule(store_id, promo_rule_id, opts = {}) click to toggle source

Delete promo rule

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 178
def delete_promo_rule(store_id, promo_rule_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s)
  data = @api_client.call_api(:DELETE, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
delete_store(store_id, opts = {}) click to toggle source

Delete store

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 24
def delete_store(store_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:DELETE, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
delete_store_cart(store_id, cart_id, opts = {}) click to toggle source

Delete cart

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 38
def delete_store_cart(store_id, cart_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s)
  data = @api_client.call_api(:DELETE, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
delete_store_customer(store_id, customer_id, opts = {}) click to toggle source

Delete customer

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 69
def delete_store_customer(store_id, customer_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'customer_id'" if customer_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/customers/{customer_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'customer_id' + '}', customer_id.to_s)
  data = @api_client.call_api(:DELETE, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
delete_store_product(store_id, product_id, opts = {}) click to toggle source

Delete product

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 115
def delete_store_product(store_id, product_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s)
  data = @api_client.call_api(:DELETE, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_all_cart_line_items(store_id, cart_id, opts = {}) click to toggle source

List cart line items

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 285
def get_all_cart_line_items(store_id, cart_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil?
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}/lines'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_all_order_line_items(store_id, order_id, opts = {}) click to toggle source

List order line items

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 400
def get_all_order_line_items(store_id, order_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil?
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}/lines'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_all_store_customers(store_id, opts = {}) click to toggle source

List customers

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 323
def get_all_store_customers(store_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'email_address'] = opts[:'email_address'] if !opts[:'email_address'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/customers'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_all_store_products(store_id, opts = {}) click to toggle source

List product

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 438
def get_all_store_products(store_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/products'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_cart_line_item(store_id, cart_id, line_id, opts = {}) click to toggle source

Get cart line item

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 305
def get_cart_line_item(store_id, cart_id, line_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil?
  fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_order(store_id, order_id, opts = {}) click to toggle source

Get order info

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 383
def get_order(store_id, order_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_order_line_item(store_id, order_id, line_id, opts = {}) click to toggle source

Get order line item

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 420
def get_order_line_item(store_id, order_id, line_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil?
  fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_product_image(store_id, product_id, image_id, opts = {}) click to toggle source

Get product image info

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 494
def get_product_image(store_id, product_id, image_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, "Missing required param: 'image_id'" if image_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/images/{image_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'image_id' + '}', image_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_product_images(store_id, product_id, opts = {}) click to toggle source

List product images

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 474
def get_product_images(store_id, product_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/images'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_product_variant(store_id, product_id, variant_id, opts = {}) click to toggle source

Get product variant info

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 532
def get_product_variant(store_id, product_id, variant_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, "Missing required param: 'variant_id'" if variant_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants/{variant_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'variant_id' + '}', variant_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_product_variants(store_id, product_id, opts = {}) click to toggle source

List product variants

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 512
def get_product_variants(store_id, product_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_promo_code(store_id, promo_rule_id, promo_code_id, opts = {}) click to toggle source

Get promo code

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 570
def get_promo_code(store_id, promo_rule_id, promo_code_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil?
  fail ArgumentError, "Missing required param: 'promo_code_id'" if promo_code_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes/{promo_code_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s).sub('{' + 'promo_code_id' + '}', promo_code_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_promo_codes(promo_rule_id, store_id, opts = {}) click to toggle source

List promo codes

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 550
def get_promo_codes(promo_rule_id, store_id, opts = {})
  fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil?
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes'.sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s).sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_promo_rule(store_id, promo_rule_id, opts = {}) click to toggle source

Get promo rule

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 607
def get_promo_rule(store_id, promo_rule_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_store(store_id, opts = {}) click to toggle source

Get store info

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 233
def get_store(store_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_store_cart(store_id, cart_id, opts = {}) click to toggle source

Get cart info

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 268
def get_store_cart(store_id, cart_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_store_carts(store_id, opts = {}) click to toggle source

List carts

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 249
def get_store_carts(store_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/carts'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_store_customer(store_id, customer_id, opts = {}) click to toggle source

Get customer info

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 343
def get_store_customer(store_id, customer_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'customer_id'" if customer_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/customers/{customer_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'customer_id' + '}', customer_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_store_orders(store_id, opts = {}) click to toggle source

List orders

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 360
def get_store_orders(store_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'customer_id'] = opts[:'customer_id'] if !opts[:'customer_id'].nil?
  query_params[:'has_outreach'] = opts[:'has_outreach'] if !opts[:'has_outreach'].nil?
  query_params[:'campaign_id'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?
  query_params[:'outreach_id'] = opts[:'outreach_id'] if !opts[:'outreach_id'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/orders'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
get_store_product(store_id, product_id, opts = {}) click to toggle source

Get product info

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 457
def get_store_product(store_id, product_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
list_promo_rules(store_id, opts = {}) click to toggle source

List promo rules

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 588
def list_promo_rules(store_id, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores/{store_id}/promo-rules'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
orders(opts = {}) click to toggle source

List account orders

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 193
def orders(opts = {})
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'campaign_id'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?
  query_params[:'outreach_id'] = opts[:'outreach_id'] if !opts[:'outreach_id'].nil?
  query_params[:'customer_id'] = opts[:'customer_id'] if !opts[:'customer_id'].nil?
  query_params[:'has_outreach'] = opts[:'has_outreach'] if !opts[:'has_outreach'].nil?
  post_body = nil

  local_var_path = '/ecommerce/orders'
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
set_store_customer(store_id, customer_id, body, opts = {}) click to toggle source

Add or update customer

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 973
def set_store_customer(store_id, customer_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'customer_id'" if customer_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/customers/{customer_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'customer_id' + '}', customer_id.to_s)
  data = @api_client.call_api(:PUT, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
stores(opts = {}) click to toggle source

List stores

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 215
def stores(opts = {})
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  post_body = nil

  local_var_path = '/ecommerce/stores'
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
update_cart_line_item(store_id, cart_id, line_id, body, opts = {}) click to toggle source

Update cart line item

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 655
def update_cart_line_item(store_id, cart_id, line_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil?
  fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s)
  data = @api_client.call_api(:PATCH, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
update_order(store_id, order_id, body, opts = {}) click to toggle source

Update order

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 688
def update_order(store_id, order_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s)
  data = @api_client.call_api(:PATCH, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
update_order_line_item(store_id, order_id, line_id, body, opts = {}) click to toggle source

Update order line item

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 704
def update_order_line_item(store_id, order_id, line_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil?
  fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s)
  data = @api_client.call_api(:PATCH, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
update_product_image(store_id, product_id, image_id, body, opts = {}) click to toggle source

Update product image

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 737
def update_product_image(store_id, product_id, image_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, "Missing required param: 'image_id'" if image_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/images/{image_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'image_id' + '}', image_id.to_s)
  data = @api_client.call_api(:PATCH, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
update_product_variant(store_id, product_id, variant_id, body, opts = {}) click to toggle source

Update product variant

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 754
def update_product_variant(store_id, product_id, variant_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, "Missing required param: 'variant_id'" if variant_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants/{variant_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'variant_id' + '}', variant_id.to_s)
  data = @api_client.call_api(:PATCH, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
update_promo_code(store_id, promo_rule_id, promo_code_id, body, opts = {}) click to toggle source

Update promo code

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 771
def update_promo_code(store_id, promo_rule_id, promo_code_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil?
  fail ArgumentError, "Missing required param: 'promo_code_id'" if promo_code_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes/{promo_code_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s).sub('{' + 'promo_code_id' + '}', promo_code_id.to_s)
  data = @api_client.call_api(:PATCH, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
update_promo_rule(store_id, promo_rule_id, body, opts = {}) click to toggle source

Update promo rule

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 788
def update_promo_rule(store_id, promo_rule_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s)
  data = @api_client.call_api(:PATCH, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
update_store(store_id, body, opts = {}) click to toggle source

Update store

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 624
def update_store(store_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}'.sub('{' + 'store_id' + '}', store_id.to_s)
  data = @api_client.call_api(:PATCH, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
update_store_cart(store_id, cart_id, body, opts = {}) click to toggle source

Update cart

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 639
def update_store_cart(store_id, cart_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s)
  data = @api_client.call_api(:PATCH, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
update_store_customer(store_id, customer_id, body, opts = {}) click to toggle source

Update customer

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 672
def update_store_customer(store_id, customer_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'customer_id'" if customer_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/customers/{customer_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'customer_id' + '}', customer_id.to_s)
  data = @api_client.call_api(:PATCH, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end
update_store_product(store_id, product_id, body, opts = {}) click to toggle source

Update product

# File lib/MailchimpMarketing/api/ecommerce_api.rb, line 721
def update_store_product(store_id, product_id, body, opts = {})
  fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil?
  fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil?
  fail ArgumentError, "Missing required param: 'body'" if body.nil?

  query_params = {}
  post_body = @api_client.object_to_http_body(body)

  local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s)
  data = @api_client.call_api(:PATCH, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end