Get plan usage
API v2 is in public beta: endpoints and fields can change before general availability. See the changelog
/account/plan_usageCosts 1 rate-limit point · Rate limits
The shop's current STOQ plan, the limits it includes, and a calendar month's usage against them (back-in-stock email and SMS alerts, SMS segments, preorders).
usage.by_template splits the month's back-in-stock email and SMS alerts by notification template, as the usage card's breakdown does. Each row's key names the notification (restock_alert, reminder), the same key as /back_in_stock/templates/:key. limits.unlimited_preorders is true when the plan has no preorder limit (preorder_limit 0). usage.preorders_over_limit is the month's preorders above preorder_limit.
Also searched asplan and usagewhat plan am I onhow much have I usedusage this monthplan limits
Query parameters
periodstringCalendar month to report usage for, as YYYY-MM (e.g. 2026-04); defaults to the current month.
Returns
planobjectShow 3 child attributesHide child attributes
namestring, nullableExample:pro_per_monthfriendly_namestring, nullableExample:Pronotestring
periodobjectShow 2 child attributesHide child attributes
monthstringExample:2026-11is_currentbooleanExample:true
limitsobjectShow 6 child attributesHide child attributes
usage_typestringExample:per_monthunlimited_notificationsbooleanExample:falsenotification_limitintegerExample:2000email_limitintegerExample:0sms_limitintegerExample:0preorder_limitintegerExample:400
usageobjectShow 7 child attributesHide child attributes
email_alertsintegerExample:684sms_alertsintegerExample:112sms_segmentsintegerExample:131total_alertsintegerExample:796alerts_over_limitintegerExample:0preordersintegerExample:57by_templatearray of objectsShow 3 child attributesHide child attributes
template_positionintegerExample:0email_alertsintegerExample:521sms_alertsintegerExample:98
Errors
validation_failedThe action refused the request for a reason that is not a single bad field.
Any request can also fail with auth_invalid (401) or rate_limited (429).
Every error has the same shape: see Errors and the list of error codes.
curl "https://app.stoqapp.com/api/v2/external/account/plan_usage" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v2/external/account/plan_usage", {
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://app.stoqapp.com/api/v2/external/account/plan_usage",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v2/external/account/plan_usage")
req = Net::HTTP::Get.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"])
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body){
"plan": {
"name": "pro_per_month",
"friendly_name": "Pro"
},
"period": {
"month": "2026-11",
"is_current": true
},
"limits": {
"usage_type": "per_month",
"unlimited_notifications": false,
"notification_limit": 2000,
"email_limit": 0,
"sms_limit": 0,
"preorder_limit": 400
},
"usage": {
"email_alerts": 684,
"sms_alerts": 112,
"sms_segments": 131,
"total_alerts": 796,
"alerts_over_limit": 0,
"preorders": 57,
"by_template": [
{
"template_position": 0,
"email_alerts": 521,
"sms_alerts": 98
},
{
"template_position": 1,
"email_alerts": 163,
"sms_alerts": 14
}
]
}
}{
"errors": [
"Invalid API key"
],
"code": "auth_invalid",
"details": [
{
"code": "auth_invalid",
"message": "Invalid API key",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"name is required"
],
"code": "validation_failed",
"details": [
{
"code": "validation_failed",
"message": "name is required",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"Rate limit exceeded"
],
"code": "rate_limited",
"details": [
{
"code": "rate_limited",
"message": "Rate limit exceeded",
"path": null,
"value": null,
"expected": null
}
]
}