Skip to content

Latest commit

 

History

History
302 lines (225 loc) · 10 KB

File metadata and controls

302 lines (225 loc) · 10 KB

Case Study: A Transport Company

How Real-Time Fuel Price Alerts Saved $50,000/Year

Company Background

Industry: Transport & Logistics Size: 50-100 employees Operations: 500+ daily transport jobs across multiple routes Primary Challenge: Fuel costs represent 40% of operating expenses

The Problem

Manual Price Checking Was Costing Money

Before implementing OilPriceAPI's Salesforce integration, the transport company faced several challenges:

  1. Time-Consuming Manual Checks

    • Dispatchers manually checked diesel prices 3-4 times/day
    • 30 minutes daily × 5 dispatchers = 2.5 hours wasted
    • Annual cost: $15,000 in dispatcher time
  2. Missed Opportunities

    • Prices changed between manual checks
    • Couldn't react quickly to price spikes
    • Lost 10-15% savings on strategic fuel purchases
  3. Inaccurate Job Costing

    • Fuel costs estimated using yesterday's prices
    • Job profitability calculations were 5-10% off
    • Difficult to adjust pricing for customers in real-time
  4. Delayed Decision Making

    • No real-time visibility into fuel cost impact on active jobs
    • Decisions to defer or expedite shipments were made hours too late
    • Missed $50-100/day in route optimization savings

The Solution

Automated Salesforce Alerts

the customer implemented the OilPriceAPI webhook integration with custom threshold alerts:

Alert Configuration:

{
  "name": "Diesel Price Alert - High Threshold",
  "commodity_code": "DIESEL_USD",
  "condition_operator": "greater_than",
  "condition_value": 3.50,
  "webhook_url": "https://tylertransport.force.com/services/apexrest/oilpriceapi/webhook",
  "metadata": {
    "alert_type": "high_fuel_cost",
    "action": "review_routes"
  }
}

Workflow:

  1. When diesel exceeds $3.50/gal, webhook fires
  2. Salesforce updates all active Transport Job records
  3. Platform Event triggers Lightning notification
  4. Dispatchers see real-time alert: "Diesel at $3.65 - Review route profitability"
  5. Team adjusts routes, defers non-urgent jobs, or renegotiates pricing

Implementation

Technical Setup (15 minutes)

  1. Deployed Apex webhook receiver to Salesforce production org

  2. Created custom fields on Transport_Job__c object:

    • Fuel_Price_Alert__c (Long Text)
    • Last_Fuel_Price__c (Currency)
    • Current_Fuel_Cost_Per_Job__c (Formula: Distance × MPG × Last_Fuel_Price__c)
  3. Configured 5 price alerts:

    • Diesel > $3.50 → "High Cost Alert"
    • Diesel < $2.80 → "Bulk Purchase Opportunity"
    • Diesel 5% daily increase → "Volatility Alert"
    • Diesel > $4.00 → "Critical - Adjust Pricing"
    • Natural Gas > $3.00 → "Alternative Fuel Alert"
  4. Created Salesforce dashboard showing:

    • Current fuel prices for all routes
    • Alert history (last 30 days)
    • Projected fuel costs for active jobs
    • Savings from route optimizations

Integration with Existing Systems

  • Routing Software: Exports route data to Salesforce nightly
  • Accounting: Fuel cost updates flow to QuickBooks via Zapier
  • Customer Portal: Clients see real-time fuel surcharges
  • Mobile App: Drivers get alerts for nearby cheaper fuel stations

Results

$50,000 Annual Savings Breakdown

Direct Savings:

  1. Eliminated Manual Checking = $15,000/year

    • 2.5 hours/day × $75/hr × 250 days = $46,875
    • Reduced to 0 hours with automation
  2. Strategic Fuel Purchasing = $20,000/year

    • Bulk purchases when diesel drops below $2.80
    • Average 15 cents/gallon savings
    • 700 gallons/day × 200 bulk purchase days × $0.15 = $21,000
  3. Route Optimization = $12,000/year

    • Defer 20% of non-urgent jobs when prices spike
    • Re-route to cheaper fuel stations (5% savings)
    • Estimated $50/day × 250 days = $12,500
  4. Accurate Job Costing = $3,000/year

    • Prevent under-pricing jobs with outdated fuel costs
    • Recover 1-2% margin on 500 jobs/year
    • Average $100/job × 30 jobs = $3,000

Total Quantifiable Savings: $50,375/year

Additional Benefits (Not Quantified):

  • Improved dispatcher morale (less tedious work)
  • Better customer satisfaction (transparent fuel surcharges)
  • Data-driven decision making (historical price trends)
  • Competitive advantage (faster response to market changes)

Key Metrics

Before vs After

Metric Before After Improvement
Manual Price Checks 3-4/day 0 100% reduction
Response Time to Price Changes 2-4 hours 10 seconds 99.9% faster
Fuel Cost Variance 5-10% <1% 90% reduction
Dispatcher Time on Fuel Monitoring 2.5 hrs/day 5 min/day 97% reduction
Bulk Purchase Opportunities 20/year 200/year 10x increase
Job Cost Accuracy 90% 99% 9% improvement

