Link

The subscription plan object

A subscription plan can be purchased and gives a user access to some assets for secific time duration.

Attributes
title String
Name of the plan
description String
Description of the plan
price_cents number
Price of plan in cents
price_currency string
Price currency of plan
duration_length number
Lenght of duration
duration_unit string
Unit corresponding to duration_length. Can be days,weeks,months,years
recurring boolean
True of planning is recurring. False for ontime plans.
trial_period_enabled Boolean
True if trial period is enabled.
trial_period_type string
Type of trial period (FREE_TRIAL, PAID_TRIAL, this will be null when trial_period_enabled is false)
max_trial_period_length Number
Length of free trial period. Applicable for recurring plans with free trial only.
max_trial_period_unit string
Unit corresponding to max_trial_period_length. Can be days,weeks,months,years
paid_trial_price_cents number
Price of paid trial for plan in cents (this will be null when trial_period_enabled is false)
supported_payment_providers Array
Array of all the payment providers supported for the subscription plan. This is generated based on price, currency, duration, and few other factors.
assets Array
Array of asset objects. Provides details of assets that user will get acccess to on purched of the subscription plan
image_s3_key string
S3 Key of the main image uploaded for the plan
custom_attributes Array
Array of json objects with each json object containing keys - name, type, value (type can be plain_text, rich_text or image)
{
  "id": 14,
  "subscription_group_id": 6,
  "duration_length": 1,
  "price_cents": 5000,
  "price_currency": "INR",
  "created_at": "2020-04-28T06:28:01.995Z",
  "updated_at": "2020-04-28T06:28:01.995Z",
  "duration_unit": "months",
  "description": "plan with user limit 5",
  "title": "plan with user limit 5",
  "max_trial_period_length": null,
  "max_trial_period_unit": null,
  "recurring": false,
  "metadata": {},
  "deleted_at": null,
  "enabled": true,
  "trial_period_enabled": false,
  "trial_period_type": null,
  "paid_trial_price_cents": null,
  "image_s3_key": null,
  "image_url": null,
  "custom_attributes": [
    {
      "name": "Attribute Name 1",
      "type": "plain_text",
      "value": "Attribute value"
    },
    {
      "name": "Attribute Name 2",
      "type": "rich_text",
      "value": "<p><strong>Attribute value</strong></p>"
    },
    {
      "name": "Attribute Name 3",
      "type": "image",
      "value": "https://gumlet.assettype.com/accesstype/assets/1685077868911/img1.jpeg"
    }
  ],
  "supported_payment_providers": [
    "razorpay",
    "paytm",
    "paypal"
  ],
  "user_limit": 5,
  "assets": [
    {
      "title": "site",
      "metadata": {},
      "type": "site",
      "published_at": {}
    }
  ],
  "display_assets": [
    {
      "title": "site",
      "metadata": {},
      "type": "site",
      "published_at": {}
    }
  ]
}