function MCAPI::ecommAddOrder in Mailchimp 6.2
Import Ecommerce Order Information to be used for Segmentatio. This will generall be used by ecommerce package plugins <a href="/plugins/ecomm360.phtml">that we provide</a> or by 3rd part system developers. @section Helper
Parameters
array $order an array of information pertaining to the order that has completed. Use the following keys:: string id the Order Id string email_id optional (kind of) the Email Id of the subscriber we should attach this order to (see the "mc_eid" query string variable a campaign passes) - either this or <strong>email</strong> is required. If both are provided, email_id takes precedence string email optional (kind of) the Email Address we should attach this order to - either this or <strong>email_id</strong> is required. If both are provided, email_id takes precedence double total The Order Total (ie, the full amount the customer ends up paying) string order_date optional the date of the order - if this is not provided, we will default the date to now double shipping optional the total paid for Shipping Fees double tax optional the total tax paid string store_id a unique id for the store sending the order in (20 character max) string store_name optional a "nice" name for the store - typically the base web address (ie, "store.mailchimp.com"). We will automatically update this if it changes (based on store_id) string plugin_id the MailChimp assigned Plugin Id. Get yours by <a href="/api/register.php">registering here</a> string campaign_id optional the Campaign Id to track this order with (see the "mc_cid" query string variable a campaign passes) array items the individual line items for an order using these keys: <div style="padding-left:30px"><table><tr><td colspan=*> integer line_num optional the line number of the item on the order. We will generate these if they are not passed integer product_id the store's internal Id for the product. Lines that do no contain this will be skipped string product_name the product name for the product_id associated with this item. We will auto update these as they change (based on product_id) integer category_id the store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario string category_name the category name for the category_id this product is in. Our testing has found this to be a "best guess" scenario. Our plugins walk the category heirarchy up and send "Root - SubCat1 - SubCat4", etc. double qty the quantity of the item ordered double cost the cost of a single item (ie, not the extended cost of the line) </td></tr></table></div>
Return value
bool true if the data is saved, otherwise an error is thrown.
File
- ./
MCAPI.class.php, line 1818
Class
Code
function ecommAddOrder($order) {
$params = array();
$params["order"] = $order;
return $this
->callServer("ecommAddOrder", $params);
}