Untitled

mail@pastecode.io avatar
unknown
json
2 months ago
3.4 kB
2
Indexable
Never
{
  "plan_id": "unique_plan_identifier", // Required: A unique identifier for each plan.
  "plan_name": "Name of the Plan",` // Required: Descriptive name of the plan.
  "amount": 100000, // Required: The charge amount for the plan in subcurrency units (e.g., cents, kobo).
  "currency": "USD", // Required: Base currency code for billing.
  "interval": "monthly", // Required: Billing interval, e.g., "monthly", "yearly".
  "charge_on": "customer_enrollment", // Required: Defines when the charge is applied. Common values: "customer_enrollment", "end_of_trial".
  
  "trial_period": { // Optional: Defines the trial period before billing starts. If not provided, defaults to no trial period.
    "type": "days", // "days" for a specific number of days, "interval" for billing cycles.
    "value": 14 // Represents the length based on the "type", e.g., 14 days or 1 billing cycle.
  },
  
  "tiers": [ // Optional: Required for tiered billing plans. Specify this array for plans with multiple pricing tiers.
    {
      "tier_name": "Starter", // Required for tiered plans: Name of the tier.
      "amount": 2000, // Required for tiered plans: Base amount charged for this tier in subcurrency units.
      "metrics": [ // Required for tiered plans: Defines allowances and overage charges for various metrics.
        {
          "metric_name": "SMS",
          "allowance": 1000,
          "overage_charge_per_unit": 1 // 0.01 USD => 1 cent per unit over the allowance.
        },
        {
          "metric_name": "Emails",
          "allowance": 5000,
          "overage_charge_per_unit": 2 // 0.002 USD => 2 cents per unit over the allowance.
        },
        {
          "metric_name": "Team Members",
          "allowance": 10,
          "overage_charge_per_unit": 500 // 5 USD => 500 cents per unit over the allowance.
        }
      ]
    }
    // Additional tiers can be defined here.
  ],
  
  "usage_charge_per_unit": 1, // Optional: Charge per unit of usage in subcurrency units. Required for usage-based billing.
  
  "pssp": "stripe", // Required: Payment Service Provider. Specifies the primary payment processor.
  
  "plan_variants": [ // Optional: Defines variants of the main plan in other currencies. Use this to offer the plan in multiple currencies.
    {
      "variant_id": "ngn_variant", // A unique identifier for the variant.
      "currency": "NGN", // Currency for this variant.
      "amount": 760000, // Adjusted plan amount for this currency in subcurrency units (e.g., kobo).
      "pssp": "paystack", // Payment processor for this currency variant.
      "tiers": [
        // Example tiers adjusted for this currency.
      ]
    }
    // Additional currency variants as needed.
  ],
  
  "description": "Description of the Plan", // Optional: Provides a brief overview of what the plan offers.
  "invoice_name": "Invoice Name", // Required: The name displayed on invoices for this plan, ensuring clarity for subscribers.
  
  "metadata": { // Optional: Allows for the inclusion of arbitrary key-value pairs for additional plan data.
    "category": "SaaS",
    "target_market": "Small Businesses",
    "features": "Unlimited API Calls, Premium Support"
    // This demonstrates including multiple key-value pairs to provide additional information about the plan.
  }
}
Leave a Comment