Appearance
Payload branch "engagements"
This branch contains a lot of sub-branches, referring to several entities that CAN be attached to a cart/checkout, both by an User action (ex. "user use a coupon") or automatically (current cart composition satisfy some "cart rule" conditions);
Basically every entity that is not described but every other branch viewed so far will be added to this branch.
Let's review an example:
js
{
"context": "...",
"event": "...",
"checkout_step": "...",
"attributes": {...},
"products": [...],
"carrier": {...},
"payment": {...},
"delivery": {...},
"billing": {...},
"user": {...},
"engagements": {
"campaign": {
"id": 1,
"name": "Test campaign",
"campaign_type": 4,
"network": null
},
"coupon": {
"code": "22WB00EYKPXPBS",
"cart_rule": {
"id": 274,
"name": "Simple discount 100"
}
},
"cart_rules": [
{
"id": 274,
"name": "Simple discount 100",
"reduction": "10.00"
},
{
"id": 275,
"name": "Test Offer x for y",
"reduction": "440.00"
}
],
"gift_option_selected": false,
"extra_service_selected": true,
"giftcard": {
"id": 2,
"name": "GIFT CARD 30 €",
"code": "R0VHWOMLJ8B9",
"customer_name": "FABIO POLITI",
"order_id": 128,
"product_id": 76029,
"amount": "30.00",
"original_amount": "30.00",
"expires_at": "2022-11-25 15:12:48"
},
"receipt": null,
"vouchers": [
{
"id": 27,
"code": "43D15D4E506F4",
"type": "discount_coupon",
"amount_type": "fixed",
"amount": "10.00"
}
]
}
}
Variables full details
Here you can find a detailed description of each variable or sub-branch:
Var | Type | Description |
---|---|---|
campaign | object/null | Internal "campaign" object, which will be defined if the User has entered via an URL containing a "campaign code" |
coupon | object/null | Internal "coupon" it is is valid and if it has been inserted by the User, along with the "Cart Rule" which holds the coupon code |
cart_rules | array<Object/null> | Every "Cart Rule" which has been attached to the current checkout |
gift_option_selected | bool | The user has choosed the option "This is a gift" |
extra_service_selected | bool | The user has choosed the extra option, for example "I request the engraving service" |
giftcard | object/null | Internal "Gift Card" if it is valid and if it has been inserted by the User |
receipt | string/null | In a B2B session it holds the 'receipt' attached by the shop's clerk |
vouchers | array<Object/null> | Every "Voucher" (external) which has been attached to the current checkout |
Object: "campaign"
This object holds informations about internal "campaign" object, which will be defined if the User has entered via an URL containing a "campaign code", and it is always defined with these variables:
Var | Type | Description |
---|---|---|
id | int | Internal campaign unique id (NOT cross-tenant) |
name | string/null | Campaign's name |
campaign_type | int | Internal campaign classification (cross-tenant) |
network | int/null | Internal campaign's network (cross-tenant) |
Object: "coupon"
This object holds informations about internal "coupon" it is is valid and if it has been inserted by the User, along with the "Cart Rule" which refers the coupon code, and it is always defined with these variables:
Var | Type | Description |
---|---|---|
code | string | Coupon code used |
cart_rule | object | "Cart Rule" attached to the coupon code |
Object: "cart_rule"
This object represents a "Cart rule", which is an entity created in Blade to handle "coupons", "gift" and a lot of different scenarios, and it is always defined with these variables:
Var | Type | Description |
---|---|---|
id | int | Internal rule unique id (NOT cross-tenant) |
name | string/null | Cart rule's name |
reduction | string/null | The reduction applied to the overall checout total |
Object: "giftcard"
This object represents a "GC", which is an entity created in Blade to handle gift cards that are special "purchasable" products, and it is always defined with these variables:
Var | Type | Description |
---|---|---|
id | int | Internal GC unique id (NOT cross-tenant) |
name | string/null | Product's name |
code | string | Internal GC unique code (cross-tenant) |
customer_name | string/null | The gift card's owner |
order_id | int/null | Internal order id (gift card's purchase) |
product_id | int/null | Internal product id (gift card's purchase) |
amount | string | Current GC's amount (credit) |
original_amount | string | Original GC's amount (credit) |
expires_at | datetime | GC's expiration date time |
Object: "voucher"
This object represents a "Voucher", which is an entity created in an external platform (CDP) to handle "discounts", and it is always defined with these variables:
Var | Type | Description |
---|---|---|
id | int | Internal voucher unique id (NOT cross-tenant) |
code | string | Internal voucher unique code (cross-tenant) |
type | string | Internal voucher type (cross-tenant); ex: "discount_coupon" or "voucher" |
amount_type | string | Internal voucher discount type (cross-tenant); ex: "fixed" or "percentage" |
amount | string | Current Voucher's amount (scoped to "amount_type") |