def new_customer(data = { }, cookie_info = nil)
      if cookie_info
        cookie_name = cookie_info[:cookie_name] || DEFAULT_COOKIE_NAME
        cookie_data = (YAML.load(cookie_info[:cookies][cookie_name] || "") rescue nil) || { }
        [:firstContactDatetime, :referer, :campaignTerm, :campaignName, 
         :campaignSource, :campaignMedium, :campaignContent].each do |key|
          data[key] ||= cookie_data[key] if cookie_data[key]
        end
      end
      do_request(:item => :customers, :action => :new, :data => data)
    end
def new_customer(data = { }, cookie_info = nil)
      if cookie_info
        cookie_name = cookie_info[:cookie_name] || DEFAULT_COOKIE_NAME
        cookie_data = (YAML.load(cookie_info[:cookies][cookie_name] || "") rescue nil) || { }
        [:firstContactDatetime, :referer, :campaignTerm, :campaignName, 
         :campaignSource, :campaignMedium, :campaignContent].each do |key|
          data[key] ||= cookie_data[key] if cookie_data[key]
        end
      end
      do_request(:item => :customers, :action => :new, :data => data)
    end
https://cheddargetter.com/developers#add-customer

data:

{
  :code                 => required,
  :firstName            => required,
  :lastName             => required,
  :email                => required,
  :company              => not_required,
  :isVatExempt          => not_required,
  :vatNumber            => not_required,
  :notes                => not_required,
  :firstContactDatetime => not_required,
  :referer              => not_required,
  :campaignTerm         => not_required,
  :campaignName         => not_required,
  :campaignSource       => not_required,
  :campaignMedium       => not_required,
  :campaignContent      => not_required,
  :metaData => { #not_required
    :any_user_defined_value => not_required
  },
  :subscription => { #required
    :planCode        => required,
    :initialBillDate => not_required,
    :ccNumber        => required_if_not_free,
    :ccExpiration    => required_if_not_free,
    :ccCardCode      => required_if_not_free,
    :ccFirstName     => required_if_not_free,
    :ccLastName      => required_if_not_free,
    :ccCompany       => not_required,
    :ccCountry       => not_required,
    :ccAddress       => not_required,
    :ccCity          => not_required,
    :ccState         => not_required,
    :ccZip           => required_if_not_free
  },
  :charges => { #not required
    :user_defined => {
      :chargeCode  => required_if_adding_a_charge,
      :quantity    => required_if_adding_a_charge,
      :eachAmount  => required_if_adding_a_charge,
      :description => not_required
    }
  },
  :items => { #not required
    :user_defined => {
      :itemCode => required_if_setting_an_item,
      :quantity => required_if_setting_an_item
    }
  }
}

Pass in the cookie info hash if you have been using the
set_marketing_cookie method to track marketing metrics.
Info from the marketing cookie will be passed along to
Cheddar Getter in the new_customer call.

cookie_info (optional):

{
  :cookies => required
  :cookie_name => not_required
}