Every API here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for apis
7 MCP tools reach this
find_apisBrowse and filter every API in the catalog.
get_api_artifactsOne API's artifacts, grouped by type.
get_openapiThe primary OpenAPI for this API.
find_similar_apisAPIs that look like this one.
apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
resolveTurn a domain, URL or GitHub org into the provider it belongs to.
find_cohortsEvery scored population of providers in the catalog.
All 92 tools →
Call it yourself
curl for this page
This API
curl "https://apis.io/api/v1/apis/merchantflow-ai:merchantflow-ai-profitability-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: MerchantFlow Public Profitability API
version: 1.0.0
summary: Read-only access to a merchant's headline metrics, orders, products, and profitability.
description: 'The MerchantFlow Public API lets an authorised third-party application read a
merchant''s headline metrics, order economics, products, and profit and loss.
**Read-only.** Every endpoint is `GET`. There are no write scopes to request.
**Ask for the narrowest scope that works.** The `metrics:*` scopes each return
ONE figure. If your integration needs MER, request `metrics:mer:read` rather than
`profitability:read` - the latter returns the entire P&L waterfall including COGS,
expenses and net profit, and merchants decline it far more often. MerchantFlow
provisions each partner with an allowlist of the scopes it may request at all; a
scope outside that list is refused at `/authorize`, before any merchant sees a
consent screen.
**No customer PII.** Customer names, email addresses, phone numbers and shipping
addresses are never returned. Orders carry `customer_ref`, a pseudonymous
identifier that is stable for your application and for one merchant, and is not
correlatable with any other application''s identifiers.
**Two numbers need care.** `ad_spend_allocated` is a blended daily allocation, not
measured per-order ad spend - no ad platform reports spend at order granularity.
And `cogs_coverage_pct` tells you how much of an order actually has cost data;
a high margin on an order with low coverage is missing costs, not profit.'
contact:
name: MerchantFlow
url: https://docs.merchantflow.ai/docs/integrations/api
servers:
- url: https://merchantflow.ai/api/v1
description: Production
security:
- oauth2: []
tags:
- name: Profitability
paths:
/profitability/summary:
get:
operationId: getProfitabilitySummary
summary: Aggregate profit and loss for a period
description: The full waterfall from gross revenue to net profit. Read `basis` before comparing these figures with anything computed elsewhere.
tags:
- Profitability
security:
- oauth2:
- profitability:read
parameters:
- name: start_date
in: query
description: YYYY-MM-DD, resolved in the store timezone.
schema:
type: string
format: date
- name: end_date
in: query
description: YYYY-MM-DD, resolved in the store timezone.
schema:
type: string
format: date
responses:
'200':
description: The summary.
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
data:
$ref: '#/components/schemas/ProfitabilitySummary'
meta:
$ref: '#/components/schemas/Meta'
'400':
description: Invalid date parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
/profitability/daily:
get:
operationId: listDailyProfitability
summary: Daily profit and loss series
tags:
- Profitability
security:
- oauth2:
- profitability:read
parameters:
- name: start_date
in: query
schema:
type: string
format: date
- name: end_date
in: query
schema:
type: string
format: date
- name: limit
in: query
description: Page size. Days are small, so this endpoint allows up to 400.
schema:
type: integer
minimum: 1
maximum: 400
default: 100
- $ref: '#/components/parameters/cursor'
responses:
'200':
description: A page of days, oldest first.
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
data:
type: array
items:
$ref: '#/components/schemas/ProfitabilityDay'
meta:
$ref: '#/components/schemas/Meta'
page:
$ref: '#/components/schemas/Page'
'400':
description: Invalid date parameter or cursor.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
components:
schemas:
ProfitabilitySummary:
type: object
properties:
period:
type: object
properties:
start:
type:
- string
- 'null'
end:
type:
- string
- 'null'
days:
type: integer
currency:
type: string
cogs_coverage_pct:
type:
- number
- 'null'
basis:
type: object
description: How these figures were computed. Compare only against figures on the same basis.
properties:
refund_recognition:
type: string
const: sale_date
description: A refunded order's costs are recognised on the date the order was placed, matching its revenue.
tax_treated_as_cost:
type: boolean
description: Follows the merchant's own setting, so these figures match their dashboard.
ad_spend:
type: string
const: blended_daily_allocation
totals:
type: object
additionalProperties:
type: number
Error:
type: object
properties:
success:
type: boolean
const: false
error:
type: object
properties:
code:
type: string
message:
type: string
Page:
type: object
properties:
has_more:
type: boolean
next_cursor:
type:
- string
- 'null'
limit:
type: integer
Meta:
type: object
description: Provenance attached to every response.
properties:
store_id:
type: string
currency:
type: string
description: ISO 4217 for this store.
timezone:
type: string
description: IANA timezone. All date-only filters resolve in it.
as_of:
type:
- string
- 'null'
format: date-time
description: When this store last synced. Not the request time.
stale:
type: boolean
description: True when the last sync is more than 24 hours old.
history_available_from:
type:
- string
- 'null'
description: Earliest date this store's plan includes (YYYY-MM-DD), or null for unlimited history.
truncated:
type: boolean
description: True when the request reached further back than the plan includes. Everything from history_available_from onwards is present and complete.
order_allowance:
$ref: '#/components/schemas/OrderAllowance'
OrderAllowance:
type: object
description: Present only on the metrics and profitability endpoints, and only when the store has exceeded its monthly order allowance and the window you asked for holds orders past it. The response still covers the whole window, but order-derived figures (revenue, COGS, fees, refunds, order counts, profit) leave those orders out; ad spend and expenses are complete. These are the same figures the merchant's own dashboard shows. Absent when every order in the window is counted.
properties:
status:
type: string
enum:
- partial
missing_orders:
type: integer
description: Orders in the requested window placed after the store passed its monthly allowance, left out of the figures.
resets_at:
type: string
format: date-time
description: When the allowance resets (the start of the store's next calendar month). Later months count every order again, and an upgrade includes them sooner.
required:
- status
- missing_orders
- resets_at
ProfitabilityDay:
type: object
properties:
date:
type: string
description: YYYY-MM-DD in the store timezone.
currency:
type: string
gross_revenue:
type: number
description: Amount in the order currency.
refunds:
type: number
description: Amount in the order currency.
net_revenue:
type: number
description: Amount in the order currency.
shipping_revenue:
type: number
description: Amount in the order currency.
discounts:
type: number
description: Amount in the order currency.
cogs:
type: number
description: Amount in the order currency.
product_cost_only:
type: number
description: COGS excluding handling cost.
ad_spend:
type: number
description: Amount in the order currency.
payment_fees:
type: number
description: Includes fees estimated from the merchant's payment fee rules for orders whose platform reported no fee. The per-order split is available as payment_fee_source on /orders.
shipping_cost:
type: number
description: Amount in the order currency.
fulfillment_cost:
type: number
description: Amount in the order currency.
tax:
type: number
description: Amount in the order currency.
variable_costs:
type: number
description: Amount in the order currency.
opex:
type: number
description: Amount in the order currency.
amortised_expenses:
type: number
description: Amount in the order currency.
interest_expense:
type: number
description: Amount in the order currency.
product_margin_cm1:
type: number
description: net_revenue - product_cost_only.
gross_profit_cm2:
type: number
description: net_revenue - cogs.
contribution_margin_cm3:
type: number
description: gross_profit_cm2 - shipping - fulfilment - payment fees - ad spend.
ebitda:
type: number
description: Amount in the order currency.
net_profit:
type: number
description: Amount in the order currency.
cogs_coverage_pct:
type:
- number
- 'null'
responses:
Forbidden:
description: The token lacks the scope this endpoint requires.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Missing, expired, or revoked token. The `WWW-Authenticate` header names the protected-resource metadata document so you can rediscover the authorization server.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
RateLimited:
description: 'Budget exhausted. `Retry-After` gives the seconds to wait and `X-RateLimit-Reason` says which limit was hit: `burst`, `hour`, `day`, `concurrency`, or `client_global`. `concurrency` means too many requests are in flight for one store at once - page cursors sequentially rather than in parallel. `client_global` means your application exceeded its budget across ALL connected stores; stagger scheduled syncs instead of starting every store at the same moment.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
cursor:
name: cursor
in: query
description: Opaque pagination cursor from a previous response's `page.next_cursor`. A cursor is bound to the exact filters it was created with - reusing one with different filters returns `400 CURSOR_FILTER_MISMATCH` rather than silently returning a page computed against the wrong query.
schema:
type: string
securitySchemes:
oauth2:
type: oauth2
description: 'OAuth 2.1 authorization code flow with PKCE (S256 required).
Send the RFC 8707 resource indicator `resource=https://merchantflow.ai/api/v1` at both
the authorize and token endpoints. If you omit it, MerchantFlow infers it from
your requested scopes, but sending it explicitly is strongly preferred.
Request `offline_access` alongside your data scopes to receive a refresh token;
without it your access token expires after one hour and the merchant has to
repeat the browser consent flow.'
flows:
authorizationCode:
authorizationUrl: https://merchantflow.ai/api/auth/oauth2/authorize
tokenUrl: https://merchantflow.ai/api/auth/oauth2/token
refreshUrl: https://merchantflow.ai/api/auth/oauth2/token
scopes:
store:read: Read your store name, currency, timezone, and data freshness
metrics:mer:read: Read your Marketing Efficiency Ratio (MER) for a date range - the ratio only, not the underlying figures
metrics:revenue:read: Read the revenue total used to calculate MER (D2C gross revenue) for a date range
metrics:ad_spend:read: Read the advertising spend total used to calculate MER for a date range
metrics:contribution_profit:read: Read your contribution profit total for a date range - the single figure, not the cost breakdown behind it
orders:read: Read your orders and their economics (revenue, COGS, fees, profit). Includes a pseudonymous customer reference so the app can tell repeat buyers from new ones - never names, email addresses, phone numbers, or shipping addresses
products:read: Read your products, variants, and cost of goods sold
profitability:read: Read your full profit & loss summary and daily profit history, including COGS, expenses and net profit
offline_access: Receive a refresh token
externalDocs:
url: https://docs.merchantflow.ai/docs/integrations/api
description: Integration guide
x-rate-limits:
description: Per store per application, except client_global which is per application across every store it is connected to.
burst_per_minute: 60
per_hour: 1000
per_day: 10000
max_concurrent: 2
client_global_per_minute: 200