STRUCTURED PROMPTING

JSON Prompts for D2C Ecommerce

Use JSON prompting when you need repeatable structure, machine-readable outputs, consistent fields, or prompts that may later sit inside automation or agent workflows.

Important: JSON does not automatically make a prompt better. Use it when structure matters.

JSON Prompt Anatomy

RoleWho is the AI?
GoalWhat outcome?
InputWhat approved data?
RulesWhat must it follow?
SchemaWhat should it return?
GuardrailsWhen to stop?

Practical D2C JSON Examples

Conversion

Cart Recovery Campaign JSON

Recover abandoned carts while protecting margin.

Example D2C input
{
  "customer_segment": "Returning customer",
  "cart_value_inr": 74999,
  "abandonment_minutes": 42,
  "inventory_status": "In stock",
  "discount_eligibility": "5% max",
  "consent": {
    "email": true,
    "whatsapp": true
  }
}
JSON prompt
{
  "role": "You are a D2C cart recovery strategist.",
  "goal": "Recommend the best next action.",
  "rules": [
    "Use only supplied data.",
    "Protect margin.",
    "Return NEEDS_REVIEW when required data is missing."
  ],
  "output_schema": {
    "decision": "SEND_MESSAGE | OFFER_DISCOUNT | WAIT | NEEDS_REVIEW",
    "channel": "email | whatsapp | none",
    "message": "string",
    "timing_minutes": "number",
    "reasoning": "string",
    "primary_kpi": "string"
  }
}
Payment

Payment Failure RCA JSON

Structure payment-failure investigation.

Example D2C input
{
  "time_window": "Last 2 hours",
  "payment_attempts": 4200,
  "failure_rate_pct": 18.4,
  "baseline_failure_rate_pct": 6.2,
  "recent_release": true,
  "gateway_status": "Intermittent latency"
}
JSON prompt
{
  "role": "You are a D2C payments incident analyst.",
  "goal": "Prioritise hypotheses without inventing evidence.",
  "required_analysis": [
    "quantify deviation",
    "segment by payment method",
    "check release correlation",
    "check gateway health",
    "estimate customer and revenue risk"
  ],
  "guardrails": [
    "Do not claim root cause without evidence.",
    "Do not trigger financial actions."
  ],
  "output_schema": {
    "severity": "P1 | P2 | P3",
    "top_hypotheses": [
      "string"
    ],
    "evidence_needed": [
      "string"
    ],
    "safe_actions": [
      "string"
    ],
    "human_decision_required": [
      "string"
    ]
  }
}
Customer Service

Return Eligibility Agent JSON

Ground a return decision in approved policy.

Example D2C input
{
  "category": "Television",
  "delivery_days_ago": 6,
  "reason": "Damaged on arrival",
  "evidence": [
    "photo_front.jpg",
    "photo_box.jpg"
  ],
  "policy_version": "2026-08",
  "high_value_order": true
}
JSON prompt
{
  "role": "You are a return eligibility assistant.",
  "goal": "Assess the case using supplied policy context only.",
  "steps": [
    "validate policy version",
    "check category window",
    "check reason eligibility",
    "check evidence completeness",
    "flag high-value approval"
  ],
  "output_schema": {
    "eligibility": "ELIGIBLE | NOT_ELIGIBLE | REVIEW",
    "missing_information": [
      "string"
    ],
    "policy_reason": "string",
    "next_step": "string",
    "human_approval": true
  }
}
Operations

Inventory Risk Monitor JSON

Detect overselling or stock-out risk.

Example D2C input
{
  "sku": "SKU-EXAMPLE-101",
  "atp": 32,
  "hourly_sales_velocity": 11.8,
  "inbound_units": 100,
  "inbound_eta_hours": 8,
  "active_campaign": true,
  "traffic_multiplier": 2.4
}
JSON prompt
{
  "role": "You are a D2C inventory risk monitor.",
  "goal": "Estimate near-term inventory risk.",
  "rules": [
    "Use supplied ATP and velocity only.",
    "Do not change inventory records."
  ],
  "output_schema": {
    "risk": "LOW | MEDIUM | HIGH | CRITICAL",
    "estimated_stockout_hours": "number | null",
    "recommended_actions": [
      "string"
    ],
    "owner": "string",
    "confidence": "LOW | MEDIUM | HIGH"
  }
}
VOC

