Lifesight Custom Backend Implementation

How does the Server Side events tracking work and what does Lifesight capture?

The data operator/admin needs to send the server-side events to a custom webhook endpoint, configured specially to receive server-side events grouped under Orders, Checkouts and Customers. Details on how this needs to be implemented is explained below.

API Requests

A POST request would need to be made to Lifesight’s endpoint with JSON data sent in the payload.

Endpoint

POST https://moda-transform-webhook-data-prd-7jirubb0.uc.gateway.dev/transform-webhook-data?key={{API_Key}}&workspace={{workspace}}&source={{source_name}}&event_name={{event_name}}

Query Parameters

Key Value

key

API Key for Lifesight’s endpoint - Will be shared when implementation begins

workspace

Workspace name for the account created for you on Lifesight

source

Source of data - Will be shared when implementation begins

event_name

POSSIBLE VALUES:
orders_create, orders_updated, orders_fulfilled, orders_partially_fulfilled, orders_paid, orders_cancelled, checkouts_create, checkouts_update, customers_create, customers_update

Orders

All order events would have the same payload structure. These events include orders_create, orders_updated, orders_fulfilled, orders_partially_fulfilled, orders_cancelled. The event to be sent is to be specified in the event_name query parameter in the API request.

Mandatory and Suggested Fields in the Orders Payload

FieldData TypeMandatory/SuggestedSample ValueDescription
idIntegerMandatory5766207635528ID of the Order
checkout_idIntegerSuggested40082301255752ID of the checkout that led to the order
contact_emailStringSuggested[email protected]Contact email of the customer placing the order
created_atString (Datetime)Mandatory2023-11-19T06:04:57-08:00The timestamp for when the order was placed
updated_atString (Datetime)Mandatory2023-11-19T06:04:57-08:00The timestamp for when the order was last updated
cancelled_atString (Datetime)Mandatory (only for orders_cancelled)2023-11-19T06:04:57-08:00The timestamp for when the order was cancelled
currencyStringMandatoryUSDCurrency
emailStringMandatory (if phone and customer.id are not present)[email protected]Email of the customer placing the order
total_priceStringMandatory30.49Total Price of the order
subtotal_priceStringMandatory23.4This value is for the subtotal price of all the items in the order after both line-item and cart discounts have been applied. The subtotal doesn't include taxes (unless taxes are included in the prices), shipping costs, or tips.
financial_statusStringSuggestedPOSSIBLE VALUES:
authorized, pending, paid, partially_paid, refunded, voided, partially_refunded, unpaidFinancial status of the order
fulfillment_statusStringSuggestedPOSSIBLE VALUES:
shipped, partial, unshipped, unfulfilledFulfillment status of the order
discount_codes[*].codeStringSuggestedSPRING30Discount code applied in the order
discount_codes[*].amountStringSuggested30.00Discount amount in the order
discount_codes[*].typeStringSuggestedPOSSIBLE VALUES:
fixed_amount, percentage, shippingType of discount applied
discount_codes[*].price_rule_idStringSuggested1445602380The ID for the price rule that this discount code belongs to
phoneStringMandatory (if email and customer.id are not present)9800320000Phone of the customer placing the order
referring_siteStringSuggestedlifesight.ioThe referring site that led to the purchase
tagsStringSuggestedLoyalOrder tags
customer.idStringMandatory6980745363528ID of the customer placing the order
customer.emailStringMandatory[email protected]Email of the customer placing the order
customer.phoneStringMandatory9800320000Phone of the customer placing the order
customer.first_nameStringSuggestedJeevanFirst name of the customer placing the order
customer.last_nameStringSuggestedB RLast name of the customer placing the order
line_items[*].nameStringSuggestedNavy Crew Neck T-Shirt - MFull name of the line item in the order (Product Name + Variant)
line_items[*].priceStringMandatory23.49Price of the line item in the order
line_items[*].product_idIntegerMandatory3891553173576Product ID of the line item in the order
line_items[*].quantityIntegerMandatory1Quantity of the line item in the order
line_items[*].titleStringMandatoryNavy Crew Neck T-ShirtProduct Title of the line item in the order
line_items[*].total_discountStringMandatory0.00Total discount applied on the line item in the order
line_items[*].variant_idIntegerMandatory29276034203720Variant ID of the line item in the order
line_items[*].variant_titleStringMandatoryMVariant Title of the line item in the order
shipping_address.cityStringMandatorySwampscottCity of the customer’s shipping address
shipping_address.zipStringMandatory01907Postal Code/ZIP of the customer’s shipping address
shipping_address.provinceStringMandatoryMassachusettsProvince/State of the customer’s shipping address
shipping_address.countryStringMandatoryUnited StatesCountry of the customer’s shipping address
discount_applications[*].target_selectionStringMandatoryPOSSIBLE VALUES:
all, entitled, explicitThe selection method for line items or shipping lines to be discounted
discount_applications[*].target_typeStringMandatoryPOSSIBLE VALUES:
line_item, shipping_lineThe type of item that the discount applies to
discount_applications[*].titleStringMandatorySUMMER10!The customer-facing name of the discount
discount_applications[*].total_allocated_amountStringMandatory2.51The total amount of the discount in the currency's subunit
discount_applications[*].typeStringMandatoryPOSSIBLE VALUES:
automatic, discount_code, manual, scriptThe type of the discount.
discount_applications[*].valueStringMandatory2.51The value of the discount.
discount_applications[*].value_typeStringMandatoryPOSSIBLE VALUES:
fixed_amount, percentageThe value type of the discount.
line_items[].discount_allocations[].amountStringMandatory2.51The amount of the discount for the particular line_item
line_items[].discount_allocations[].discount_applicationStringMandatorySUMMER10!The customer-facing name of the discount
  • For the orders_create and orders_paid events, created_at is a mandatory field
  • For the orders_updated, orders_fulfilled, orders_partially_fulfilled events, updated_at is a mandatory field
  • For the orders_cancelled event, cancelled_at is a mandatory field

