---
title: "Create Upgrade Link"
method: POST
path: "/v1/billing/upgrade-link"
tags: ["Billing"]
---

# Create Upgrade Link

`POST /v1/billing/upgrade-link`

Create a Stripe link the account owner opens in a browser to upgrade or manage their subscription. Nothing is charged by this call. Pass a plan to get a checkout link for that plan; existing subscribers may get an in-place plan change or a billing portal link instead. Omit plan to get a billing portal link for existing Stripe customers (returns 400 otherwise). Requires API key with billing:write permission.

## Request body

- CreateUpgradeLinkRequest
  - `plan` 'basic' | 'premium' | 'business' | 'basic_annual' | 'premium_annual' | 'business_annual' — Target plan for a checkout link. Omit to get a billing portal link for existing Stripe customers.

## Response `200`

Billing link created

- ApiResponseUpgradeLink
  - `success` boolean, required
  - `data` object, nullable
    - `url` string, required — Link the account owner opens in a browser to upgrade or manage the subscription
    - `kind` 'checkout' | 'portal', required — Whether the link is a Stripe Checkout session or the billing portal
    - `sessionId` string — Stripe Checkout session id, when kind is checkout
    - `orderId` string — Migma order id associated with the checkout, when applicable
  - `error` string, nullable

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden - Missing required permissions or access denied

---

[API](https://skmtc.net/migma/apis/migma-ai-api-v1.md) · [All operations](https://skmtc.net/migma/apis/migma-ai-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/migma/migma-ai-api-v1/revisions/2d06ad0e0bc3/schema)
