Skip to main content

Orders

Export your CRM orders and import them into the CDP. Additionally, orders can be augmented with additional information - or corrected with more up-to-date data- that might not be available in your CRM.

Use Cases

Importing orders into the CDP has 3 main use cases, as described below.

Bootstrap Your System with Historic Order Data

Importing orders plays an important role when bootstrapping a system. While Kevel Audience builds user profiles with attributes produced from the users' interaction with the website, businesses usually have a lot of information on orders placed before events are collected. These orders can add valuable information to produce user attributes. The attributes that benefit the most from a bootstrap from past orders are the ones related to the next purchase predictions, RFM and lifetime value. The attributes related to the likelihood to buy are produced using different types of events from the users' interaction with the website (besides the actual purchases), so they don't benefit much from an import of orders previously unseen in the system.

Ensure the Orders Used by the CDP Are in Sync with Your CRM Orders

Orders can change their state (for example, becoming canceled or refunded) without an explicit event from the user on the website. In those scenarios, periodic import of orders from your CRM backend can help Kevel Audience have a more accurate view of existing orders.

Complement Order Information Collected by Tracking Events with Details Private to the CRM Backend

Sometimes, the data available when producing events to be collected by Kevel Audience lacks some details that are private and, therefore, not directly accessible by the website. Typical scenarios are information missing from specific line items (like product-related data) or incomplete payment information due to actions that happen after the event is triggered. To ensure that Kevel Audience has access to relevant order details, CDP users should set up a periodic import of orders.

Order Events from Imports

Order imports generate order events. If the order is unknown, an orderPlace is generated. Otherwise, if the import provides new information, for example, the status of a line item is updated, an orderUpdate event is generated.

Considering the provided product ID, events generated from order imports are enriched if a product feed is available. Only omitted attributes are added from the product feed. Attributes available on the import are kept on the event and are not replaced by data from the product feed.

Formats

We currently have support for the following 1st and 3rd party formats:

Kevel Audience CSV

This format is intended for order imports using CSV, where each line is an Order is serialized to CSV. You can download an example file here.

Relevant notes:

  • The export file should be encoded using UTF-8.
  • All line items for the same order must be listed sequentially. Otherwise, only the last sequential line items of the order will be persisted;
  • Given an order with an arbitrary number of rows, only the first row is used to extract Order details and all rows are used to extract Line item details. This means that Orders with more than 1 Line item do not need to populate the order columns for all columns and can be left empty.
  • If the provided userId is not hashed (E.g. idType=email), you can configure the import to hash it (to a idType=email_sha256) beforehand.
  • The userId field is validated accordingly to the type specified in userIdType field. You can find more information about user ID types in the User Identifiers documentation.
