RevKeen Docs
Api reference

Change subscription plan

Change the plan for an existing subscription with optional proration


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-quantity — Change subscription quantity
  • POST /subscriptions/{id}/preview-renewal — Preview subscription renewal
  • 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}/change-plan
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/change-plan" \  -H "x-api-key: $REVKEEN_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "newPlanId": "00000000-0000-0000-0000-000000000000"  }'
{
  "subscription": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "merchantId": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b",
    "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
    "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113",
    "priceId": "b245ceea-4bc7-4619-ae4c-559a1faf418e",
    "planId": "b3f60ba2-c1fd-4b3a-a23d-8e876e0ef75d",
    "status": "trialing",
    "quantity": 1,
    "amountMinor": 0,
    "currency": "str",
    "billingInterval": "day",
    "currentPeriodStart": "2019-08-24T14:15:22Z",
    "currentPeriodEnd": "2019-08-24T14:15:22Z",
    "trialEnd": "2019-08-24T14:15:22Z",
    "canceledAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "dunning": {
      "isInDunning": true,
      "phase": 0,
      "phaseLabel": "string",
      "phaseSeverity": "info",
      "retryCount": 0,
      "totalPossibleRetries": 0,
      "nextRetryAt": "2019-08-24T14:15:22Z",
      "daysInDunning": 0,
      "accessRestricted": true
    }
  },
  "proration": {},
  "previousPlanId": "string",
  "invoiceCreated": true
}
Empty
Empty