VOC Issue Detection JSON

Turn complaints into incident-ready structured output.

Example D2C input
{
  "complaints": [
    "Coupon applied but price changed at payment.",
    "Offer disappeared after checkout refresh.",
    "Promo code says eligible but gives error."
  ],
  "release_in_last_24h": true,
  "campaign_live": true
}
JSON prompt
{
  "role": "You are a Voice of Customer incident analyst.",
  "goal": "Cluster complaints and detect incident signal.",
  "output_schema": {
    "themes": [
      {
        "theme": "string",
        "count": "number",
        "severity": "LOW | MEDIUM | HIGH"
      }
    ],
    "possible_journey_stage": "string",
    "incident_signal": "YES | NO | REVIEW",
    "evidence_to_collect": [
      "string"
    ],
    "recommended_owner": "string"
  }
}
Sales

Product Advisor JSON

Recommend products from explicit needs.

Example D2C input
{
  "budget_inr": 50000,
  "priority": [
    "camera",
    "battery"
  ],
  "screen_preference": "6.1 to 6.7 inch",
  "must_have": [
    "5G"
  ],
  "catalogue_source": "approved product feed"
}
JSON prompt
{
  "role": "You are a D2C product advisor.",
  "goal": "Recommend up to three best-fit products from supplied catalogue data.",
  "guardrails": [
    "Never invent specifications.",
    "Clearly state trade-offs.",
    "Do not recommend out-of-stock products."
  ],
  "output_schema": {
    "recommendations": [
      {
        "product": "string",
        "why_fit": [
          "string"
        ],
        "tradeoffs": [
          "string"
        ],
        "price_inr": "number"
      }
    ],
    "questions_if_needed": [
      "string"
    ]
  }
}
Technology

D2C Release Readiness JSON

Convert release evidence into a controlled review.

Example D2C input
{
  "features": [
    "New coupon stacking rule",
    "Checkout UI update"
  ],
  "critical_tests_passed": 94,
  "critical_tests_total": 96,
  "open_severity1": 0,
  "open_severity2": 2,
  "rollback_plan": true,
  "monitoring_ready": true
}
JSON prompt
{
  "role": "You are a D2C release readiness copilot.",
  "goal": "Assess evidence and identify blockers; never approve production autonomously.",
  "output_schema": {
    "readiness": "READY_FOR_REVIEW | BLOCKED | CONDITIONAL",
    "blockers": [
      "string"
    ],
    "conditions": [
      "string"
    ],
    "monitoring_checks": [
      "string"
    ],
    "human_approvers": [
      "string"
    ]
  }
}
Leadership

Weekly D2C Executive Review JSON

Create a consistent decision-focused weekly review.

Example D2C input
{
  "revenue_change_pct": 7.2,
  "conversion_change_pct": -1.4,
  "payment_failure_change_pp": 2.1,
  "delivery_sla_pct": 92.3,
  "return_rate_pct": 4.7,
  "top_incident": "Mobile checkout latency"
}
JSON prompt
{
  "role": "You are a D2C business review copilot.",
  "goal": "Create a decision-focused weekly review.",
  "output_schema": {
    "headline": "string",
    "wins": [
      "string"
    ],
    "risks": [
      "string"
    ],
    "root_causes_to_validate": [
      "string"
    ],
    "decisions_required": [
      "string"
    ],
    "owners": [
      "string"
    ],
    "next_week_focus": [
      "string"
    ]
  }
}
Promotion

Coupon Eligibility JSON

Explain coupon eligibility and failure reasons without inventing rules.

Example D2C input
{
  "coupon": "WELCOME10",
  "cart_value_inr": 42000,
  "customer_type": "new",
  "eligible_categories": [
    "Mobile",
    "Tablet"
  ],
  "cart_categories": [
    "Mobile"
  ],
  "other_offer_applied": true
}
JSON prompt
{
  "role": "You are a D2C promotion eligibility assistant.",
  "goal": "Evaluate the supplied coupon context and explain the result.",
  "guardrails": [
    "Use supplied rules only.",
    "Do not create discounts.",
    "Flag conflicting offer rules for review."
  ],
  "output_schema": {
    "status": "ELIGIBLE | NOT_ELIGIBLE | REVIEW",
    "reason": "string",
    "conflicts": [
      "string"
    ],
    "customer_message": "string",
    "next_step": "string"
  }
}
Logistics

