Skip to main content
Version: 1.3.0

Battle Test Event

A stress-test event exercising every nesting combination: oneOf/anyOf inside if/then/else, if/then/else inside oneOf/anyOf branches, nested conditionals inside conditionals, array items with all combos, and deeply nested objects.

DataLayer Examples

user_id options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

contact_method options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

shipping_class options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

payment options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

wallet_provider options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

fulfillment options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

pickup_time options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

discount options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

source options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

conditional options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

conditional options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

conditional options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

conditional options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

conditional options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

conditional options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

conditional options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

conditional options:

window.dataLayer.push({
"event": "checkout_complete",
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
"user": {
"account_type": "registered",
"user_id": "usr-abc-123",
"loyalty_tier": "gold",
"contact_method": {
"channel": "email",
"email_address": "user@example.com"
},
"preferences": {
"marketing_consent": true,
"frequency": "weekly",
"topics": [
"deals",
"new_arrivals"
]
}
},
"items": [
{
"item_type": "physical",
"name": "Wireless Headphones",
"price": 79.99,
"quantity": 2,
"weight_kg": 0.35,
"dimensions": {
"length": 20,
"width": 15,
"height": 8
},
"shipping_class": {
"class": "standard_parcel",
"estimated_days": 5
}
}
],
"payment": {
"currency": "USD",
"method": "credit_card",
"card_brand": "visa",
"last_four": "4242",
"cid": "1234"
},
"fulfillment": {
"type": "delivery",
"fulfillment_method": "home_delivery",
"address": {
"country": "US",
"city": "New York",
"street": "123 Main St",
"customs_declaration": {
"declared_value": 150,
"contents_description": "Electronics",
"hs_code": "8518.30"
}
}
},
"discount": {
"type": "percentage",
"value": 15
},
"metadata": {
"timestamp": "2026-02-24T12:00:00Z",
"source": {
"platform": "web",
"device_type": "desktop",
"browser": "Chrome",
"screen_width": 390,
"touch_capable": true
}
},
"tax": {
"rate": 0.0825,
"amount": 6.6,
"jurisdiction": "CA"
},
"recycling_fee": {
"applies": true,
"amount": 1.5
}
});

Event Properties

PropertyTypeConstraintsExamplesDescription
eventstringrequired
"checkout_complete"
The name of the event.
const: "checkout_complete"
$schemastringconst: "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json"
"https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json"
Schema validation URL.
{}userobjectrequiredUser information with conditional fields based on account type. Demonstrates: if/then/else with oneOf inside then branch, and nested if/then/else inside then branch.
account_typestringrequired
"registered"
Whether the user is a guest or registered.
enum: [guest, registered]

user_id - Select one of the following options:

The user's ID, which can be a string or integer.

A string-based user ID.

user_idstring
"usr-abc-123"
A string-based user ID.

A numeric user ID.

iThe properties below define the condition. When the condition is met, the “Then” branch applies. Otherwise, the “Else” branch applies.If
account_typeobjectrequired
"registered"
const: "registered"

Registered users have a loyalty tier, preferences, and a contact method choice.

loyalty_tierstringrequired
"gold"
The user's loyalty program tier.
enum: [bronze, silver, gold, platinum]
{}contact_methodobjectHow to reach the registered user — oneOf inside a then branch.

Select one of the following options:

Contact via email.

channelstringrequired
"email"
The contact channel identifier.
const: "email"
email_addressstringrequired
"user@example.com"
The user's email address.
format: email

Contact via SMS.

{}preferencesobjectUser notification preferences with nested if/then/else (if/then/else inside if/then).
marketing_consentbooleanrequired
true
Whether the user consented to marketing.
iThe properties below define the condition. When the condition is met, the “Then” branch applies. Otherwise, the “Else” branch applies.If
marketing_consentobjectrequired
true
const: true

Consenting users specify their preferred frequency.

frequencystringrequired
"weekly"
How often to send marketing messages.
enum: [daily, weekly, monthly]
topicsarray
[
"deals",
"new_arrivals"
]
Marketing topics of interest.

Non-consenting users only have an opt-out reason.

