RevKeen Docs
Api reference

Preview subscription renewal

Preview the upcoming renewal dates and amounts for an existing subscription.

This uses the same billing calculation logic as the actual scheduler to show exactly when and how much the subscription will be billed (Key Invariant #4: Preview === Scheduler).


Related endpoints

  • POST /subscriptions — Create a new subscription
  • GET /subscriptions — List subscriptions
  • GET /subscriptions/{id} — Get subscription by ID
  • PATCH /subscriptions/{id} — Update subscription details
  • DELETE /subscriptions/{id} — Delete subscription
  • POST /subscriptions/{id}/change-plan — Change subscription plan
  • POST /subscriptions/{id}/change-quantity — Change subscription quantity
  • POST /subscriptions/{id}/pause — Pause subscription

Common errors

  • 401 unauthenticated — missing, malformed, or revoked API key.
  • 404 resource_missing — the referenced resource does not exist or is not visible to your key.

Idempotency

Pass an Idempotency-Key header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see the idempotency guide.

POST
/subscriptions/{id}/preview-renewal
x-api-key<token>

Your RevKeen API key (powered by Unkey). Get it from Dashboard > Settings > API Keys. Use rk_sandbox_* for test mode and rk_live_* for production.

In: header

Path Parameters

id*string

Subscription UUID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://api.revkeen.com/v2/subscriptions/00000000-0000-0000-0000-000000000000/preview-renewal" \  -H "x-api-key: $REVKEEN_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "previewCount": 3  }'
{
  "data": {
    "subscriptionId": "d079718b-ff63-45dd-947b-4950c023750f",
    "currentPeriodEnd": "2019-08-24T14:15:22Z",
    "upcomingRenewals": [
      {
        "sequence": 1,
        "date": "2019-08-24T14:15:22Z",
        "formattedDate": "string",
        "dayName": "string",
        "amountMinor": 0,
        "formattedAmount": "string",
        "isTrialEnd": true,
        "isFirstCharge": true,
        "isFinalPayment": true
      }
    ],
    "nextInvoiceAmountMinor": 0,
    "currency": "str"
  }
}
Empty
Empty