Delivery Delay Triage JSON

Prioritise delayed orders and recommend customer-safe next actions.

Example D2C input
{
  "order_age_days": 5,
  "promised_days": 3,
  "carrier_scan_age_hours": 30,
  "customer_contact_count": 2,
  "order_value_inr": 68000
}
JSON prompt
{
  "role": "You are a D2C delivery exception assistant.",
  "goal": "Classify delay risk and recommend next steps.",
  "output_schema": {
    "risk": "LOW | MEDIUM | HIGH",
    "likely_stage": "string",
    "evidence_needed": [
      "string"
    ],
    "customer_update": "string",
    "operations_action": "string",
    "escalate": true
  }
}
Finance Operations

Refund Reconciliation JSON

Identify refund mismatches across commerce and payment records.

Example D2C input
{
  "order_status": "Returned",
  "refund_requested_inr": 24999,
  "commerce_refund_status": "Processed",
  "gateway_refund_status": "Pending",
  "days_since_request": 4
}
JSON prompt
{
  "role": "You are a D2C refund reconciliation analyst.",
  "goal": "Identify the mismatch and propose safe investigation steps.",
  "guardrails": [
    "Do not initiate or duplicate refunds.",
    "Do not assume gateway completion."
  ],
  "output_schema": {
    "mismatch": "string",
    "risk": "LOW | MEDIUM | HIGH",
    "checks": [
      "string"
    ],
    "owner": "string",
    "customer_message": "string"
  }
}
Merchandising

Price & Offer QA JSON

Check price and promotion presentation before a campaign goes live.

Example D2C input
{
  "mrp": 79999,
  "selling_price": 74999,
  "coupon_discount": 5000,
  "bank_offer": 3000,
  "exchange_bonus": 4000,
  "stacking_rule": "coupon + bank allowed"
}
JSON prompt
{
  "role": "You are a D2C pricing QA copilot.",
  "goal": "Validate arithmetic, stacking logic and customer-facing clarity.",
  "output_schema": {
    "display_price": "number",
    "potential_savings": "number",
    "issues": [
      "string"
    ],
    "tests_to_run": [
      "string"
    ],
    "release_blocker": "YES | NO | REVIEW"
  }
}
Marketing

Campaign Performance JSON

Turn campaign metrics into actionable insights.

Example D2C input
{
  "sessions": 180000,
  "orders": 5400,
  "revenue_inr": 162000000,
  "media_spend_inr": 8500000,
  "baseline_conversion_pct": 3.4,
  "campaign_conversion_pct": 3.0
}
JSON prompt
{
  "role": "You are a D2C campaign performance analyst.",
  "goal": "Explain performance changes and identify evidence-backed next actions.",
  "output_schema": {
    "summary": "string",
    "conversion_change_pp": "number",
    "signals": [
      "string"
    ],
    "hypotheses_to_test": [
      "string"
    ],
    "recommended_actions": [
      "string"
    ],
    "kpis_to_watch": [
      "string"
    ]
  }
}
Discovery

Search Zero-Result JSON

Analyse zero-result search queries and merchandising opportunities.

Example D2C input
{
  "queries": [
    {
      "query": "wireless charger 45w",
      "searches": 840,
      "zero_results": 620
    },
    {
      "query": "phone under 30k",
      "searches": 1500,
      "zero_results": 110
    }
  ]
}
JSON prompt
{
  "role": "You are an ecommerce search optimisation analyst.",
  "goal": "Prioritise zero-result search issues.",
  "output_schema": {
    "priorities": [
      {
        "query": "string",
        "severity": "LOW | MEDIUM | HIGH",
        "possible_fix": [
          "string"
        ]
      }
    ],
    "taxonomy_actions": [
      "string"
    ],
    "synonym_actions": [
      "string"
    ],
    "content_actions": [
      "string"
    ]
  }
}
Personalisation

Personalisation Decision JSON

Select a bounded next-best experience using consented signals.

Example D2C input
{
  "segment": "Premium returning",
  "recent_categories": [
    "Mobile",
    "Wearables"
  ],
  "last_purchase_days": 210,
  "consent_personalisation": true,
  "current_page": "Mobile PDP"
}
JSON prompt
{
  "role": "You are a D2C personalisation assistant.",
  "goal": "Recommend a relevant next-best experience.",
  "guardrails": [
    "Use consented data only.",
    "Avoid sensitive inference.",
    "Do not fabricate offers."
  ],
  "output_schema": {
    "experience": "string",
    "reason": "string",
    "content_modules": [
      "string"
    ],
    "offer_required": "YES | NO",
    "measurement_kpi": "string"
  }
}
Risk

