Skip to main content
The Profitability endpoints return profit & loss (P&L) data and let you manage the unit cost of goods sold (COGS) that feeds those calculations.

Profit & loss

Store P&L: Product P&L: See each endpoint’s reference page for the exact request body and response schema.

Managing unit COGS

Runs as an asynchronous job — submit the update, then poll for completion.
1

Submit the update

POST /profitability/directCosts — submit the unit COGS to update. The response identifies the job.
2

Poll the job

GET /profitability/directCostsJobStatus — check the status until the job is complete.
# 1. Submit the COGS update
curl -X POST "https://mm-api.merchantspring.io/profitability/directCosts" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "channelId": "YOUR_CHANNEL_ID",
  "merchantId": "YOUR_MERCHANT_ID",
  "fromDate": 0,
  "directCosts": [
    {
      "sellerSku": "string",
      "cogs": 0,
      "cogsCurrency": "string",
      "shippingCost": 0,
      "shippingCostCurrency": "string"
    }
  ]
}'

# 2. Poll for completion — use the jobId from step 1; repeat until jobStatus is COMPLETED or FAILED
curl -X GET "https://mm-api.merchantspring.io/profitability/directCostsJobStatus?merchantId=YOUR_MERCHANT_ID&channelId=YOUR_CHANNEL_ID&jobId=YOUR_JOB_ID" \
  -H "x-api-key: YOUR_API_KEY"
Updated COGS values are reflected in subsequent profitability and channel-profit-and-loss results once the job completes.