ROI Calculation

Investment:

  • OilPriceAPI Professional plan: $79/month = $948/year
  • Salesforce integration setup: 2 hours @ $150/hr = $300 (one-time)
  • Total Year 1 Cost: $1,248

Return:

  • Annual savings: $50,375
  • ROI: 3,936%
  • Payback period: 9 days

Lessons Learned

What Worked Well

  1. Platform Events for Real-Time Notifications

    • Lightning toasts immediately alert dispatchers
    • No need to refresh or check dashboards manually
    • Critical for time-sensitive decisions
  2. Metadata in Alerts

    • Including job_id in webhook allowed direct record updates
    • No complex lookup logic needed
    • Scalable to 1000s of jobs
  3. Multiple Threshold Alerts

    • Different thresholds for different actions
    • Prevents alert fatigue (only notify when action needed)
    • Cooldown periods prevent duplicate alerts
  4. Integration with Dashboard

    • Visual charts helped spot trends
    • Historical data enabled predictive planning
    • Executive team loved the reporting

Challenges Faced

  1. Initial Salesforce Guest User Permissions

    • Issue: Webhook returned 401 Unauthorized
    • Solution: Grant guest user edit access to specific fields
    • Time to resolve: 20 minutes
  2. Alert Fatigue

    • Issue: Too many alerts in first week (50+/day)
    • Solution: Added 60-minute cooldown periods
    • Adjusted thresholds to trigger only on significant changes
  3. HMAC Signature Validation

    • Issue: Webhooks rejected due to signature mismatch
    • Solution: Verified webhook secret in custom metadata matched OilPriceAPI dashboard
    • Time to resolve: 10 minutes

Recommendations for Others

For Transport Companies

  1. Start with One Route

    • Test with highest-volume route first
    • Prove ROI before rolling out to all routes
    • Adjust thresholds based on route profitability
  2. Set Conservative Thresholds Initially

    • Start with obvious triggers (e.g., diesel > $4.00)
    • Add more granular alerts as team gets comfortable
    • Use cooldown periods to prevent noise
  3. Train Dispatchers on New Workflow

    • Show them how alerts save time
    • Explain how to interpret different alert types
    • Create playbook: "When you see X alert, do Y"

For Trading Firms

While our use case is transport-focused, this integration works excellently for:

  • Spread trading: Alert when WTI-Brent spread > $5
  • Arbitrage: Notify when regional price differentials widen
  • Risk management: Trigger hedging strategies at price thresholds

For Retail Fuel (Gas Stations)

  • Dynamic pricing: Update pump prices when wholesale costs change
  • Competitive analysis: Monitor competitor pricing vs your costs
  • Margin protection: Alert when margins drop below acceptable levels

Future Plans

the transport company plans to expand the integration:

  1. Predictive Analytics

    • Use historical price data to forecast fuel costs
    • Integrate with route planning for cost projections
    • Machine learning to optimize threshold values
  2. Multi-Commodity Monitoring

    • Add natural gas alerts (for potential CNG fleet)
    • Track crude oil (leading indicator for diesel)
    • Monitor jet fuel (potential air cargo expansion)
  3. Customer Portal Integration

    • Show clients real-time fuel surcharges
    • Transparency builds trust and justifies pricing
    • Automate fuel surcharge calculations
  4. Mobile App Enhancement

    • Push notifications to drivers' phones
    • Show nearby fuel stations with current prices
    • Route drivers to cheapest options

Testimonial

"Before OilPriceAPI, we were flying blind on fuel costs. Dispatchers spent hours manually checking prices, and we still missed opportunities. Now, Salesforce automatically updates our jobs when diesel spikes, and we make smarter decisions in seconds instead of hours. The ROI was immediate - we recovered the cost in the first week. This is the best $79/month we spend."

— the company, Logistics Director A Transport Company

Technical Details

Salesforce Org: Professional Edition OilPriceAPI Plan: Professional ($79/month) Monthly Webhook Calls: ~3,000 (100/day avg) Salesforce Storage Used: <1 MB (minimal) Integration Maintenance: <1 hour/month

Custom Objects:

  • Transport_Job__c (500+ records/day)
  • Oil_Price__c (historical tracking, 100 records/day)

Platform Events:

  • Fuel_Price_Alert__e (5-10/day)

Alerts Configured:

  • 5 active alerts (various thresholds)
  • Average 2-3 triggers/day
  • 99.8% delivery success rate

Download This Integration

This exact integration is available as open-source:

👉 GitHub Repository

  • Complete Apex code
  • Step-by-step setup guide
  • Test classes included
  • MIT licensed (free to use commercially)

Get Started

Want similar results for your company?

  1. Clone the GitHub repo
  2. Sign up for OilPriceAPI (free 1,000 requests/month)
  3. Follow the installation guide (15-20 minutes)
  4. Start saving money on fuel costs!

Questions? Contact us: