Skip to main content
POST
/
subscription_configs
Create subscription configuration
curl --request POST \
  --url https://api.lava.so/v1/subscription_configs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Pro Plan",
  "period_amount": "49.00",
  "billing_interval": "month",
  "rollover_type": "full",
  "bundle_rollover_type": "full",
  "included_credit": "<string>",
  "product_ids": [
    "<string>"
  ],
  "credit_bundles": [
    {
      "name": "<string>",
      "cost": "<string>",
      "credit_amount": "<string>"
    }
  ]
}
'
{
  "subscription_config_id": "<string>",
  "merchant_id": "<string>",
  "name": "<string>",
  "period_amount": "<string>",
  "included_credit": "<string>",
  "billing_interval": "day",
  "rollover_type": "full",
  "bundle_rollover_type": "full",
  "linked_meters": [
    {
      "meter_id": "<string>",
      "name": "<string>"
    }
  ],
  "credit_bundles": [
    {
      "credit_bundle_id": "<string>",
      "name": "<string>",
      "cost": "<string>",
      "credit_amount": "<string>"
    }
  ],
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer token authentication used for standard API calls. Format: 'Bearer YOUR_API_KEY'

Body

application/json
name
string
required

Name of the subscription configuration

Example:

"Pro Plan"

period_amount
string
required

Price per billing period in USD (high precision decimal as string). Use "0" for free plans.

Example:

"49.00"

billing_interval
enum<string>
required

How often the subscription is billed

Available options:
day,
week,
month,
year
Example:

"month"

rollover_type
enum<string>

Whether unused included credit rolls over to the next billing cycle. Defaults to "none".

Available options:
full,
none
bundle_rollover_type
enum<string>

Whether unused bundle credit rolls over to the next billing cycle. Defaults to "none".

Available options:
full,
none
included_credit
string

Credit included per billing cycle in USD (high precision decimal as string). Defaults to period_amount.

product_ids
string[]

Meter IDs to link to this subscription configuration

credit_bundles
object[]

Credit bundles to create with this configuration

Response

Subscription configuration created

subscription_config_id
string
required

Unique identifier for the subscription configuration

merchant_id
string
required

Merchant ID that owns this configuration

name
string
required

Name of the subscription configuration

period_amount
string
required

Period amount in USD (high precision decimal as string)

included_credit
string
required

Included credit per billing cycle in USD (high precision decimal as string)

billing_interval
enum<string>
required

How often the subscription is billed

Available options:
day,
week,
month,
year
rollover_type
enum<string>
required

Cycle rollover: whether unused included credit rolls to next cycle

Available options:
full,
none
bundle_rollover_type
enum<string>
required

Bundle rollover: whether unused bundle credit rolls to next cycle

Available options:
full,
none
linked_meters
object[]
required

Meters linked to this subscription configuration

credit_bundles
object[]
required

Credit bundles available for this subscription configuration

created_at
string<date-time>
required

When the configuration was created