Get a subscription record or the latest order

gethttps://api.expiryedge.com/v1/getSubscription
any role60/min
Anfrage
curl 'https://api.expiryedge.com/v1/getSubscription?id=org_northwind' \
  -H "Authorization: Bearer $EXPIRYEDGE_API_KEY"
Antwort
{
  "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).

Query-Parameter

  • idstring
    A subscriptions document id (usually the organization id).

Rückgabe

200
The subscription document ({id, ...}) when id is given, else {subscription}.
  • (body)one of
    Eines von
    • idstringerforderlich

Fehler

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.