Guest users only have a session ID.

[]itemsarrayrequiredCart items with if/then/else in array items, and oneOf inside then/else branches.
minItems: 1
item_typestringrequired
"physical"
Whether this is a physical or digital item.
enum: [physical, digital]
namestringrequired
"Wireless Headphones"
Item name.
pricenumberrequired
79.99
Item price in the transaction currency.
minimum: 0
quantityintegerminimum: 1
2
1
Number of units.
default: 1
iThe properties below define the condition. When the condition is met, the “Then” branch applies. Otherwise, the “Else” branch applies.If
item_typeobjectrequired
"physical"
const: "physical"

Physical items have weight, dimensions, and a shipping class choice (oneOf inside then).

weight_kgnumberminimum: 0.01
0.35
Item weight in kilograms.
{}dimensionsobjectPackage dimensions in centimeters.
lengthnumber
20
Length in cm.
widthnumber
15
Width in cm.
heightnumber
8
Height in cm.
{}shipping_classobjectShipping classification — oneOf inside a then branch.

Select one of the following options:

Regular parcel shipping.

classstringrequired
"standard_parcel"
The shipping class identifier.
const: "standard_parcel"
estimated_daysintegerminimum: 1
5
Estimated delivery days.

Heavy/oversized freight shipping.

Digital items have a download URL and license type.

iThe properties below define the condition. When the condition is met, the “Then” branch applies. Otherwise, the “Else” branch applies.If
item_typeobjectrequired
"physical"
const: "physical"

Physical items have weight, dimensions, and a shipping class choice (oneOf inside then).

weight_kgnumberminimum: 0.01
0.35
Item weight in kilograms.
{}dimensionsobjectPackage dimensions in centimeters.
lengthnumber
20
Length in cm.
widthnumber
15
Width in cm.
heightnumber
8
Height in cm.
{}shipping_classobjectShipping classification — oneOf inside a then branch.

Select one of the following options:

Regular parcel shipping.

classstringrequired
"standard_parcel"
The shipping class identifier.
const: "standard_parcel"
estimated_daysintegerminimum: 1
5
Estimated delivery days.

Heavy/oversized freight shipping.

Digital items have a download URL and license type.

{}paymentobjectrequiredPayment details — anyOf with if/then/else inside one of the anyOf branches.
currencystringrequired
"USD"
ISO 4217 currency code.
pattern: /^[A-Z]{3}$/

Select any of the following options:

Payment details — anyOf with if/then/else inside one of the anyOf branches.

Payment by credit card — includes if/then/else based on card brand (if/then/else inside anyOf).

Payment by digital wallet.

Payment by bank transfer.

{}fulfillmentobjectrequiredFulfillment details — anyOf with different fulfillment types, some containing nested if/then/else.
typestringrequired
"delivery"
Fulfillment type.
enum: [delivery, pickup, digital]

Select any of the following options:

Fulfillment details — anyOf with different fulfillment types, some containing nested if/then/else.

Home delivery with if/then/else based on whether it's international.

In-store pickup.

Purely digital delivery.

{}discountobjectApplied discount — either a percentage or a fixed amount.

Select one of the following options:

A percentage-based discount.

typestringrequired
"percentage"
The discount type identifier.
const: "percentage"
valuenumberrequired
15
Discount percentage (0-100).
minimum: 0
maximum: 100

A fixed-amount discount.

{}metadataobjectEvent metadata with oneOf at property level, containing if/then/else inside one of the oneOf branches.
timestampstringformat: date-time
"2026-02-24T12:00:00Z"
When the event occurred.
{}sourceobjectWhere the event originated — oneOf with if/then/else inside a branch.

Select one of the following options:

Event from a web browser, with if/then/else based on device type.

platformstringrequired
"web"
The source platform identifier.
const: "web"
device_typestringrequired
"desktop"
The type of device.
enum: [desktop, mobile, tablet]
browserstring
"Chrome"
Browser name.
iThe properties below define the condition. When the condition is met, the “Then” branch applies. Otherwise, the “Else” branch applies.If
device_typeobjectrequired
"mobile"
const: "mobile"