ColumnRequiredTypeDescriptionDetailsExample
orderIdRequiredStringOrder identifierMust be unique by Orderor123
userIdTypeRequiredStringThe type of user identifier (e.g. "email")Check the User Identifiers documentationemail
userIdRequiredStringThe user identifierjohn@email.com
currencyRequiredStringThe currency used in monetary valuesCheck the supported currenciesEUR
totalRequiredDoubleTotal value of the order with all discounts already considered, including subtotal, tax and shippingtotal = subtotal + tax + shipping102.5
subtotalRequiredDoubleThe value of the order, when tax and shipping are excludedsubtotal = total - tax - shipping85
taxRequiredDoubleThe total applied tax value for the order11.5
shippingRequiredDoubleThe total shipping costs for the order6
discountRequiredDoubleThe total discounted value for the order5
refundRequiredDoubleThe total refunded value for the order0
paymentMethodStringThe payment methodVisa
shippingMethodStringThe shipping methodUPS
shippingCountryStringThe destination countryFrance
sourceStringSource from where the order was placed. Examples are web, phone call, POS.
promotionsList of StringsVouchers applied in the purchase.Strings separated by ;WINTERSALE
createdAtRequiredDateTimeWhen the order was createdDate format: ISO-86012020-09-16T10:38:06+0100
lastUpdatedDateTimeWhen the order was last updatedDate format: ISO-86012020-09-16T20:13:31+0100
custom_<name...>StringAttribute name and value to be imported as custom fieldThese columns can be specified multiple times with different names with the "custom_" prefix. The imported order will have those attribute names (without the "custom_" prefix) and respective values as custom fields. For example, "custom_color" will be mapped to "customFields.color" in the order.
lineItem_idStringA unique identifier for the line item within the orderli125zc
lineItem_productIdRequiredStringProduct identifierp125zc
lineItem_itemGroupIdStringIdentifier for a group of products that come in different versions (variants)p125
lineItem_nameStringProduct nameMy Product
lineItem_skuRequiredStringProduct SKUp125zc-5
lineItem_brandStringProduct brandNike
lineItem_categoryStringProduct categoryMen > Shirts > Short Sleeve Shirts
lineItem_categoriesListList of StringsA hierarchically sorted list of the sub-categories that this product belongs to. The first item on this list should be the most general sub-category, while the last should be the most specific. Any item on this list should correspond to a sub-category of the item immediately preceding it.Strings separated by ;Men;Shirts;Short Sleeve Shirts
lineItem_currencyRequiredStringThe currency used in monetary valuesCheck the supported currenciesEUR
lineItem_totalRequiredDoubleTotal value of the line item with all discounts already considered, including subtotal, tax and shippingtotal = subtotal + tax + shipping102.5
lineItem_subtotalRequiredDoubleThe value of the line item, when tax and shipping are excludedsubtotal = total - tax - shipping85
lineItem_taxRequiredDoubleThe total applied tax value for the line item11.5
lineItem_shippingRequiredDoubleThe total shipping costs for the line item6
lineItem_discountRequiredDoubleThe total discounted value for the line item5
lineItem_refundRequiredDoubleThe total refunded value for the line item0
lineItem_quantityRequiredDoubleQuantity of items purchased from this line item1.0
lineItem_promotionsList of StringsVouchers applied in the purchase or displayed together with the productStrings separated by ;WINTERSALE
lineItem_adultBooleanWhether the product includes sexually suggestive content.Must be true or false. Defaults to falsefalse
lineItem_subscriptionDurationLongIf the purchase relates to a subscription, captures the subscription duration, in milliseconds.15552000000
lineItem_sizeStringProduct sizeS
lineItem_sizeSystemStringCountry of the size system used by your product.EU
lineItem_statusRequiredStringLine item status.
  • placed the order has been placed but the item is yet to be paid
  • paid the item has been paid but not yet delivered
  • fulfilled the item has been paid and delivered
  • refunded the item has been refunded
  • cancelled the order has been modified to exclude this line item
  • Supported status: placed, paid, fulfilled, refunded, cancelledfulfilled

    This example file shows how each field can be used.

    Shopify CSV

    Kevel Audience supports CSV order exports from Shopify. The documentation for generating a Shopify export can be found here. Please ensure you select Export orders to export all order information instead of Export transaction histories, which only exports the transactions.

    Relevant notes:

    • Shopify uses the Name column to distinguish between different orders inside the CSV file, so it must be unique per Order;
    • All Line items for the same Order must be listed sequentially;
    • Given an order with an arbitrary number of rows, only the first row is used to extract Order details and all rows are used to extract Line item details. This means that Orders with more than 1 Line item do not need to populate the order columns for all columns and can be left empty.
    • If the provided userId is not hashed (e.g. idType=email), you can configure the import to hash it (to a idType=email_sha256) beforehand.
    • The email field is validated as an email.
    • It's important that the extracted order identifier from the shopify import matches the orderId provided via tracking events. When importing, you'll be able to select which field to use as the order identifier between the Id and Name columns.

    Kevel Audience will consider the following attributes while importing a Shopify file:

    ColumnRequiredTypeDetails
    NameRequiredStringMust be unique by Order and can be the same as Id (Can be used as an order identifier)
    EmailRequiredString
    IdRequiredString(Can be used as an order identifier)
    CurrencyRequiredStringCheck the supported currencies
    TotalRequiredDouble
    SubtotalRequiredDouble
    TaxesRequiredDouble
    Payment MethodString
    Financial StatusRequiredStringSupported status: authorized, paid, partially_paid, pending, refunded, partially_refunded, voided
    Refunded AmountRequiredDouble
    Discount AmountRequiredDouble
    Discount CodeString
    Shipping MethodString
    Shipping CountryString
    ShippingRequiredDouble
    SourceString
    Created atRequiredDateTimeDate format: yyyy-MM-dd HH:mm:ss Z
    Paid atDateTimeDate format: yyyy-MM-dd HH:mm:ss Z
    Fulfilled atDateTimeDate format: yyyy-MM-dd HH:mm:ss Z
    Lineitem quantityRequiredDouble
    Lineitem nameRequiredString
    Lineitem priceRequiredDouble
    Lineitem discountRequiredDouble
    Lineitem fulfillment statusRequiredStringSupported status: pending, partial, restocked, fulfilled
    Lineitem skuRequiredString
    VendorString