Get a subscription record or the latest order
get
https://api.expiryedge.com/v1/getSubscriptionany role60/min
Request
curl 'https://api.expiryedge.com/v1/getSubscription?id=org_northwind' \
-H "Authorization: Bearer $EXPIRYEDGE_API_KEY"Response
{
"subscription": {
"id": "ord_3Jk8Wq",
"user_id": "u_71bXq",
"organization_id": "org_northwind",
"plan_type": "prod_SJbWzGAm137eGN",
"subscription_period": 1,
"period_unit": "month",
"subscription_id": "sub_1QfT8sLm2Northwind",
"currency": "usd",
"total_amount": 29,
"net_amount": 29,
"status": "completed",
"order_date": "2026-09-27T14:05:00.000Z",
"createdAt": "2026-09-27T14:05:00.000Z"
}
}With id, returns that subscriptions document if it belongs to the caller or the caller's organization (404 otherwise).
Without id, returns the caller's most recent order as {subscription} (or null).
idstringAsubscriptionsdocument id (usually the organization id).
200
The subscription document (
{id, ...}) when id is given, else {subscription}.(body)one ofOne ofidstringrequired
400 | The request is missing required fields or contains invalid values. |
401 | Missing, expired or invalid bearer token. |
404 | The record does not exist or is not in your organization. |
429 | Too many requests for this endpoint from your IP. Wait Retry-After seconds. |
