Creating Products

Create and manage the subscription products of your platform directly within DevOur. Every product is also created in your own Stripe account.

Products can be managed in the web app or, through the products list of your configuration file, from the CLI. See Products From the CLI.

Prerequisites

Before creating products, ensure you have:

  1. Completed Stripe Setup
  2. Added your Stripe Secret Key in your project settings

Access the Products Page

  1. Open your project in DevOur
  2. Navigate to Products from the project menu

If your project has no Stripe Secret Key yet, the page shows "You need to set a Stripe API key in your project config to use this feature". Click Add a Stripe API key to open your project settings and add it.

Create a New Product

  1. Click Add
  2. Enter a product name in the Create a new product dialog
  3. Click Create

The product is created in your Stripe account and opens straight away so you can configure it. A new product starts inactive and has no price until you save it.

Configure Product Details

Open a product from the list to configure it.

Basic Information

Pricing

Saving a new price, currency or interval creates a new price in Stripe and archives the previous one.

Usage Limits

The product page shows one number for each usage limit of your project: how many records a subscriber to this product can create under that limit. A limit left at 0 lets subscribers create nothing under it. See Usage Limits and What They Cap.

Features

Add features to highlight what's included in the subscription:

  1. Enter a feature in the Feature 1 field
  2. Click Add Feature to add another field (Feature 2, Feature 3…). The button stays disabled while the last feature is empty.
  3. Repeat for additional features (up to 15)
  4. Click X next to a feature to remove it

Empty features are ignored when you save.

Activation

Save Changes

Click Save to update the product in Stripe and in your project. Click Cancel to go back to the product list without saving.

Rename or Delete a Product

From the product list:

Sync with Stripe

Click Sync with Stripe on the products page to bring your project and your Stripe account back in line:

Products that can't be found in Stripe are greyed out in the list with a Needs sync tag and can't be opened until you sync.

Usage Limits and What They Cap

Name your usage limits once for the project, under Usage limits on the products page, such as Guides or Pieces. A project has up to 10. Then:

  1. Each product sets its own number for every limit.
  2. Each collection can be linked to one limit, under Usage limit on the collection's page.

In the generated platform, for a collection linked to a limit:

A refused action returns 403 with PLAN_REQUIRED or USAGE_LIMIT_REACHED. GET /api/users returns each limit with its maximum and how much the customer has used.

A plan counts while its Stripe subscription is active, in a trial, or past due while Stripe retries a failed renewal.

For example, with a Guides limit, three products at 1, 5, and 20 guides, and the Guides collection linked to Guides, a museum on the second product can create five guides and is refused a sixth.

Products From the CLI

devour sync writes your products into the configuration file, and devour setup --config <file> applies them:

"products": [
  {
    "name": "Five guides",
    "description": "For a growing museum",
    "features": ["5 guides", "Audio for every piece"],
    "active": true,
    "limits": { "Guides": 5 },
    "amount": 10000,
    "currency": "usd",
    "interval": "month"
  }
]

Your project needs its Stripe secret key first.

Related Documentation