---
title: "Create a new subscription"
method: POST
path: "/api/subscriptions"
tags: ["Subscriptions"]
---

# Create a new subscription

`POST /api/subscriptions`

Subscribe a customer to a plan. The plan must have a price matching the specified currency. Optionally set a trial period in days.

## Request body

- CreateSubscriptionDto
  - `customerId` string, required — Customer ID
  - `planId` string, required — Plan ID
  - `currency` string, required — Currency for billing
  - `trialDays` number — Number of trial days
  - `metadata` object
  - `startDate` string — Override subscription start date (ISO 8601). Defaults to now.
  - `currentPeriodEnd` string — Override current period end (ISO 8601). Defaults to calculated from startDate + billing interval.
  - `status` 'ACTIVE' | 'TRIALING' | 'PAUSED' | 'PAST_DUE' | 'CANCELED' — Override subscription status for imports
  - `createdAt` string — Backdate createdAt (ISO 8601). For data imports.
  - `externalId` string — External ID for linking to external systems
  - `canceledAt` string — Canceled at date (ISO 8601). For importing canceled subscriptions.

## Response `201`

Subscription created (status: ACTIVE or TRIALING)

- SubscriptionResponse
  - `id` string, required
  - `externalId` string
  - `customerId` string, required
  - `planId` string, required
  - `previousPlanId` string
  - `status` 'ACTIVE' | 'PAST_DUE' | 'CANCELED' | 'TRIALING' | 'PAUSED', required
  - `currency` string, required
  - `billingTiming` 'IN_ADVANCE' | 'IN_ARREARS', required
  - `currentPeriodStart` string, required
  - `currentPeriodEnd` string, required
  - `cancelAt` string
  - `canceledAt` string
  - `trialStart` string
  - `trialEnd` string
  - `startedAt` string, required
  - `metadata` object
  - `customer` SubscriptionCustomerResponse
    - `id` string, required
    - `name` string, required
    - `email` string, required
  - `plan` SubscriptionPlanResponse
    - `id` string, required
    - `name` string, required
    - `billingInterval` 'HOURLY' | 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'QUARTERLY' | 'YEARLY', required
  - `createdAt` string, required
  - `updatedAt` string, required

## Other responses

- `400` — Plan inactive or no price for specified currency
- `404` — Customer or plan not found

---

[API](https://skmtc.net/novabilling/apis/novabilling-api.md) · [All operations](https://skmtc.net/novabilling/apis/novabilling-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/novabilling/novabilling-api/versions/0e449a4e0dc8/schema)
