{"openapi":"3.0.3","info":{"title":"Acosta Group - Trade Promotion Optimization (TPO) API","description":"API documentation for the Post Event Analysis (PEA) module of the multi-tenant Trade Promotion Optimization SaaS.\nThis specification models the data structures required to populate the PEA Summary Screen Dashboard.\n","version":"1.0.0"},"servers":[{"url":"https://api.tpo-saas.com/v1","description":"Production Server"},{"url":"https://api.dev.tpo-saas.com/v1","description":"Development Server"}],"paths":{"/pea/summary":{"get":{"summary":"Retrieve Post Event Analysis Summary Metrics","description":"Returns aggregated sales, volume, promotional effectiveness, intensity, price metrics, and distribution coverage based on user filters.","parameters":[{"name":"channels","in":"query","description":"Filter by distribution channels (e.g., Grocery, Mass, Drug)","required":false,"schema":{"type":"array","items":{"type":"string"},"example":["Grocery"]}},{"name":"regions","in":"query","description":"Filter by geographic regions","required":false,"schema":{"type":"array","items":{"type":"string"},"example":["Southeast"]}},{"name":"markets","in":"query","description":"Filter by key markets/territories","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"retailers","in":"query","description":"Filter by specific retail chains (e.g., Walmart, Kroger)","required":false,"schema":{"type":"array","items":{"type":"string"},"example":["Kroger"]}},{"name":"salesPersons","in":"query","description":"Filter by account managers / sales persons","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"categories","in":"query","description":"Filter by product categories","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"brands","in":"query","description":"Filter by product brands","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"ppgs","in":"query","description":"Filter by Product Pricing Groups (PPGs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"promotions","in":"query","description":"Filter by specific promotion identifiers","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"timePeriod","in":"query","description":"Synced syndicated data period filter","required":false,"schema":{"type":"string","enum":["C13W","C26W","CYTD","CUSTOM"],"default":"C13W"}},{"name":"customStartDate","in":"query","description":"Start date for custom time period (YYYY-MM-DD)","required":false,"schema":{"type":"string","format":"date"}},{"name":"customEndDate","in":"query","description":"End date for custom time period (YYYY-MM-DD)","required":false,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Successfully retrieved the PEA Summary dashboard metrics.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeaSummaryResponse"}}}},"400":{"description":"Invalid filter parameters provided."},"401":{"description":"Unauthorized. Tenant authentication token is missing or invalid."},"500":{"description":"Internal server error."}}}}},"components":{"schemas":{"MetricValue":{"type":"object","description":"Standardized KPI container matching UI cards, including labels, raw value, formatted value, and YoY performance.","required":["value","label","subLabel"],"properties":{"value":{"type":"number","description":"Raw numeric value of the metric.","example":10600000},"formattedValue":{"type":"string","description":"Human-readable formatted string displayed on the UI.","example":"$10.6M"},"label":{"type":"string","description":"The main name/title of the metric.","example":"Total Sales Value"},"subLabel":{"type":"string","description":"The secondary/helper label of the metric.","example":"$ Sales"},"yoyChange":{"type":"number","description":"Raw YoY change percentage.","example":6.8},"formattedYoyChange":{"type":"string","description":"Pre-formatted YoY change label with color sign.","example":"+6.8% YoY"}}},"PeaSummaryResponse":{"type":"object","required":["salesAndVolume","promoEffectiveness","roiVsIncrementality","promoIntensity","priceMetrics","promotionDistribution"],"properties":{"salesAndVolume":{"type":"object","description":"Card metrics for the 'Sales & Volume' dashboard section.","properties":{"totalSalesValue":{"$ref":"#/components/schemas/MetricValue"},"totalUnitsSold":{"$ref":"#/components/schemas/MetricValue"},"totalSalesVolume":{"$ref":"#/components/schemas/MetricValue"},"promotionalSalesValue":{"$ref":"#/components/schemas/MetricValue"},"baseSalesValue":{"$ref":"#/components/schemas/MetricValue"},"promotionalSalesVolume":{"$ref":"#/components/schemas/MetricValue"},"baseSalesVolume":{"$ref":"#/components/schemas/MetricValue"},"averageSellingPrice":{"$ref":"#/components/schemas/MetricValue"}},"example":{"totalSalesValue":{"value":10600000,"formattedValue":"$10.6M","label":"Total Sales Value","subLabel":"$ Sales","yoyChange":6.8,"formattedYoyChange":"+6.8% YoY"},"totalUnitsSold":{"value":2600000,"formattedValue":"2.6M","label":"Total Units Sold","subLabel":"Total Units Value","yoyChange":3.5,"formattedYoyChange":"+3.5% YoY"},"totalSalesVolume":{"value":98,"formattedValue":"98","label":"Total Sales Volume","subLabel":"Volume","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"promotionalSalesValue":{"value":2100000,"formattedValue":"$2.1M","label":"Promotional Sales Value","subLabel":"Any Promo $","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"baseSalesValue":{"value":7800000,"formattedValue":"$7.8M","label":"Base Sales Value","subLabel":"No Promo $","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"promotionalSalesVolume":{"value":11100000,"formattedValue":"11.1M","label":"Promotional Sales Volume","subLabel":"Any Promo Units","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"baseSalesVolume":{"value":2100000,"formattedValue":"2.1M","label":"Base Sales Volume","subLabel":"No Promo Units","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"averageSellingPrice":{"value":4.05,"formattedValue":"$4.05","label":"Average Selling Price","subLabel":"Avg Unit Price","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"}}},"promoEffectiveness":{"type":"object","description":"Card metrics for the 'Promo Effectiveness' section.","properties":{"incrementalSalesVolume":{"$ref":"#/components/schemas/MetricValue"},"salesLift":{"$ref":"#/components/schemas/MetricValue"},"netIncrementalSales":{"$ref":"#/components/schemas/MetricValue"},"netSalesLift":{"$ref":"#/components/schemas/MetricValue"},"netIncrementalRevenue":{"$ref":"#/components/schemas/MetricValue"},"estimatedPromoRoi":{"$ref":"#/components/schemas/MetricValue"},"spendVsBudget":{"$ref":"#/components/schemas/MetricValue"}},"example":{"incrementalSalesVolume":{"value":9300000,"formattedValue":"9.3M","label":"Inc. Sales Vol.","subLabel":"Incremental Volume (Lift)","yoyChange":6.8,"formattedYoyChange":"+6.8% YoY"},"salesLift":{"value":9.4,"formattedValue":"9.4%","label":"Sales Lift","subLabel":"Incremental Volume","yoyChange":6.8,"formattedYoyChange":"+6.8% YoY"},"netIncrementalSales":{"value":9300000,"formattedValue":"9.3M","label":"Net Inc.Sales","subLabel":"True Incremental Volume","yoyChange":6.8,"formattedYoyChange":"+6.8% YoY"},"netSalesLift":{"value":5200000,"formattedValue":"$5.2M","label":"Net Sales Lift","subLabel":"True Incremental Volume","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"netIncrementalRevenue":{"value":20800000,"formattedValue":"$20.8M","label":"Net Inc. Revenue","subLabel":"True Incremental Revenue","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"estimatedPromoRoi":{"value":1.2,"formattedValue":"1.2","label":"Est. Promo ROI","subLabel":"Not Mentioned","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"spendVsBudget":{"value":-3000000,"formattedValue":"-$3M","label":"Spend vs Budget","subLabel":"Not Mentioned","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"}}},"roiVsIncrementality":{"type":"object","description":"Metrics comparing Est. ROI with True Net Incrementality.","properties":{"highRoiHighInc":{"$ref":"#/components/schemas/MetricValue"},"lowRoiLowInc":{"$ref":"#/components/schemas/MetricValue"}},"example":{"highRoiHighInc":{"value":25,"formattedValue":"25%","label":"High ROI/ High Inc.","subLabel":"Not Mentioned","yoyChange":6.8,"formattedYoyChange":"+6.8% YoY"},"lowRoiLowInc":{"value":18,"formattedValue":"18%","label":"Low ROI/ Low Inc.","subLabel":"Not Mentioned","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"}}},"promoIntensity":{"type":"object","description":"Card metrics for the 'Promo Intensity' section.","properties":{"promotedVolume":{"$ref":"#/components/schemas/MetricValue"},"weeksOfPromotion":{"$ref":"#/components/schemas/MetricValue"},"depthOfDiscount":{"$ref":"#/components/schemas/MetricValue"}},"example":{"promotedVolume":{"value":43.4,"formattedValue":"43.4%","label":"Promoted Volume","subLabel":"Promoted Volume %","yoyChange":6.8,"formattedYoyChange":"+6.8% YoY"},"weeksOfPromotion":{"value":32,"formattedValue":"32","label":"Weeks of Promotion","subLabel":"Promotion Count","yoyChange":3,"formattedYoyChange":"+3 YoY"},"depthOfDiscount":{"value":45.3,"formattedValue":"45.3%","label":"Depth of Discount","subLabel":"Average Discount Depth (POS)","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"}}},"priceMetrics":{"type":"object","description":"Card metrics for the 'Price Metrics' section.","properties":{"averagePromotionalPrice":{"$ref":"#/components/schemas/MetricValue"},"regularShelfPrice":{"$ref":"#/components/schemas/MetricValue"},"basePrice":{"$ref":"#/components/schemas/MetricValue"},"promoPrice":{"$ref":"#/components/schemas/MetricValue"},"overallPrice":{"$ref":"#/components/schemas/MetricValue"}},"example":{"averagePromotionalPrice":{"value":99,"formattedValue":"99","label":"Average Promotional Price","subLabel":"Any Promo Unit Price","yoyChange":6.8,"formattedYoyChange":"+6.8% YoY"},"regularShelfPrice":{"value":96,"formattedValue":"96","label":"Regular Shelf Price","subLabel":"No Promo Unit Price","yoyChange":3.5,"formattedYoyChange":"+3.5% YoY"},"basePrice":{"value":4.5,"formattedValue":"$4.50","label":"Base Price","subLabel":"Workshop Addition","yoyChange":0.06,"formattedYoyChange":"+$0.06 YoY"},"promoPrice":{"value":4.1,"formattedValue":"$4.10","label":"Promo Price","subLabel":"Workshop Addition","yoyChange":0.06,"formattedYoyChange":"+$0.06 YoY"},"overallPrice":{"value":4.18,"formattedValue":"$4.18","label":"Overall Price","subLabel":"Workshop Addition","yoyChange":0.06,"formattedYoyChange":"+$0.06 YoY"}}},"promotionDistribution":{"type":"object","description":"Card metrics for the 'Promotion Distribution' ACV (All Commodity Volume) section.","properties":{"overallPromotionCoverage":{"$ref":"#/components/schemas/MetricValue"},"priceDiscountAvailability":{"$ref":"#/components/schemas/MetricValue"},"displayDistribution":{"$ref":"#/components/schemas/MetricValue"},"featureVisibility":{"$ref":"#/components/schemas/MetricValue"},"featureDisplaySupport":{"$ref":"#/components/schemas/MetricValue"},"featureOnlySupport":{"$ref":"#/components/schemas/MetricValue"},"displayOnlyCoverage":{"$ref":"#/components/schemas/MetricValue"},"priceDiscountOnlyCoverage":{"$ref":"#/components/schemas/MetricValue"}},"example":{"overallPromotionCoverage":{"value":25,"formattedValue":"25%","label":"Overall Promotion Coverage","subLabel":"Any Promo %ACV","yoyChange":6.8,"formattedYoyChange":"+6.8% YoY"},"priceDiscountAvailability":{"value":17,"formattedValue":"17%","label":"Price Discount Availability","subLabel":"Any Price Decr %ACV","yoyChange":3.5,"formattedYoyChange":"+3.5% YoY"},"displayDistribution":{"value":8,"formattedValue":"8%","label":"Display Distribution","subLabel":"Any Disp %ACV","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"featureVisibility":{"value":5,"formattedValue":"5%","label":"Feature Visibility","subLabel":"Any Feat %ACV","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"featureDisplaySupport":{"value":5,"formattedValue":"5%","label":"Feature + Display Support","subLabel":"Feat & Disp %ACV","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"featureOnlySupport":{"value":2,"formattedValue":"2%","label":"Feature Only Support","subLabel":"Feat w/o Disp %ACV","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"displayOnlyCoverage":{"value":4,"formattedValue":"4%","label":"Display Only Coverage","subLabel":"Disp w/o Feat %ACV","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"},"priceDiscountOnlyCoverage":{"value":15,"formattedValue":"15%","label":"Price Discount Only Coverage","subLabel":"Price Decr Only %ACV","yoyChange":5.2,"formattedYoyChange":"+5.2% YoY"}}}}}}}}