line_items and discount_codes are Array of Objects and can have multiple objects within one array.

Example for multiple discount_codes (3 objects within discount_codes):

"discount_codes": [
    {
      "code": "SPRING30",
      "amount": "30.00",
      "type": "fixed_amount"
    },
		{
      "code": "SPRING10",
      "amount": "30.00",
      "type": "percentage"
    },
		{
      "code": "FLAT5",
      "amount": "5.00",
      "type": "fixed_amount"
    }
  ]

Example for multiple line_items (2 objects within line_items):

"line_items": [
        {
            "id": 14405811077192,
            "admin_graphql_api_id": "gid://shopify/LineItem/14405811077192",
            "attributed_staffs": [],
            "fulfillable_quantity": 1,
            "fulfillment_service": "manual",
            "fulfillment_status": null,
            "gift_card": false,
            "grams": 151,
            "name": "Navy Crew Neck T-Shirt - M",
            "pre_tax_price": "23.49",
            "pre_tax_price_set": {
                "shop_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                }
            },
            "price": "23.49",
            "price_set": {
                "shop_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                }
            },
            "product_exists": true,
            "product_id": 3891553173576,
            "properties": [],
            "quantity": 1,
            "requires_shipping": true,
            "sku": "LS4000NAVYM",
            "tax_code": "PC040100",
            "taxable": true,
            "title": "Navy Crew Neck T-Shirt",
            "total_discount": "0.00",
            "total_discount_set": {
                "shop_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                }
            },
            "variant_id": 29276034203720,
            "variant_inventory_management": "shopify",
            "variant_title": "M",
            "vendor": "Lifesight",
            "tax_lines": [
                {
                    "channel_liable": true,
                    "price": "0.00",
                    "price_set": {
                        "shop_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        },
                        "presentment_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        }
                    },
                    "rate": 0.0,
                    "title": "MASSACHUSETTS Sales and Use Tax"
                }
            ],
            "duties": [],
            "discount_allocations": []
        },
        {
            "id": 14405811077193,
            "admin_graphql_api_id": "gid://shopify/LineItem/14405811077193",
            "attributed_staffs": [],
            "fulfillable_quantity": 1,
            "fulfillment_service": "manual",
            "fulfillment_status": null,
            "gift_card": false,
            "grams": 151,
            "name": "Navy Crew Neck T-Shirt - L",
            "pre_tax_price": "24.49",
            "pre_tax_price_set": {
                "shop_money": {
                    "amount": "24.49",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "24.49",
                    "currency_code": "USD"
                }
            },
            "price": "24.49",
            "price_set": {
                "shop_money": {
                    "amount": "24.49",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "24.49",
                    "currency_code": "USD"
                }
            },
            "product_exists": true,
            "product_id": 3891553173576,
            "properties": [],
            "quantity": 1,
            "requires_shipping": true,
            "sku": "LS4000NAVYM",
            "tax_code": "PC040100",
            "taxable": true,
            "title": "Navy Crew Neck T-Shirt",
            "total_discount": "0.00",
            "total_discount_set": {
                "shop_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                }
            },
            "variant_id": 29276034203721,
            "variant_inventory_management": "shopify",
            "variant_title": "L",
            "vendor": "Lifesight",
            "tax_lines": [
                {
                    "channel_liable": true,
                    "price": "0.00",
                    "price_set": {
                        "shop_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        },
                        "presentment_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        }
                    },
                    "rate": 0.0,
                    "title": "MASSACHUSETTS Sales and Use Tax"
                }
            ],
            "duties": [],
            "discount_allocations": []
        }
    ]

Example Payload for Orders Object

