pushOrder()

Conversion/order event - most common event to push to Fera manually (usually for custom platform implementations)

This is how you can send a order creation (subscription, conversion, etc) event to the Fera server to be added to the current shopper's journey.

If you're already using one of our Shopify, BigCommerce, Magento or other apps then you don't need to send an order/conversion event - it's sent automatically.

Example 1: Minimal Order Data

This example assumes that we already have synced product, variant and customer data in the setProduct and setCustomer actions when accessed in previous pages.

fera.push('order', { // FYI fera.push('pushOrder' also works, this is just more readable
id: "12345",
line_items: [{
name: "Product 123",
product_id: "product-123",
variant_id: "variation1", // If variant exists
total: 100.0
}],
customer_id: "customer-123"
});

Full Order Data

fera.push('order', {
id: "12345", // Required - Integer, String: A unique identifier that your platform can identify the order by.
number: "order-5", // Optional - Integer, String: A user-friendly order identifier that appears on the order frontend.
test: false, // Optional - Boolean: If true, the order will be skipped in certain calculations.
canceled: false, // Optional - Boolean If true, the order will be ignored from certain calculations.
total: 10.0, // Optional - Float: If not provided, then line item totals must be provided.
total_usd: 10.0, // Optional - Float: If not USD main currency
created_at: "2019-03-18T21:01:10+00:00", // (Optional) String (ISO 8601 format DateTime)
modified_at: "2019-03-18T21:01:10+00:00", // (Optional) String (ISO 8601 format DateTime)
source_name: "web", // (Optional) String
line_items: [{ // Required - Array<LineItem>
name: "Subscription to Product 123", // Required - String
id: "line-1", // Optional - String
quantity: 1, // Optional - Integer: Assumes 1 if not provided
total: 10.0, // Required - Float
total_usd: 10.0, // Optional - Float: If not USD main currency
variant_id: "variation1", // (Optional) String: If a variation was particularly selected, then specify it here
product_id: "123", // Optional - String: Either this field or the "product" field most be specified.
product: { // Optional - Product: Either this field or the "product_id" field most be specified.
id: "product-123", // String
name: "Product 123", // String
status: "published", // (Optional) String
price: 99.89, // (Optional) Float
created_at: "2019-03-18T21:01:10+00:00", // (Optional) String (ISO 8601 format DateTime)
modified_at: "2019-03-18T21:01:10+00:00", // (Optional) String (ISO 8601 format DateTime)
stock: 123, // (Optional) Integer, If null assumed to be infinite.
in_stock: true, // (Optional) Boolean
url: "https://www.example.com/products/product-123", // String
thumbnail_url: "https://cdn.example.com/products/product-123/image.png", // String
needs_shipping: true, // (Optional) Boolean
hidden: false, // (Optional) Boolean
variants: [{ // (Optional) Array<Variant>: Variants that are applicable to this product.
id: "product-123-variation1", // String
name: "Product 123 - Variation 1",
stock: 10, // (Optional) Integer, String: Only used if stock is not specified by parent product schema.
in_stock: true, // (Optional) String, Boolean
thumbnail_url: "https://cdn.example.com/products/product-123/variation1/image.png", // (Optional) String
}],
platform_data: { custom_attribute: "custom value" } // (Optional) Hash/Object of attributes to store about the product specific to the integration platform (can be used in future filters)
}
}],
shopper: {
customer_id: "customer-123",
name: "John Doe",
email: "john.doe@example.com",
country_code: "US",
region_name: "California",
city_name: "Orange County",
zip: "78730",
platform_data: { custom_attribute: "custom value" }
}
});

Object References