E-Commerce Event Objects
Every Content Block have some respective event objects that are required by the events to be used. These event objects can be referred to as item properties for that event or model/data classes that are required for that event. These objects provide a detailed context to the event about the element they are associated with.
List of Objects
Here's a list of objects that are required in core module events.
| Object Name | Usability | Description |
|---|---|---|
| Item Object | items | Track the items associated to e-commerce. |
Item Object
Before looking into the events that we have below, here is the following item object that will be used repeatedly in
our events below.
Format
| Param | Usability | Format | Enum Values | Description |
|---|---|---|---|---|
| <type>_id | REQUIRED | STRING | type:: drug, blood, oxygen, medical_equipment, grocery, facility, subscription, item_verification, item_report, reward, survey, other | Id of the Item in the event. |
| quantity | REQUIRED | FLOAT | --- | Quantity of the item. |
| price | REQUIRED | FLOAT | --- | Unit Price of the item. |
| currency | REQUIRED | STRING | --- | ISO provided currency code for the price and item. |
| stock_status | OPTIONAL | STRING | in_stock, low_stock, out_of_stock | Current stock status of the item. |
| promo_id | OPTIONAL | STRING | --- | Promo Id if any assigned to the item. |
| discount | OPTIONAL | FLOAT | --- | Discount percentage for the item i.e. 0.15 for 15% |
| facility_id | OPTIONAL | STRING | --- | facility Id if any available for the item. |
Usage
- Android (Java/Kotlin)
- iOS (Swift)
- React Native (JS/TS)
- Web Application (JS/TS)
- JSON
val itemModel = ItemModel(
id = "testItemId",
quantity = 10,
price = 1900F,
currency = CurrencyCode.USD.name,
type = ItemType.drug.name,
facility_id: "testFacilityId",
)
let itemModel = ItemModel(
id: "SomeItemIdVALUE",
type: ItemType.Drug,
quantity: 1,
price: 29.5,
currency: CurrencyCode.EUR
)
let itemDetail = {
id: "itemId",
type: ItemType.Drug,
quantity: 1,
price: 1.45,
currency: CurrencyCode.EUR,
stock_status: StockStatus.InStock,
promo_id: "testPromoId",
facility_id: "testFacilityId",
}
let itemDetail = {
id: "itemId",
type: ItemType.Drug,
quantity: 1,
price: 1.45,
currency: CurrencyCode.EUR,
stock_status: StockStatus.InStock,
promo_id: "testPromoId",
}
{
"item": {
"id": "TestItemId",
"type": "drug",
"quantity": 1,
"price": 200.0,
"currency": "EUR",
"promo_id": "",
"stock_status": "in_stock"
}
}