{
    "id": 5766207635539,
    "admin_graphql_api_id": "gid://shopify/Order/5766207635539",
    "app_id": 2329312,
    "browser_ip": null,
    "buyer_accepts_marketing": true,
    "cancel_reason": null,
    "cancelled_at": null,
    "cart_token": null,
    "checkout_id": 40082301255752,
    "checkout_token": "f4a6496368e91080bf4bb0a809195f95",
    "client_details": {
        "accept_language": "",
        "browser_height": null,
        "browser_ip": null,
        "browser_width": null,
        "session_hash": null,
        "user_agent": ""
    },
    "closed_at": null,
    "company": null,
    "confirmation_number": "896997838783630,6790791201038369",
    "confirmed": true,
    "contact_email": "[email protected]",
    "created_at": "2023-11-19T06:04:57-08:00",
    "currency": "USD",
    "current_subtotal_price": "23.49",
    "current_subtotal_price_set": {
        "shop_money": {
            "amount": "23.49",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "23.49",
            "currency_code": "USD"
        }
    },
    "current_total_additional_fees_set": null,
    "current_total_discounts": "0.00",
    "current_total_discounts_set": {
        "shop_money": {
            "amount": "0.00",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "0.00",
            "currency_code": "USD"
        }
    },
    "current_total_duties_set": null,
    "current_total_price": "30.49",
    "current_total_price_set": {
        "shop_money": {
            "amount": "30.49",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "30.49",
            "currency_code": "USD"
        }
    },
    "current_total_tax": "0.00",
    "current_total_tax_set": {
        "shop_money": {
            "amount": "0.00",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "0.00",
            "currency_code": "USD"
        }
    },
    "customer_locale": "en",
    "device_id": null,
    "discount_codes": [],
    "email": "[email protected]",
    "estimated_taxes": false,
    "financial_status": "paid",
    "fulfillment_status": null,
    "landing_site": "/admin/api/2023-04/checkouts.json",
    "landing_site_ref": null,
    "location_id": null,
    "merchant_of_record_app_id": null,
    "name": "#5187793",
    "note": "",
    "note_attributes": [
        {
            "name": "Channel",
            "value": "Instagram"
        },
        {
            "name": "Facebook Order ID",
            "value": "896997838783630"
        }
    ],
    "number": 5186793,
    "order_number": 5187793,
    "order_status_url": "https://trueclassictees-com.myshopify.com/22040084552/orders/38f00dfd83b526b35c64b31b7495ecf2/authenticate?key=ea48f888fefe7bca7df3009a27234700",
    "original_total_additional_fees_set": null,
    "original_total_duties_set": null,
    "payment_gateway_names": [
        "shopify_payments",
        "manual"
    ],
    "phone": null,
    "po_number": null,
    "presentment_currency": "USD",
    "processed_at": "2023-11-19T06:04:57-08:00",
    "reference": null,
    "referring_site": null,
    "source_identifier": "896997838783630,6790791201038369",
    "source_name": "2329312",
    "source_url": null,
    "subtotal_price": "23.49",
    "subtotal_price_set": {
        "shop_money": {
            "amount": "23.49",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "23.49",
            "currency_code": "USD"
        }
    },
    "tags": "nofraud_pass",
    "tax_exempt": false,
    "tax_lines": [],
    "taxes_included": false,
    "test": false,
    "token": "38f00dfd83b526b35c64b31b7495ecf2",
    "total_discounts": "0.00",
    "total_discounts_set": {
        "shop_money": {
            "amount": "0.00",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "0.00",
            "currency_code": "USD"
        }
    },
    "total_line_items_price": "23.49",
    "total_line_items_price_set": {
        "shop_money": {
            "amount": "23.49",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "23.49",
            "currency_code": "USD"
        }
    },
    "total_outstanding": "0.00",
    "total_price": "30.49",
    "total_price_set": {
        "shop_money": {
            "amount": "30.49",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "30.49",
            "currency_code": "USD"
        }
    },
    "total_shipping_price_set": {
        "shop_money": {
            "amount": "7.00",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "7.00",
            "currency_code": "USD"
        }
    },
    "total_tax": "0.00",
    "total_tax_set": {
        "shop_money": {
            "amount": "0.00",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "0.00",
            "currency_code": "USD"
        }
    },
    "total_tip_received": "0.00",
    "total_weight": 150,
    "updated_at": "2023-11-19T06:06:18-08:00",
    "user_id": null,
    "billing_address": {
        "first_name": "Jeevan",
        "address1": "100 Pacific Ave",
        "phone": null,
        "city": "Swampscott",
        "zip": "01907",
        "province": "Massachusetts",
        "country": "United States",
        "last_name": "B R",
        "address2": "",
        "company": "",
        "latitude": 42.4704092,
        "longitude": -70.89442090000001,
        "name": "Jeevan B R",
        "country_code": "US",
        "province_code": "MA"
    },
    "customer": {
        "id": 6980745363528,
        "email": "[email protected]",
        "accepts_marketing": true,
        "created_at": "2023-11-19T06:04:35-08:00",
        "updated_at": "2023-11-19T06:06:21-08:00",
        "first_name": "Jeevan",
        "last_name": "B R",
        "state": "disabled",
        "note": null,
        "verified_email": true,
        "multipass_identifier": null,
        "tax_exempt": false,
        "phone": null,
        "email_marketing_consent": {
            "state": "subscribed",
            "opt_in_level": "single_opt_in",
            "consent_updated_at": "2023-11-19T06:04:35-08:00"
        },
        "sms_marketing_consent": null,
        "tags": "",
        "currency": "USD",
        "accepts_marketing_updated_at": "2023-11-19T06:04:35-08:00",
        "marketing_opt_in_level": "single_opt_in",
        "tax_exemptions": [],
        "admin_graphql_api_id": "gid://shopify/Customer/6980745363528",
        "default_address": {
            "id": 8798466113608,
            "customer_id": 6980745363528,
            "first_name": "Jeevan",
            "last_name": "B R",
            "company": "",
            "address1": "100 Pacific Ave",
            "address2": "",
            "city": "Swampscott",
            "province": "Massachusetts",
            "country": "United States",
            "zip": "01907",
            "phone": null,
            "name": "Jeevan B R",
            "province_code": "MA",
            "country_code": "US",
            "country_name": "United States",
            "default": true
        }
    },
    "discount_applications": [],
    "fulfillments": [],
    "line_items": [
        {
            "id": 14405811077192,
            "admin_graphql_api_id": "gid://shopify/LineItem/14405811077192",
            "attributed_staffs": [],
            "fulfillable_quantity": 1,
            "fulfillment_service": "manual",
            "fulfillment_status": null,
            "gift_card": false,
            "grams": 151,
            "name": "Navy Crew Neck T-Shirt - M",
            "pre_tax_price": "23.49",
            "pre_tax_price_set": {
                "shop_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                }
            },
            "price": "23.49",
            "price_set": {
                "shop_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                }
            },
            "product_exists": true,
            "product_id": 3891553173576,
            "properties": [],
            "quantity": 1,
            "requires_shipping": true,
            "sku": "LST4000NAVYM",
            "tax_code": "PC040100",
            "taxable": true,
            "title": "Navy Crew Neck T-Shirt",
            "total_discount": "0.00",
            "total_discount_set": {
                "shop_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                }
            },
            "variant_id": 29276034203720,
            "variant_inventory_management": "shopify",
            "variant_title": "M",
            "vendor": "Lifesight",
            "tax_lines": [
                {
                    "channel_liable": true,
                    "price": "0.00",
                    "price_set": {
                        "shop_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        },
                        "presentment_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        }
                    },
                    "rate": 0.0,
                    "title": "MASSACHUSETTS Sales and Use Tax"
                }
            ],
            "duties": [],
            "discount_allocations": []
        }
    ],
    "payment_terms": null,
    "refunds": [],
    "shipping_address": {
        "first_name": "Jeevan",
        "address1": "100 Pacific Ave",
        "phone": null,
        "city": "Swampscott",
        "zip": "01907",
        "province": "Massachusetts",
        "country": "United States",
        "last_name": "B R",
        "address2": "",
        "company": "",
        "latitude": 42.4704092,
        "longitude": -70.89442090000001,
        "name": "Jeevan B R",
        "country_code": "US",
        "province_code": "MA"
    },
    "shipping_lines": [
        {
            "id": 4904563769416,
            "carrier_identifier": null,
            "code": "Standard (2-9 Business Days)",
            "discounted_price": "7.00",
            "discounted_price_set": {
                "shop_money": {
                    "amount": "7.00",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "7.00",
                    "currency_code": "USD"
                }
            },
            "phone": null,
            "price": "7.00",
            "price_set": {
                "shop_money": {
                    "amount": "7.00",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "7.00",
                    "currency_code": "USD"
                }
            },
            "requested_fulfillment_service_id": null,
            "source": "shopify",
            "title": "Standard (2-9 Business Days)",
            "tax_lines": [
                {
                    "channel_liable": true,
                    "price": "0.00",
                    "price_set": {
                        "shop_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        },
                        "presentment_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        }
                    },
                    "rate": 0.0,
                    "title": "MASSACHUSETTS Sales and Use Tax"
                }
            ],
            "discount_allocations": []
        }
    ]
}