Mobile web sessions include screen size and touch capability.

screen_widthinteger
390
Screen width in pixels.
touch_capableboolean
true
Whether the device supports touch.

Non-mobile web sessions include viewport dimensions.

Event from a native app.

iThe properties below define the condition. When the condition is met, the “Then” branch applies. Otherwise, the “Else” branch applies.If
{}paymentobject
currencyobjectconst: "USD"
"USD"
ISO 4217 currency code.

USD transactions require tax information. Demonstrates: if/then/else directly inside a then branch (if inside if).

{}taxobjectUS tax details.
ratenumberrequired
0.0825
Tax rate as a decimal (e.g. 0.0825 for 8.25%).
minimum: 0
maximum: 1
amountnumberrequired
6.6
Calculated tax amount.
minimum: 0
jurisdictionstring
"CA"
Tax jurisdiction (state).
iThe properties below define the condition. When the condition is met, the “Then” branch applies. Otherwise, the “Else” branch applies.If

Check if tax jurisdiction is California.

{}taxobject
jurisdictionobjectconst: "CA"
"CA"
Tax jurisdiction (state).

California transactions require additional recycling fee info (if/then/else directly inside a then branch).

{}recycling_feeobjectCalifornia recycling fee details.
appliesbooleanrequired
true
Whether a recycling fee applies.
amountnumberminimum: 0
1.5
Recycling fee amount.

Non-California USD transactions may include a state-specific exemption code.

Non-USD transactions may include a VAT number.

