« Back to Documentation Overview

ecommAddOrder – v1.2

 ecommAddOrder(string apikey, array order)

Import Ecommerce Order Information to be used for Segmentatio. This will generall be used by ecommerce package plugins provided by us or by 3rd part system developers.

Section
Helper
Parameters
apikey a valid API Key for your user account. Get by visiting your API dashboard
order an array of information pertaining to the order that has completed. Use the following keys:
stringidthe Order Id
stringemail_idoptional - (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 email is required. If both are provided, email_id takes precedence
stringemailoptional - (kind of) the Email Address we should attach this order to - either this or email_id is required. If both are provided, email_id takes precedence
doubletotalThe Order Total (ie, the full amount the customer ends up paying)
stringorder_dateoptional - the date of the order - if this is not provided, we will default the date to now
doubleshippingoptional - the total paid for Shipping Fees
doubletaxoptional - the total tax paid
stringstore_ida unique id for the store sending the order in (20 character max)
stringstore_nameoptional - 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)
stringcampaign_idoptional - the Campaign Id to track this order with (see the "mc_cid" query string variable a campaign passes)
arrayitemsthe individual line items for an order using these keys:
integerline_numoptional - the line number of the item on the order. We will generate these if they are not passed
integerproduct_idthe store's internal Id for the product. Lines that do no contain this will be skipped
stringproduct_namethe product name for the product_id associated with this item. We will auto update these as they change (based on product_id)
integercategory_idthe store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario
stringcategory_namethe 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.
doubleqtythe quantity of the item ordered
doublecostthe cost of a single item (ie, not the extended cost of the line)
Returns
bool true if the data is saved, otherwise an error is thrown.