Example API Request

curl --location 'https://moda-transform-webhook-data-prd-7jirubb0.uc.gateway.dev/transform-webhook-data?key=AIzaSyCEeXcrMmdSQP_T82Ip-VckCpgSWplPjKI&workspace={{workspace}}&source={{source}}&event_name=orders_create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": 5766207635539,
    "admin_graphql_api_id": "gid://shopify/Order/5766207635539",
    "app_id": 2329312,
    "browser_ip": null,
    "buyer_accepts_marketing": true,
    "cancel_reason": null,
    "cancelled_at": null,
    "cart_token": null,
    "checkout_id": 40082301255752,
    "checkout_token": "f4a6496368e91080bf4bb0a809195f95",
    "client_details": {
        "accept_language": "",
        "browser_height": null,
        "browser_ip": null,
        "browser_width": null,
        "session_hash": null,
        "user_agent": ""
    },
    "closed_at": null,
    "company": null,
    "confirmation_number": "896997838783630,6790791201038369",
    "confirmed": true,
    "contact_email": "[email protected]",
    "created_at": "2023-11-19T06:04:57-08:00",
    "currency": "USD",
    "current_subtotal_price": "23.49",
    "current_subtotal_price_set": {
        "shop_money": {
            "amount": "23.49",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "23.49",
            "currency_code": "USD"
        }
    },
    "current_total_additional_fees_set": null,
    "current_total_discounts": "0.00",
    "current_total_discounts_set": {
        "shop_money": {
            "amount": "0.00",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "0.00",
            "currency_code": "USD"
        }
    },
    "current_total_duties_set": null,
    "current_total_price": "30.49",
    "current_total_price_set": {
        "shop_money": {
            "amount": "30.49",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "30.49",
            "currency_code": "USD"
        }
    },
    "current_total_tax": "0.00",
    "current_total_tax_set": {
        "shop_money": {
            "amount": "0.00",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "0.00",
            "currency_code": "USD"
        }
    },
    "customer_locale": "en",
    "device_id": null,
    "discount_codes": [],
    "email": "[email protected]",
    "estimated_taxes": false,
    "financial_status": "paid",
    "fulfillment_status": null,
    "landing_site": "/admin/api/2023-04/checkouts.json",
    "landing_site_ref": null,
    "location_id": null,
    "merchant_of_record_app_id": null,
    "name": "#5187793",
    "note": "",
    "note_attributes": [
        {
            "name": "Channel",
            "value": "Instagram"
        },
        {
            "name": "Facebook Order ID",
            "value": "896997838783630"
        }
    ],
    "number": 5186793,
    "order_number": 5187793,
    "order_status_url": "https://trueclassictees-com.myshopify.com/22040084552/orders/38f00dfd83b526b35c64b31b7495ecf2/authenticate?key=ea48f888fefe7bca7df3009a27234700",
    "original_total_additional_fees_set": null,
    "original_total_duties_set": null,
    "payment_gateway_names": [
        "shopify_payments",
        "manual"
    ],
    "phone": null,
    "po_number": null,
    "presentment_currency": "USD",
    "processed_at": "2023-11-19T06:04:57-08:00",
    "reference": null,
    "referring_site": null,
    "source_identifier": "896997838783630,6790791201038369",
    "source_name": "2329312",
    "source_url": null,
    "subtotal_price": "23.49",
    "subtotal_price_set": {
        "shop_money": {
            "amount": "23.49",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "23.49",
            "currency_code": "USD"
        }
    },
    "tags": "nofraud_pass",
    "tax_exempt": false,
    "tax_lines": [],
    "taxes_included": false,
    "test": false,
    "token": "38f00dfd83b526b35c64b31b7495ecf2",
    "total_discounts": "0.00",
    "total_discounts_set": {
        "shop_money": {
            "amount": "0.00",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "0.00",
            "currency_code": "USD"
        }
    },
    "total_line_items_price": "23.49",
    "total_line_items_price_set": {
        "shop_money": {
            "amount": "23.49",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "23.49",
            "currency_code": "USD"
        }
    },
    "total_outstanding": "0.00",
    "total_price": "30.49",
    "total_price_set": {
        "shop_money": {
            "amount": "30.49",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "30.49",
            "currency_code": "USD"
        }
    },
    "total_shipping_price_set": {
        "shop_money": {
            "amount": "7.00",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "7.00",
            "currency_code": "USD"
        }
    },
    "total_tax": "0.00",
    "total_tax_set": {
        "shop_money": {
            "amount": "0.00",
            "currency_code": "USD"
        },
        "presentment_money": {
            "amount": "0.00",
            "currency_code": "USD"
        }
    },
    "total_tip_received": "0.00",
    "total_weight": 150,
    "updated_at": "2023-11-19T06:06:18-08:00",
    "user_id": null,
    "billing_address": {
        "first_name": "Jeevan",
        "address1": "100 Pacific Ave",
        "phone": null,
        "city": "Swampscott",
        "zip": "01907",
        "province": "Massachusetts",
        "country": "United States",
        "last_name": "B R",
        "address2": "",
        "company": "",
        "latitude": 42.4704092,
        "longitude": -70.89442090000001,
        "name": "Jeevan B R",
        "country_code": "US",
        "province_code": "MA"
    },
    "customer": {
        "id": 6980745363528,
        "email": "[email protected]",
        "accepts_marketing": true,
        "created_at": "2023-11-19T06:04:35-08:00",
        "updated_at": "2023-11-19T06:06:21-08:00",
        "first_name": "Jeevan",
        "last_name": "B R",
        "state": "disabled",
        "note": null,
        "verified_email": true,
        "multipass_identifier": null,
        "tax_exempt": false,
        "phone": null,
        "email_marketing_consent": {
            "state": "subscribed",
            "opt_in_level": "single_opt_in",
            "consent_updated_at": "2023-11-19T06:04:35-08:00"
        },
        "sms_marketing_consent": null,
        "tags": "",
        "currency": "USD",
        "accepts_marketing_updated_at": "2023-11-19T06:04:35-08:00",
        "marketing_opt_in_level": "single_opt_in",
        "tax_exemptions": [],
        "admin_graphql_api_id": "gid://shopify/Customer/6980745363528",
        "default_address": {
            "id": 8798466113608,
            "customer_id": 6980745363528,
            "first_name": "Jeevan",
            "last_name": "B R",
            "company": "",
            "address1": "100 Pacific Ave",
            "address2": "",
            "city": "Swampscott",
            "province": "Massachusetts",
            "country": "United States",
            "zip": "01907",
            "phone": null,
            "name": "Jeevan B R",
            "province_code": "MA",
            "country_code": "US",
            "country_name": "United States",
            "default": true
        }
    },
    "discount_applications": [],
    "fulfillments": [],
    "line_items": [
        {
            "id": 14405811077192,
            "admin_graphql_api_id": "gid://shopify/LineItem/14405811077192",
            "attributed_staffs": [],
            "fulfillable_quantity": 1,
            "fulfillment_service": "manual",
            "fulfillment_status": null,
            "gift_card": false,
            "grams": 151,
            "name": "Navy Crew Neck T-Shirt - M",
            "pre_tax_price": "23.49",
            "pre_tax_price_set": {
                "shop_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                }
            },
            "price": "23.49",
            "price_set": {
                "shop_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "23.49",
                    "currency_code": "USD"
                }
            },
            "product_exists": true,
            "product_id": 3891553173576,
            "properties": [],
            "quantity": 1,
            "requires_shipping": true,
            "sku": "LST4000NAVYM",
            "tax_code": "PC040100",
            "taxable": true,
            "title": "Navy Crew Neck T-Shirt",
            "total_discount": "0.00",
            "total_discount_set": {
                "shop_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "0.00",
                    "currency_code": "USD"
                }
            },
            "variant_id": 29276034203720,
            "variant_inventory_management": "shopify",
            "variant_title": "M",
            "vendor": "Lifesight",
            "tax_lines": [
                {
                    "channel_liable": true,
                    "price": "0.00",
                    "price_set": {
                        "shop_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        },
                        "presentment_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        }
                    },
                    "rate": 0.0,
                    "title": "MASSACHUSETTS Sales and Use Tax"
                }
            ],
            "duties": [],
            "discount_allocations": []
        }
    ],
    "payment_terms": null,
    "refunds": [],
    "shipping_address": {
        "first_name": "Jeevan",
        "address1": "100 Pacific Ave",
        "phone": null,
        "city": "Swampscott",
        "zip": "01907",
        "province": "Massachusetts",
        "country": "United States",
        "last_name": "B R",
        "address2": "",
        "company": "",
        "latitude": 42.4704092,
        "longitude": -70.89442090000001,
        "name": "Jeevan B R",
        "country_code": "US",
        "province_code": "MA"
    },
    "shipping_lines": [
        {
            "id": 4904563769416,
            "carrier_identifier": null,
            "code": "Standard (2-9 Business Days)",
            "discounted_price": "7.00",
            "discounted_price_set": {
                "shop_money": {
                    "amount": "7.00",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "7.00",
                    "currency_code": "USD"
                }
            },
            "phone": null,
            "price": "7.00",
            "price_set": {
                "shop_money": {
                    "amount": "7.00",
                    "currency_code": "USD"
                },
                "presentment_money": {
                    "amount": "7.00",
                    "currency_code": "USD"
                }
            },
            "requested_fulfillment_service_id": null,
            "source": "shopify",
            "title": "Standard (2-9 Business Days)",
            "tax_lines": [
                {
                    "channel_liable": true,
                    "price": "0.00",
                    "price_set": {
                        "shop_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        },
                        "presentment_money": {
                            "amount": "0.00",
                            "currency_code": "USD"
                        }
                    },
                    "rate": 0.0,
                    "title": "MASSACHUSETTS Sales and Use Tax"
                }
            ],
            "discount_allocations": []
        }
    ]
}'

