« Back to Documentation Overview

campaignEcommAddOrder – v1.1

 campaignEcommAddOrder(string apikey, array order)

Attach Ecommerce Order Information to a Campaign. This will generall be used by ecommerce package plugins that we provide or by 3rd part system developers.

Campaign Related
apikey a valid API Key for your user account. Get by calling 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
stringcampaign_idthe Campaign Id to track this order with (see the "mc_cid" query string variable a campaign passes)
stringemail_idthe Email Id of the subscriber we should attach this order to (see the "mc_eid" query string variable a campaign passes)
doubletotalThe Order Total (ie, the full amount the customer ends up paying)
doubleshippingoptional - the total paid for Shipping Fees
doubletaxoptional - the total tax paid
stringstore_ida unique id for the store sending the order in
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)
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)
bool true if the data is saved, otherwise an error is thrown.