Fraud Review Support JSON

Summarise order risk signals for human review without autonomously rejecting customers.

Example D2C input
{
  "order_value_inr": 120000,
  "billing_shipping_match": false,
  "failed_payment_attempts": 4,
  "account_age_days": 2,
  "risk_engine_score": 78
}
JSON prompt
{
  "role": "You are an order-risk review copilot.",
  "goal": "Summarise supplied risk signals for an authorised reviewer.",
  "guardrails": [
    "Never accuse the customer of fraud.",
    "Never cancel an order.",
    "Do not infer protected or sensitive traits."
  ],
  "output_schema": {
    "risk_band": "LOW | MEDIUM | HIGH",
    "signals": [
      "string"
    ],
    "verification_options": [
      "string"
    ],
    "human_review_required": true
  }
}
Strategy

Marketplace vs D2C Comparison JSON

Compare channel performance with consistent commercial metrics.

Example D2C input
{
  "d2c": {
    "revenue_inr": 85000000,
    "gross_margin_pct": 24,
    "return_rate_pct": 4.2
  },
  "marketplace": {
    "revenue_inr": 110000000,
    "gross_margin_pct": 17,
    "return_rate_pct": 6.8
  }
}
JSON prompt
{
  "role": "You are a commerce strategy analyst.",
  "goal": "Compare channels without assuming revenue alone determines value.",
  "output_schema": {
    "comparison": [
      "string"
    ],
    "advantages_d2c": [
      "string"
    ],
    "advantages_marketplace": [
      "string"
    ],
    "risks": [
      "string"
    ],
    "decisions_to_explore": [
      "string"
    ]
  }
}
CRM

Customer Churn Signal JSON

Identify retention signals and propose non-intrusive interventions.

Example D2C input
{
  "orders_last_12m": 5,
  "days_since_last_order": 150,
  "previous_avg_gap_days": 55,
  "cs_contacts_last_90d": 3,
  "marketing_consent": true
}
JSON prompt
{
  "role": "You are a D2C retention analyst.",
  "goal": "Assess churn risk using only supplied behavioural data.",
  "guardrails": [
    "Do not infer personal circumstances.",
    "Respect channel consent."
  ],
  "output_schema": {
    "risk": "LOW | MEDIUM | HIGH",
    "signals": [
      "string"
    ],
    "recommended_interventions": [
      "string"
    ],
    "channel": "string",
    "success_kpi": "string"
  }
}
Experimentation

A/B Test Design JSON

Design a measurable ecommerce experiment.

Example D2C input
{
  "page": "Checkout",
  "problem": "Drop-off after delivery selection",
  "baseline_conversion_pct": 42.5,
  "hypothesis": "Simplifying delivery options will reduce cognitive load"
}
JSON prompt
{
  "role": "You are a D2C experimentation specialist.",
  "goal": "Turn the supplied hypothesis into a test plan.",
  "output_schema": {
    "hypothesis": "string",
    "control": "string",
    "variant": "string",
    "primary_metric": "string",
    "guardrail_metrics": [
      "string"
    ],
    "segments": [
      "string"
    ],
    "risks": [
      "string"
    ],
    "decision_rule": "string"
  }
}
Agentic AI

Agent Evaluation JSON

Evaluate an ecommerce AI agent before broader rollout.

Example D2C input
{
  "agent": "Customer Service Order Assistant",
  "test_cases": 120,
  "task_success_pct": 91,
  "unsupported_claim_rate_pct": 1.8,
  "escalation_accuracy_pct": 94,
  "tool_error_rate_pct": 2.5
}
JSON prompt
{
  "role": "You are an AI agent evaluator.",
  "goal": "Assess readiness using quality, safety and operational evidence.",
  "output_schema": {
    "readiness": "PILOT | IMPROVE | STOP",
    "strengths": [
      "string"
    ],
    "failure_modes": [
      "string"
    ],
    "required_tests": [
      "string"
    ],
    "guardrail_improvements": [
      "string"
    ],
    "human_signoff": [
      "string"
    ]
  }
}