View Raw JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json",
  "title": "Battle Test Event",
  "description": "A stress-test event exercising every nesting combination: oneOf/anyOf inside if/then/else, if/then/else inside oneOf/anyOf branches, nested conditionals inside conditionals, array items with all combos, and deeply nested objects.",
  "x-tracking-targets": [
    "web-datalayer-js"
  ],
  "type": "object",
  "required": [
    "event",
    "user",
    "items",
    "payment",
    "fulfillment"
  ],
  "properties": {
    "$schema": {
      "type": "string",
      "description": "Schema validation URL.",
      "const": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/battle-test-event.json"
    },
    "event": {
      "type": "string",
      "const": "checkout_complete",
      "description": "The event name.",
      "examples": [
        "checkout_complete"
      ]
    },
    "user": {
      "type": "object",
      "description": "User information with conditional fields based on account type. Demonstrates: if/then/else with oneOf inside then branch, and nested if/then/else inside then branch.",
      "required": [
        "account_type"
      ],
      "properties": {
        "account_type": {
          "type": "string",
          "description": "Whether the user is a guest or registered.",
          "enum": [
            "guest",
            "registered"
          ],
          "examples": [
            "registered"
          ]
        },
        "user_id": {
          "description": "The user's ID, which can be a string or integer.",
          "oneOf": [
            {
              "title": "String ID",
              "type": "string",
              "description": "A string-based user ID.",
              "examples": [
                "usr-abc-123"
              ]
            },
            {
              "title": "Integer ID",
              "type": "integer",
              "description": "A numeric user ID.",
              "examples": [
                98765
              ]
            }
          ]
        }
      },
      "if": {
        "properties": {
          "account_type": {
            "const": "registered"
          }
        },
        "required": [
          "account_type"
        ]
      },
      "then": {
        "description": "Registered users have a loyalty tier, preferences, and a contact method choice.",
        "properties": {
          "loyalty_tier": {
            "type": "string",
            "description": "The user's loyalty program tier.",
            "enum": [
              "bronze",
              "silver",
              "gold",
              "platinum"
            ],
            "examples": [
              "gold"
            ]
          },
          "contact_method": {
            "description": "How to reach the registered user — oneOf inside a then branch.",
            "oneOf": [
              {
                "title": "Email Contact",
                "type": "object",
                "description": "Contact via email.",
                "properties": {
                  "channel": {
                    "type": "string",
                    "const": "email",
                    "description": "The contact channel identifier."
                  },
                  "email_address": {
                    "type": "string",
                    "format": "email",
                    "description": "The user's email address.",
                    "examples": [
                      "user@example.com"
                    ]
                  }
                },
                "required": [
                  "channel",
                  "email_address"
                ]
              },
              {
                "title": "SMS Contact",
                "type": "object",
                "description": "Contact via SMS.",
                "properties": {
                  "channel": {
                    "type": "string",
                    "const": "sms",
                    "description": "The contact channel identifier."
                  },
                  "phone_number": {
                    "type": "string",
                    "description": "The user's phone number.",
                    "pattern": "^\\+[0-9]{10,15}$",
                    "examples": [
                      "+1234567890"
                    ]
                  }
                },
                "required": [
                  "channel",
                  "phone_number"
                ]
              }
            ]
          },
          "preferences": {
            "type": "object",
            "description": "User notification preferences with nested if/then/else (if/then/else inside if/then).",
            "required": [
              "marketing_consent"
            ],
            "properties": {
              "marketing_consent": {
                "type": "boolean",
                "description": "Whether the user consented to marketing.",
                "examples": [
                  true
                ]
              }
            },
            "if": {
              "properties": {
                "marketing_consent": {
                  "const": true
                }
              },
              "required": [
                "marketing_consent"
              ]
            },
            "then": {
              "description": "Consenting users specify their preferred frequency.",
              "properties": {
                "frequency": {
                  "type": "string",
                  "description": "How often to send marketing messages.",
                  "enum": [
                    "daily",
                    "weekly",
                    "monthly"
                  ],
                  "examples": [
                    "weekly"
                  ]
                },
                "topics": {
                  "type": "array",
                  "description": "Marketing topics of interest.",
                  "items": {
                    "type": "string"
                  },
                  "examples": [
                    [
                      "deals",
                      "new_arrivals"
                    ]
                  ]
                }
              },
              "required": [
                "frequency"
              ]
            },
            "else": {
              "description": "Non-consenting users only have an opt-out reason.",
              "properties": {
                "opt_out_reason": {
                  "type": "string",
                  "description": "Why the user declined marketing.",
                  "examples": [
                    "too_many_emails"
                  ]
                }
              }
            }
          }
        },
        "required": [
          "loyalty_tier"
        ]
      },
      "else": {
        "description": "Guest users only have a session ID.",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Temporary session identifier for guest users.",
            "examples": [
              "sess-xyz-789"
            ]
          }
        },
        "required": [
          "session_id"
        ]
      }
    },
    "items": {
      "type": "array",
      "description": "Cart items with if/then/else in array items, and oneOf inside then/else branches.",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "item_type",
          "name",
          "price"
        ],
        "properties": {
          "item_type": {
            "type": "string",
            "description": "Whether this is a physical or digital item.",
            "enum": [
              "physical",
              "digital"
            ],
            "examples": [
              "physical"
            ]
          },
          "name": {
            "type": "string",
            "description": "Item name.",
            "examples": [
              "Wireless Headphones"
            ]
          },
          "price": {
            "type": "number",
            "description": "Item price in the transaction currency.",
            "minimum": 0,
            "examples": [
              79.99
            ]
          },
          "quantity": {
            "type": "integer",
            "description": "Number of units.",
            "minimum": 1,
            "default": 1,
            "examples": [
              2
            ]
          }
        },
        "if": {
          "properties": {
            "item_type": {
              "const": "physical"
            }
          },
          "required": [
            "item_type"
          ]
        },
        "then": {
          "description": "Physical items have weight, dimensions, and a shipping class choice (oneOf inside then).",
          "properties": {
            "weight_kg": {
              "type": "number",
              "description": "Item weight in kilograms.",
              "minimum": 0.01,
              "examples": [
                0.35
              ]
            },
            "dimensions": {
              "type": "object",
              "description": "Package dimensions in centimeters.",
              "properties": {
                "length": {
                  "type": "number",
                  "description": "Length in cm.",
                  "examples": [
                    20
                  ]
                },
                "width": {
                  "type": "number",
                  "description": "Width in cm.",
                  "examples": [
                    15
                  ]
                },
                "height": {
                  "type": "number",
                  "description": "Height in cm.",
                  "examples": [
                    8
                  ]
                }
              }
            },
            "shipping_class": {
              "description": "Shipping classification — oneOf inside a then branch.",
              "oneOf": [
                {
                  "title": "Standard Parcel",
                  "type": "object",
                  "description": "Regular parcel shipping.",
                  "properties": {
                    "class": {
                      "type": "string",
                      "const": "standard_parcel",
                      "description": "The shipping class identifier."
                    },
                    "estimated_days": {
                      "type": "integer",
                      "description": "Estimated delivery days.",
                      "minimum": 1,
                      "examples": [
                        5
                      ]
                    }
                  },
                  "required": [
                    "class"
                  ]
                },
                {
                  "title": "Freight",
                  "type": "object",
                  "description": "Heavy/oversized freight shipping.",
                  "properties": {
                    "class": {
                      "type": "string",
                      "const": "freight",
                      "description": "The shipping class identifier."
                    },
                    "requires_signature": {
                      "type": "boolean",
                      "description": "Whether delivery requires a signature.",
                      "examples": [
                        true
                      ]
                    },
                    "pallet_count": {
                      "type": "integer",
                      "description": "Number of pallets.",
                      "minimum": 1,
                      "examples": [
                        1
                      ]
                    }
                  },
                  "required": [
                    "class",
                    "requires_signature"
                  ]
                }
              ]
            }
          }
        },
        "else": {
          "description": "Digital items have a download URL and license type.",
          "properties": {
            "download_url": {
              "type": "string",
              "format": "uri",
              "description": "URL to download the digital item.",
              "examples": [
                "https://example.com/download/abc"
              ]
            },
            "license_type": {
              "type": "string",
              "description": "License model for the digital item.",
              "enum": [
                "single-use",
                "perpetual",
                "subscription"
              ],
              "examples": [
                "perpetual"
              ]
            }
          }
        }
      }
    },
    "payment": {
      "type": "object",
      "description": "Payment details — anyOf with if/then/else inside one of the anyOf branches.",
      "required": [
        "currency"
      ],
      "properties": {
        "currency": {
          "type": "string",
          "description": "ISO 4217 currency code.",
          "pattern": "^[A-Z]{3}$",
          "examples": [
            "USD"
          ]
        }
      },
      "anyOf": [
        {
          "title": "Credit Card",
          "description": "Payment by credit card — includes if/then/else based on card brand (if/then/else inside anyOf).",
          "properties": {
            "method": {
              "type": "string",
              "const": "credit_card",
              "description": "The payment method identifier."
            },
            "card_brand": {
              "type": "string",
              "description": "Card network.",
              "enum": [
                "visa",
                "mastercard",
                "amex"
              ],
              "examples": [
                "visa"
              ]
            },
            "last_four": {
              "type": "string",
              "description": "Last four digits of the card.",
              "pattern": "^[0-9]{4}$",
              "examples": [
                "4242"
              ]
            }
          },
          "required": [
            "method",
            "card_brand",
            "last_four"
          ],
          "if": {
            "properties": {
              "card_brand": {
                "const": "amex"
              }
            },
            "required": [
              "card_brand"
            ]
          },
          "then": {
            "description": "Amex cards require a CID (4-digit security code).",
            "properties": {
              "cid": {
                "type": "string",
                "description": "4-digit Card Identification Number for Amex.",
                "pattern": "^[0-9]{4}$",
                "examples": [
                  "1234"
                ]
              }
            },
            "required": [
              "cid"
            ]
          },
          "else": {
            "description": "Non-Amex cards use a 3-digit CVV.",
            "properties": {
              "cvv": {
                "type": "string",
                "description": "3-digit Card Verification Value.",
                "pattern": "^[0-9]{3}$",
                "examples": [
                  "123"
                ]
              }
            }
          }
        },
        {
          "title": "Digital Wallet",
          "description": "Payment by digital wallet.",
          "properties": {
            "method": {
              "type": "string",
              "const": "digital_wallet",
              "description": "The payment method identifier."
            },
            "wallet_provider": {
              "description": "The wallet provider, either a known name or a custom string.",
              "oneOf": [
                {
                  "title": "Known Provider",
                  "type": "string",
                  "enum": [
                    "apple_pay",
                    "google_pay",
                    "paypal"
                  ],
                  "examples": [
                    "apple_pay"
                  ]
                },
                {
                  "title": "Custom Provider",
                  "type": "string",
                  "pattern": "^custom_",
                  "description": "A custom wallet provider prefixed with 'custom_'.",
                  "examples": [
                    "custom_klarna"
                  ]
                }
              ]
            },
            "wallet_email": {
              "type": "string",
              "format": "email",
              "description": "Email linked to the wallet account.",
              "examples": [
                "user@example.com"
              ]
            }
          },
          "required": [
            "method",
            "wallet_provider"
          ]
        },
        {
          "title": "Bank Transfer",
          "description": "Payment by bank transfer.",
          "properties": {
            "method": {
              "type": "string",
              "const": "bank_transfer",
              "description": "The payment method identifier."
            },
            "bank_name": {
              "type": "string",
              "description": "Name of the bank.",
              "examples": [
                "First National Bank"
              ]
            },
            "reference_id": {
              "type": "string",
              "description": "Transfer reference number.",
              "examples": [
                "TXN-2026-001"
              ]
            }
          },
          "required": [
            "method",
            "bank_name",
            "reference_id"
          ]
        }
      ]
    },
    "fulfillment": {
      "type": "object",
      "description": "Fulfillment details — anyOf with different fulfillment types, some containing nested if/then/else.",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Fulfillment type.",
          "enum": [
            "delivery",
            "pickup",
            "digital"
          ],
          "examples": [
            "delivery"
          ]
        }
      },
      "anyOf": [
        {
          "title": "Home Delivery",
          "description": "Home delivery with if/then/else based on whether it's international.",
          "properties": {
            "fulfillment_method": {
              "type": "string",
              "const": "home_delivery",
              "description": "The fulfillment method identifier."
            },
            "address": {
              "type": "object",
              "description": "Delivery address.",
              "required": [
                "country",
                "city"
              ],
              "properties": {
                "country": {
                  "type": "string",
                  "description": "ISO 3166-1 alpha-2 country code.",
                  "examples": [
                    "US"
                  ]
                },
                "city": {
                  "type": "string",
                  "description": "City name.",
                  "examples": [
                    "New York"
                  ]
                },
                "street": {
                  "type": "string",
                  "description": "Street address.",
                  "examples": [
                    "123 Main St"
                  ]
                }
              },
              "if": {
                "properties": {
                  "country": {
                    "not": {
                      "const": "US"
                    }
                  }
                },
                "required": [
                  "country"
                ]
              },
              "then": {
                "description": "International addresses require a customs declaration.",
                "properties": {
                  "customs_declaration": {
                    "type": "object",
                    "description": "Customs information for international shipments.",
                    "properties": {
                      "declared_value": {
                        "type": "number",
                        "description": "Declared value for customs.",
                        "examples": [
                          150
                        ]
                      },
                      "contents_description": {
                        "type": "string",
                        "description": "Description of package contents.",
                        "examples": [
                          "Electronics"
                        ]
                      },
                      "hs_code": {
                        "type": "string",
                        "description": "Harmonized System tariff code.",
                        "examples": [
                          "8518.30"
                        ]
                      }
                    },
                    "required": [
                      "declared_value",
                      "contents_description"
                    ]
                  }
                },
                "required": [
                  "customs_declaration"
                ]
              },
              "else": {
                "description": "Domestic US addresses may include a ZIP+4.",
                "properties": {
                  "zip_plus_four": {
                    "type": "string",
                    "description": "Extended ZIP code.",
                    "pattern": "^[0-9]{5}-[0-9]{4}$",
                    "examples": [
                      "10001-1234"
                    ]
                  }
                }
              }
            }
          },
          "required": [
            "fulfillment_method",
            "address"
          ]
        },
        {
          "title": "Store Pickup",
          "description": "In-store pickup.",
          "properties": {
            "fulfillment_method": {
              "type": "string",
              "const": "store_pickup",
              "description": "The fulfillment method identifier."
            },
            "store_id": {
              "type": "string",
              "description": "ID of the pickup store.",
              "examples": [
                "STORE-42"
              ]
            },
            "pickup_time": {
              "description": "When to pick up — anyOf inside an anyOf branch.",
              "anyOf": [
                {
                  "title": "Scheduled Time",
                  "type": "object",
                  "description": "A specific scheduled pickup time.",
                  "properties": {
                    "slot_type": {
                      "type": "string",
                      "const": "scheduled",
                      "description": "The pickup slot type identifier."
                    },
                    "datetime": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Scheduled pickup date and time.",
                      "examples": [
                        "2026-03-15T14:00:00Z"
                      ]
                    }
                  },
                  "required": [
                    "slot_type",
                    "datetime"
                  ]
                },
                {
                  "title": "ASAP Pickup",
                  "type": "object",
                  "description": "Pick up as soon as possible.",
                  "properties": {
                    "slot_type": {
                      "type": "string",
                      "const": "asap",
                      "description": "The pickup slot type identifier."
                    },
                    "estimated_ready_minutes": {
                      "type": "integer",
                      "description": "Estimated minutes until ready.",
                      "minimum": 5,
                      "examples": [
                        30
                      ]
                    }
                  },
                  "required": [
                    "slot_type"
                  ]
                }
              ]
            }
          },
          "required": [
            "fulfillment_method",
            "store_id"
          ]
        },
        {
          "title": "Digital Fulfillment",
          "description": "Purely digital delivery.",
          "properties": {
            "fulfillment_method": {
              "type": "string",
              "const": "digital",
              "description": "The fulfillment method identifier."
            },
            "delivery_email": {
              "type": "string",
              "format": "email",
              "description": "Email to send digital items to.",
              "examples": [
                "buyer@example.com"
              ]
            }
          },
          "required": [
            "fulfillment_method",
            "delivery_email"
          ]
        }
      ]
    },
    "discount": {
      "description": "Applied discount — either a percentage or a fixed amount.",
      "oneOf": [
        {
          "title": "Percentage Discount",
          "type": "object",
          "description": "A percentage-based discount.",
          "properties": {
            "type": {
              "type": "string",
              "const": "percentage",
              "description": "The discount type identifier."
            },
            "value": {
              "type": "number",
              "description": "Discount percentage (0-100).",
              "minimum": 0,
              "maximum": 100,
              "examples": [
                15
              ]
            }
          },
          "required": [
            "type",
            "value"
          ]
        },
        {
          "title": "Fixed Discount",
          "type": "object",
          "description": "A fixed-amount discount.",
          "properties": {
            "type": {
              "type": "string",
              "const": "fixed",
              "description": "The discount type identifier."
            },
            "amount": {
              "type": "number",
              "description": "Discount amount in the transaction currency.",
              "minimum": 0,
              "examples": [
                10
              ]
            }
          },
          "required": [
            "type",
            "amount"
          ]
        }
      ]
    },
    "metadata": {
      "type": "object",
      "description": "Event metadata with oneOf at property level, containing if/then/else inside one of the oneOf branches.",
      "properties": {
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "When the event occurred.",
          "examples": [
            "2026-02-24T12:00:00Z"
          ]
        },
        "source": {
          "description": "Where the event originated — oneOf with if/then/else inside a branch.",
          "oneOf": [
            {
              "title": "Web Source",
              "type": "object",
              "description": "Event from a web browser, with if/then/else based on device type.",
              "required": [
                "platform",
                "device_type"
              ],
              "properties": {
                "platform": {
                  "type": "string",
                  "const": "web",
                  "description": "The source platform identifier."
                },
                "device_type": {
                  "type": "string",
                  "description": "The type of device.",
                  "enum": [
                    "desktop",
                    "mobile",
                    "tablet"
                  ],
                  "examples": [
                    "desktop"
                  ]
                },
                "browser": {
                  "type": "string",
                  "description": "Browser name.",
                  "examples": [
                    "Chrome"
                  ]
                }
              },
              "if": {
                "properties": {
                  "device_type": {
                    "const": "mobile"
                  }
                },
                "required": [
                  "device_type"
                ]
              },
              "then": {
                "description": "Mobile web sessions include screen size and touch capability.",
                "properties": {
                  "screen_width": {
                    "type": "integer",
                    "description": "Screen width in pixels.",
                    "examples": [
                      390
                    ]
                  },
                  "touch_capable": {
                    "type": "boolean",
                    "description": "Whether the device supports touch.",
                    "examples": [
                      true
                    ]
                  }
                }
              },
              "else": {
                "description": "Non-mobile web sessions include viewport dimensions.",
                "properties": {
                  "viewport_width": {
                    "type": "integer",
                    "description": "Browser viewport width in pixels.",
                    "examples": [
                      1920
                    ]
                  },
                  "viewport_height": {
                    "type": "integer",
                    "description": "Browser viewport height in pixels.",
                    "examples": [
                      1080
                    ]
                  }
                }
              }
            },
            {
              "title": "App Source",
              "type": "object",
              "description": "Event from a native app.",
              "required": [
                "platform",
                "app_version"
              ],
              "properties": {
                "platform": {
                  "type": "string",
                  "const": "app",
                  "description": "The source platform identifier."
                },
                "app_version": {
                  "type": "string",
                  "description": "Semantic version of the app.",
                  "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
                  "examples": [
                    "3.2.1"
                  ]
                },
                "os": {
                  "type": "string",
                  "description": "Operating system.",
                  "enum": [
                    "ios",
                    "android"
                  ],
                  "examples": [
                    "ios"
                  ]
                }
              }
            }
          ]
        }
      }
    }
  },
  "if": {
    "properties": {
      "payment": {
        "properties": {
          "currency": {
            "const": "USD",
            "description": "ISO 4217 currency code."
          }
        }
      }
    }
  },
  "then": {
    "description": "USD transactions require tax information. Demonstrates: if/then/else directly inside a then branch (if inside if).",
    "properties": {
      "tax": {
        "type": "object",
        "description": "US tax details.",
        "properties": {
          "rate": {
            "type": "number",
            "description": "Tax rate as a decimal (e.g. 0.0825 for 8.25%).",
            "minimum": 0,
            "maximum": 1,
            "examples": [
              0.0825
            ]
          },
          "amount": {
            "type": "number",
            "description": "Calculated tax amount.",
            "minimum": 0,
            "examples": [
              6.6
            ]
          },
          "jurisdiction": {
            "type": "string",
            "description": "Tax jurisdiction (state).",
            "examples": [
              "CA"
            ]
          }
        },
        "required": [
          "rate",
          "amount"
        ]
      }
    },
    "if": {
      "description": "Check if tax jurisdiction is California.",
      "properties": {
        "tax": {
          "properties": {
            "jurisdiction": {
              "const": "CA",
              "description": "Tax jurisdiction (state)."
            }
          }
        }
      }
    },
    "then": {
      "description": "California transactions require additional recycling fee info (if/then/else directly inside a then branch).",
      "properties": {
        "recycling_fee": {
          "type": "object",
          "description": "California recycling fee details.",
          "properties": {
            "applies": {
              "type": "boolean",
              "description": "Whether a recycling fee applies.",
              "examples": [
                true
              ]
            },
            "amount": {
              "type": "number",
              "description": "Recycling fee amount.",
              "minimum": 0,
              "examples": [
                1.5
              ]
            }
          },
          "required": [
            "applies"
          ]
        }
      }
    },
    "else": {
      "description": "Non-California USD transactions may include a state-specific exemption code.",
      "properties": {
        "state_exemption_code": {
          "type": "string",
          "description": "State-specific tax exemption code.",
          "examples": [
            "TX-EXEMPT-001"
          ]
        }
      }
    }
  },
  "else": {
    "description": "Non-USD transactions may include a VAT number.",
    "properties": {
      "vat_number": {
        "type": "string",
        "description": "EU VAT identification number.",
        "pattern": "^[A-Z]{2}[0-9A-Z]+$",
        "examples": [
          "DE123456789"
        ]
      }
    }
  }
}