> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useplinth.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview a plan change

> Calculates exactly what a plan change would cost without committing it. Always call this before `change` so the customer sees the exact amount before confirming. Returns proration amounts to the kobo.




## OpenAPI

````yaml POST /v1/subscriptions/{id}/preview-change
openapi: 3.0.3
info:
  title: Plinth API
  version: 0.9.0
  description: >
    Recurring billing for Nigerian SaaS — card charging, bank transfers via
    virtual accounts,

    proration, dunning, and recovery in one API.


    All amounts are in **kobo** (1/100th of a Naira). ₦5,000 = `500000`.
servers:
  - url: https://api.useplinth.com
    description: Production
  - url: http://localhost:7331
    description: Local development
security:
  - BearerAuth: []
tags:
  - name: Sandbox
    description: Create an isolated sandbox environment for testing. No auth required.
  - name: Customers
    description: Who you are billing. One customer can have multiple subscriptions.
  - name: Plans
    description: Plan groups and the plans within them. Customers subscribe to plans.
  - name: Subscriptions
    description: The recurring billing relationship between a customer and a plan.
  - name: Virtual Accounts
    description: Dedicated bank account numbers for customers who pay by transfer.
  - name: Invoices
    description: Created at each billing cycle. Tracks what a customer owes for a period.
  - name: Webhooks
    description: >-
      Register endpoints that receive signed, retried events. See Receiving
      webhooks.
  - name: Admin
    description: Test clock control, billing tick, and suspense resolution. Test-mode only.
paths:
  /v1/subscriptions/{id}/preview-change:
    post:
      tags:
        - Subscriptions
      summary: Preview a plan change
      description: >
        Calculates exactly what a plan change would cost without committing it.
        Always call this before `change` so the customer sees the exact amount
        before confirming. Returns proration amounts to the kobo.
      operationId: preview-plan-change
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: sub_01JABC...
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - plan_id
              properties:
                plan_id:
                  type: string
                  example: pln_01JABC...
                quantity:
                  type: integer
                  example: 1
      responses:
        '200':
          description: Proration preview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanChangePreview'
              example:
                object: preview
                direction: upgrade
                dueNowMinor: '466667'
                creditMinor: '0'
                scheduledFor: null
components:
  schemas:
    PlanChangePreview:
      type: object
      properties:
        object:
          type: string
          enum:
            - preview
        direction:
          type: string
          enum:
            - upgrade
            - downgrade
            - lateral
          example: upgrade
        dueNowMinor:
          type: string
          description: Kobo to charge immediately (upgrade). Zero if deferred.
          example: '466667'
        creditMinor:
          type: string
          description: Kobo to credit to balance (downgrade). Zero if deferred.
          example: '0'
        scheduledFor:
          type: string
          format: date-time
          nullable: true
          description: Set when the change is deferred to period end. Null if immediate.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Use `sk_test_` keys for sandbox. Use `sk_live_` keys for production.
        Obtain your key from the dashboard.

````