Order tracking

Introduction

We leverage order data for multiple purposes, including:

Powering Apps:

We use historical order data to enhance the functionality and content of apps like FBT (Frequently Bought Together), Bestsellers, etc.

User Tracking:

We track users who have placed orders to gather valuable insights and intelligence for various purposes.

Attribution:

Accurate identification of orders attributed through our apps in real-time is crucial for precise charging and commission calculations.

Requirements

API to fetch historical order data

  • This should support the search orders by date range, status
  • Support batching
  • Fetching specific fields

Webhook to get order data on order create / update

  • To get real-time information on orders created in the system
  • API to register order webhooks

Availability of order details on the order confirmation page

  • From the client side, we send events to capture vital information such as user details, widget information, and specific order details once the order is confirmed

Structure of Order Data

{
  "currency": "INR",
  "order_id": "<>",
  "line_items": [
    {
      "id": "string",
      "price": "float",  # Price of the item before the discount
      "product_id": "string",
      "quantity": "integer",
      "properties": "[{'name': ABC, 'value': abc}]" # containing properties associated with item
      "total_discount": # Discount at line item level
    }
  ],

  # Customer info
  "cart_token": "ABC",
  "email": "string",
  "customer_locale": "string",
  "customer": {"id": "string"}

  "status": "string"

  # Price and taxes
  "total_price": "float", # sum of all line items price, discount, taxes, shipping, duties
  "taxes": "float" # total tax applied
  "shipping": "float"  # shipping cost
  "total_discounts": "float"
  "duties": "float"
}

What’s Next