Skip to content

Profitability API

Access profit metrics calculated from your sales and COGS data.

Get Profitability Summary

Returns profit metrics summary for the specified period.

GET /api/v1/profitability/summary

Parameters

ParameterTypeRequiredDescription
periodstringNoTime period (default: this_month)
view_typestringNosummary or detailed (default: summary)

Example Request

bash
curl -H "Authorization: Bearer ned_live_YOUR_KEY" \
  "https://api.meetned.com/api/v1/profitability/summary?period=this_month"

Example Response

json
{
  "data": {
    "summary": {
      "gross_revenue": 45200.00,
      "net_revenue": 43800.00,
      "total_cogs": 18500.00,
      "gross_profit": 25300.00,
      "gross_margin": 57.76,
      "shipping_costs": 2100.00,
      "transaction_fees": 1400.00,
      "net_profit": 21800.00,
      "net_margin": 49.77
    },
    "comparison": {
      "gross_profit_change": 8.5,
      "margin_change": 1.2
    }
  },
  "meta": {
    "period": "this_month",
    "generated_at": "2025-02-04T12:00:00Z"
  }
}

Get Product Profitability

Returns profitability breakdown by product.

GET /api/v1/profitability/products

Parameters

ParameterTypeRequiredDescription
periodstringNoTime period (default: this_month)
limitnumberNoResults per page (default: 50, max: 100)
offsetnumberNoResults to skip (default: 0)
sortstringNoSort field: profit, margin, revenue (default: profit)

Example Request

bash
curl -H "Authorization: Bearer ned_live_YOUR_KEY" \
  "https://api.meetned.com/api/v1/profitability/products?period=this_month&limit=10"

Example Response

json
{
  "data": {
    "products": [
      {
        "product_id": "12345",
        "title": "Premium Widget",
        "sku": "WIDGET-001",
        "revenue": 4500.00,
        "cogs": 1800.00,
        "gross_profit": 2700.00,
        "gross_margin": 60.0,
        "units_sold": 45
      },
      {
        "product_id": "12346",
        "title": "Standard Widget",
        "sku": "WIDGET-002",
        "revenue": 2200.00,
        "cogs": 1100.00,
        "gross_profit": 1100.00,
        "gross_margin": 50.0,
        "units_sold": 88
      }
    ],
    "pagination": {
      "total": 156,
      "limit": 10,
      "offset": 0,
      "has_more": true
    }
  },
  "meta": {
    "period": "this_month",
    "generated_at": "2025-02-04T12:00:00Z"
  }
}

Notes

COGS Data

Profitability calculations require Cost of Goods Sold (COGS) data to be configured in your Ned dashboard:

  1. Go to SettingsCOGS
  2. Upload your SKU costs via CSV or manual entry
  3. Data syncs automatically within 24 hours

Products without COGS data will show null for profit fields.

Calculation Methods

  • Gross Profit = Revenue - COGS
  • Gross Margin = (Gross Profit / Revenue) × 100
  • Net Profit = Gross Profit - Shipping - Transaction Fees
  • Net Margin = (Net Profit / Revenue) × 100

Built with ❤️ by Ned AI