Checkouts

All checkout events would have the same payload structure. These events include checkouts_create and checkouts_update. The event to be sent is to be specified in the event_name query parameter in the API request.

Mandatory and Suggested Fields in the Checkouts Payload

FieldData TypeMandatory/SuggestedSample ValueDescription
idIntegerMandatory37112239489314ID of the Checkout
created_atString (Datetime)Mandatory2023-11-19T06:04:57-08:00The timestamp for when the checkout was placed
updated_atString (Datetime)Mandatory2023-11-19T06:04:57-08:00The timestamp for when the checkout was last updated
currencyStringMandatoryUSDCurrency
emailStringMandatory (if phone is not present)[email protected]Email of the customer creating the checkout
total_priceStringMandatory30.49Total Price of the checkout
subtotal_priceStringMandatory23.4This value is for the subtotal price of all the items in the order after both line-item and cart discounts have been applied. The subtotal doesn't include taxes (unless taxes are included in the prices), shipping costs, or tips.
discount_codes[*].codeStringSuggestedSPRING30Discount code applied in the checkout
discount_codes[*].amountStringSuggested30.00Discount amount in the checkout
discount_codes[*].typeStringSuggestedPOSSIBLE VALUES:
fixed_amount, percentage, shippingType of discount applied
phoneStringMandatory (if email is not present)9800320000Phone of the customer creating the checkout
referring_siteStringSuggestedlifesight.ioThe referring site that led to the checkout
line_items[*].nameStringSuggestedNavy Crew Neck T-Shirt - MFull name of the line item in the checkout (Product Name + Variant)
line_items[*].priceStringMandatory23.49Price of the line item in the checkout
line_items[*].product_idIntegerMandatory3891553173576Product ID of the line item in the checkout
line_items[*].quantityIntegerMandatory1Quantity of the line item in the checkout
line_items[*].titleStringMandatoryNavy Crew Neck T-ShirtProduct Title of the line item in the checkout
line_items[*].total_discountStringMandatory0.00Total discount applied on the line item in the checkout
line_items[*].variant_idIntegerMandatory29276034203720Variant ID of the line item in the checkout
line_items[*].variant_titleStringMandatoryMVariant Title of the line item in the checkout
shipping_address.cityStringMandatorySwampscottCity of the customer’s shipping address
shipping_address.zipStringMandatory01907Postal Code/ZIP of the customer’s shipping address
shipping_address.provinceStringMandatoryMassachusettsProvince/State of the customer’s shipping address
shipping_address.countryStringMandatoryUnited StatesCountry of the customer’s shipping address

Example Payload for Checkouts Object

{
    "id": 37112239489315,
    "token": "da4a9d115469c72cf166bfbe6c5313d1",
    "cart_token": "Z2NwLXVzLWNlbnRyYWwxOjAxSEdGRkRGQkZUQ0dXQ0gwRjJaWkFNTU1N",
    "email": "[email protected]",
    "gateway": null,
    "buyer_accepts_marketing": false,
    "buyer_accepts_sms_marketing": false,
    "sms_marketing_phone": null,
    "created_at": "2023-11-30T06:42:16+00:00",
    "updated_at": "2023-11-30T01:43:48-05:00",
    "landing_site": "/checkouts/cn/0c6778120e464ffcbd78a9d57126e046/thank_you",
    "note": "",
    "note_attributes":
    [],
    "referring_site": "https://moda-pixel-testing.myshopify.com/",
    "shipping_lines":
    [],
    "shipping_address":
    [],
    "taxes_included": false,
    "total_weight": 580,
    "currency": "SGD",
    "completed_at": null,
    "phone": null,
    "customer_locale": "en-SG",
    "line_items":
    [
        {
            "key": "45902754185506",
            "fulfillment_service": "manual",
            "gift_card": false,
            "grams": 580,
            "presentment_title": "Reddy Grey & Navy Ceramic & Bamboo Elevated Dog Double Diner",
            "presentment_variant_title": "",
            "product_id": 8448447512866,
            "quantity": 1,
            "requires_shipping": true,
            "sku": "Reddy-Bamboo-Bowl",
            "taxable": true,
            "title": "Reddy Grey & Navy Ceramic & Bamboo Elevated Dog Double Diner",
            "variant_id": 45902754185506,
            "variant_title": "",
            "variant_price": "23.99",
            "vendor": "Reddy",
            "unit_price_measurement":
            {
                "measured_type": null,
                "quantity_value": null,
                "quantity_unit": null,
                "reference_value": null,
                "reference_unit": null
            },
            "compare_at_price": "28.99",
            "line_price": "23.99",
            "price": "23.99",
            "applied_discounts":
            [],
            "destination_location_id": null,
            "user_id": null,
            "rank": null,
            "origin_location_id": null,
            "properties": null
        }
    ],
    "name": "#37112239489315",
    "abandoned_checkout_url": "https://moda-pixel-testing.myshopify.com/80371122466/checkouts/ac/Z2NwLXVzLWNlbnRyYWwxOjAxSEdGRkRGQkZUQ0dXQ0gwRjJaWkFNTU1N/recover?key=fb805739459d0254710146f3c92a610a",
    "discount_codes":
    [],
    "tax_lines":
    [
        {
            "price": "1.92",
            "rate": 0.08,
            "title": "GST"
        }
    ],
    "presentment_currency": "SGD",
    "source_name": "web",
    "total_line_items_price": "23.99",
    "total_tax": "1.92",
    "total_discounts": "0.00",
    "subtotal_price": "23.99",
    "total_price": "25.91",
    "total_duties": "0.00",
    "device_id": null,
    "user_id": null,
    "location_id": null,
    "source_identifier": null,
    "source_url": null,
    "source": null,
    "closed_at": null
}

Example API Request

curl --location 'https://moda-transform-webhook-data-prd-7jirubb0.uc.gateway.dev/transform-webhook-data?key=AIzaSyCEeXcrMmdSQP_T82Ip-VckCpgSWplPjKI&{{workspace}}&source={{source}}event_name=checkouts_create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": 37112239489315,
    "token": "da4a9d115469c72cf166bfbe6c5313d1",
    "cart_token": "Z2NwLXVzLWNlbnRyYWwxOjAxSEdGRkRGQkZUQ0dXQ0gwRjJaWkFNTU1N",
    "email": "[email protected]",
    "gateway": null,
    "buyer_accepts_marketing": false,
    "buyer_accepts_sms_marketing": false,
    "sms_marketing_phone": null,
    "created_at": "2023-11-30T06:42:16+00:00",
    "updated_at": "2023-11-30T01:43:48-05:00",
    "landing_site": "/checkouts/cn/0c6778120e464ffcbd78a9d57126e046/thank_you",
    "note": "",
    "note_attributes":
    [],
    "referring_site": "https://moda-pixel-testing.myshopify.com/",
    "shipping_lines":
    [],
    "shipping_address":
    [],
    "taxes_included": false,
    "total_weight": 580,
    "currency": "SGD",
    "completed_at": null,
    "phone": null,
    "customer_locale": "en-SG",
    "line_items":
    [
        {
            "key": "45902754185506",
            "fulfillment_service": "manual",
            "gift_card": false,
            "grams": 580,
            "presentment_title": "Reddy Grey & Navy Ceramic & Bamboo Elevated Dog Double Diner",
            "presentment_variant_title": "",
            "product_id": 8448447512866,
            "quantity": 1,
            "requires_shipping": true,
            "sku": "Reddy-Bamboo-Bowl",
            "taxable": true,
            "title": "Reddy Grey & Navy Ceramic & Bamboo Elevated Dog Double Diner",
            "variant_id": 45902754185506,
            "variant_title": "",
            "variant_price": "23.99",
            "vendor": "Reddy",
            "unit_price_measurement":
            {
                "measured_type": null,
                "quantity_value": null,
                "quantity_unit": null,
                "reference_value": null,
                "reference_unit": null
            },
            "compare_at_price": "28.99",
            "line_price": "23.99",
            "price": "23.99",
            "applied_discounts":
            [],
            "destination_location_id": null,
            "user_id": null,
            "rank": null,
            "origin_location_id": null,
            "properties": null
        }
    ],
    "name": "#37112239489315",
    "abandoned_checkout_url": "https://moda-pixel-testing.myshopify.com/80371122466/checkouts/ac/Z2NwLXVzLWNlbnRyYWwxOjAxSEdGRkRGQkZUQ0dXQ0gwRjJaWkFNTU1N/recover?key=fb805739459d0254710146f3c92a610a",
    "discount_codes":
    [],
    "tax_lines":
    [
        {
            "price": "1.92",
            "rate": 0.08,
            "title": "GST"
        }
    ],
    "presentment_currency": "SGD",
    "source_name": "web",
    "total_line_items_price": "23.99",
    "total_tax": "1.92",
    "total_discounts": "0.00",
    "subtotal_price": "23.99",
    "total_price": "25.91",
    "total_duties": "0.00",
    "device_id": null,
    "user_id": null,
    "location_id": null,
    "source_identifier": null,
    "source_url": null,
    "source": null,
    "closed_at": null
}'

