Create subscription product

📘

API Refs

Request body

NameTypeDescriptionRequired
productNamestringProduct name for display purposesyes
productDescriptionstringDetailed product descriptionno
plansarrayArray of pricing plans for this productyes

Plan Object (CreatePlanDto)

NameTypeDescriptionRequired
namestringPlan name for display purposesyes
descriptionstringDetailed plan descriptionno
amountnumberPrice amount in cents (e.g., 2999 = $29.99)yes
currencystringCurrency code (ISO 4217 format, e.g., "usd")yes
intervalenumBilling interval: "day", "week", "month", or "year"yes
intervalCountnumberInterval multiplier (e.g., 3 for quarterly with interval="month")no (default: 1)

Billing Interval Patterns

Common Patterns:

  • Monthly: interval: "month", intervalCount: 1
  • Quarterly: interval: "month", intervalCount: 3
  • Semi-Annual: interval: "month", intervalCount: 6
  • Annual: interval: "year", intervalCount: 1
  • Bi-Annual: interval: "year", intervalCount: 2

Response

Success Response (201 Created)

FieldTypeDescription
stripeProductIdstringStripe product identifier
namestringProduct name
descriptionstringProduct description
plansarrayAvailable pricing plans

Plan Response Object

FieldTypeDescription
stripePriceIdstringStripe price ID
amountnumberPrice amount in cents
currencystringCurrency code
intervalstringBilling interval ("month", "year")

Response

{
  "stripeProductId": "prod_ExampleProductABC",
  "name": "Auto Insurance Plans",
  "description": "Comprehensive auto insurance coverage with multiple plan options",
  "plans": [
    {
      "stripePriceId": "price_ExamplePriceID456",
      "amount": 4999,
      "currency": "usd",
      "interval": "month"
    },
    {
      "stripePriceId": "price_ExamplePriceID789",
      "amount": 49999,
      "currency": "usd",
      "interval": "year"
    }
  ]
}

Description

This endpoint creates a new subscription product with one or more pricing plans. Products represent what you're selling (e.g., "Premium Insurance Coverage"), while plans define how you charge for it (e.g., "$49.99/month" or "$499.99/year").

You can create multiple plans for a single product to offer different billing intervals or pricing tiers. The intervalCount field allows for flexible billing schedules like quarterly (interval="month", intervalCount=3) or semi-annual (interval="month", intervalCount=6) billing.

Important Notes

  1. Pricing Strategy: Higher intervalCount often comes with discounts (annual vs monthly)
  2. Immutable Plans: Plans cannot be modified after creation - create new plans instead
  3. Currency: All plans for a product should use the same currency
  4. Amount: Always specify amounts in cents (multiply dollar amount by 100)

Error Responses

  • 400 Bad Request: Invalid product or plan configuration
  • 401 Unauthorized: Invalid or missing authorization token
  • 403 Forbidden: Insufficient permissions