Skip to content

Metrics

GET/v1/sales/metrics

The dashboard headline numbers in a single call: revenue by currency and counts by status, with no paging.

Parameters

ParameterTypeDefault
fromYYYY-MM-DD30 days ago
toYYYY-MM-DDtoday
convertToISO-4217—

Example

curl "https://public-api.passkey.global/v1/sales/metrics?from=2026-08-01&to=2026-08-31" \
  -H "Authorization: Bearer passkey_prd_..."
json
{
  "from": "2026-08-01",
  "to": "2026-08-31",
  "totals": { "paidCount": 152, "waitingCount": 9, "refundedCount": 6, "failedCount": 1 },
  "revenue": [{ "currency": "BRL", "amountCents": 4544800 }],
  "conversion": null
}

revenue counts paid sales only. This endpoint is served from a 30-second cache.

convertTo

The value is the three-letter ISO-4217 code of the target currency — BRL, USD, EUR, the same standard as the currency field. Any three-letter code is accepted; malformed ones return 400.

text
GET /v1/sales/metrics?from=2026-08-01&to=2026-08-31&convertTo=BRL

Without it, values come split by currency. With it, everything is converted to the requested currency:

json
{
  "revenue": [{ "currency": "BRL", "amountCents": 5121300 }],
  "conversion": { "target": "BRL", "quotedFrom": "2026-08-01", "quotedTo": "2026-08-31" }
}

Three rules that prevent wrong numbers

RuleWhy
Each line uses its own day ratewith "today rate", a closed month total would change every time FX moved
All or nothingif one day rate is missing the whole conversion is dropped — converting part would give a total worse than none, and indistinguishable from a correct one
conversion: null never means rate 1it means no conversion happened: not requested, rate missing, or it already was the target currency
Always check conversion before treating revenue as a single currency.