Customers

All customer events would have the same payload structure. These events include customers_create and customers_update. The event to be sent is to be specified in the event_name query parameter in the API request.

Mandatory and Suggested Fields in the Customers Payload

FieldData TypeMandatory/SuggestedSample ValueDescription
idIntegerMandatory7677484597542ID of the Customer
created_atString (Datetime)Mandatory2023-11-19T06:04:57-08:00The timestamp for when the customer was created
updated_atString (Datetime)Mandatory2023-11-19T06:04:57-08:00The timestamp for when the customer was last updated
currencyStringSuggestedUSDCurrency
emailStringMandatory (if phone is not present)[email protected]Email of the customer
orders_countIntegerSuggested1Count of orders placed by the customer
total_spentStringSuggested10.00Total spent by the customer
tagsStringSuggestedLoyalCustomer tags
phoneStringMandatory (if email is not present)9800320000Phone of the customer

Example Payload for Customers Object

{
    "id": 7677484597543,
    "email": "[email protected]",
    "accepts_marketing": false,
    "created_at": "2023-12-01T06:44:57-05:00",
    "updated_at": "2023-12-01T06:44:57-05:00",
    "first_name": "Jeevan",
    "last_name": "B R",
    "orders_count": 0,
    "state": "enabled",
    "total_spent": "0.00",
    "last_order_id": null,
    "note": null,
    "verified_email": false,
    "multipass_identifier": null,
    "tax_exempt": false,
    "tags": "",
    "last_order_name": null,
    "currency": "SGD",
    "phone": null,
    "addresses":
    [
        {
            "id": 9881955336486,
            "customer_id": 7677484597543,
            "first_name": "Jeevan",
            "last_name": "h",
            "company": null,
            "address1": null,
            "address2": null,
            "city": "Singapore",
            "province": null,
            "country": "Singapore",
            "zip": null,
            "phone": null,
            "name": "Jeevan B R",
            "province_code": null,
            "country_code": "SG",
            "country_name": "Singapore",
            "default": true
        }
    ],
    "accepts_marketing_updated_at": "2023-12-01T06:44:57-05:00",
    "marketing_opt_in_level": null,
    "tax_exemptions":
    [],
    "email_marketing_consent":
    {
        "state": "not_subscribed",
        "opt_in_level": "single_opt_in",
        "consent_updated_at": null
    },
    "sms_marketing_consent": null,
    "admin_graphql_api_id": "gid://shopify/Customer/7677484597543",
    "default_address":
    {
        "id": 9881955336486,
        "customer_id": 7677484597543,
        "first_name": "Jeevan",
        "last_name": "B R",
        "company": null,
        "address1": null,
        "address2": null,
        "city": "Singapore",
        "province": null,
        "country": "Singapore",
        "zip": null,
        "phone": null,
        "name": "Jeevan B R",
        "province_code": null,
        "country_code": "SG",
        "country_name": "Singapore",
        "default": true
    }
}

Example API Request

curl --location 'https://moda-transform-webhook-data-prd-7jirubb0.uc.gateway.dev/transform-webhook-data?key=AIzaSyCEeXcrMmdSQP_T82Ip-VckCpgSWplPjKI&{{workspace}}&source={{source}}&event_name=customers_create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": 7677484597543,
    "email": "[email protected]",
    "accepts_marketing": false,
    "created_at": "2023-12-01T06:44:57-05:00",
    "updated_at": "2023-12-01T06:44:57-05:00",
    "first_name": "Jeevan",
    "last_name": "B R",
    "orders_count": 0,
    "state": "enabled",
    "total_spent": "0.00",
    "last_order_id": null,
    "note": null,
    "verified_email": false,
    "multipass_identifier": null,
    "tax_exempt": false,
    "tags": "",
    "last_order_name": null,
    "currency": "SGD",
    "phone": null,
    "addresses":
    [
        {
            "id": 9881955336486,
            "customer_id": 7677484597543,
            "first_name": "Jeevan",
            "last_name": "h",
            "company": null,
            "address1": null,
            "address2": null,
            "city": "Singapore",
            "province": null,
            "country": "Singapore",
            "zip": null,
            "phone": null,
            "name": "Jeevan B R",
            "province_code": null,
            "country_code": "SG",
            "country_name": "Singapore",
            "default": true
        }
    ],
    "accepts_marketing_updated_at": "2023-12-01T06:44:57-05:00",
    "marketing_opt_in_level": null,
    "tax_exemptions":
    [],
    "email_marketing_consent":
    {
        "state": "not_subscribed",
        "opt_in_level": "single_opt_in",
        "consent_updated_at": null
    },
    "sms_marketing_consent": null,
    "admin_graphql_api_id": "gid://shopify/Customer/7677484597543",
    "default_address":
    {
        "id": 9881955336486,
        "customer_id": 7677484597543,
        "first_name": "Jeevan",
        "last_name": "h",
        "company": null,
        "address1": null,
        "address2": null,
        "city": "Singapore",
        "province": null,
        "country": "Singapore",
        "zip": null,
        "phone": null,
        "name": "Jeevan B R",
        "province_code": null,
        "country_code": "SG",
        "country_name": "Singapore",
        "default": true
    }
}'