8303 lines
294 KiB
YAML
8303 lines
294 KiB
YAML
openapi: 3.1.0
|
|
info:
|
|
title: Autumn API
|
|
version: 2.0.0
|
|
servers:
|
|
- url: https://api.useautumn.com/v1
|
|
description: Production server
|
|
security:
|
|
- secretKey: []
|
|
paths:
|
|
/plans:
|
|
get:
|
|
summary: List Plans
|
|
tags:
|
|
- plans
|
|
parameters:
|
|
- in: query
|
|
name: customer_id
|
|
schema:
|
|
type: string
|
|
- in: query
|
|
name: entity_id
|
|
schema:
|
|
internal: true
|
|
type: string
|
|
- in: query
|
|
name: include_archived
|
|
schema:
|
|
internal: true
|
|
type: boolean
|
|
- in: query
|
|
name: v1_schema
|
|
schema:
|
|
internal: true
|
|
type: boolean
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
list:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Plan"
|
|
required:
|
|
- list
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.plans.list();
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
plans = autumn.plans.list()
|
|
|
|
print(plans.list)
|
|
post:
|
|
summary: Create Product
|
|
tags:
|
|
- products
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
pattern: ^[a-zA-Z0-9_-]+$
|
|
group:
|
|
default: ""
|
|
type: string
|
|
name:
|
|
type: string
|
|
description:
|
|
default: null
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
add_on:
|
|
default: false
|
|
type: boolean
|
|
default:
|
|
default: false
|
|
type: boolean
|
|
price:
|
|
type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
required:
|
|
- amount
|
|
- interval
|
|
features:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
granted_balance:
|
|
type: number
|
|
unlimited:
|
|
type: boolean
|
|
reset:
|
|
type: object
|
|
properties:
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
reset_when_enabled:
|
|
type: boolean
|
|
required:
|
|
- interval
|
|
price:
|
|
type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
tiers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
default: 1
|
|
type: number
|
|
billing_units:
|
|
default: 1
|
|
type: number
|
|
usage_model:
|
|
type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
max_purchase:
|
|
type: number
|
|
required:
|
|
- interval
|
|
- usage_model
|
|
proration:
|
|
type: object
|
|
properties:
|
|
on_increase:
|
|
type: string
|
|
enum:
|
|
- bill_immediately
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- bill_next_cycle
|
|
on_decrease:
|
|
type: string
|
|
enum:
|
|
- prorate
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- none
|
|
- no_prorations
|
|
required:
|
|
- on_increase
|
|
- on_decrease
|
|
rollover:
|
|
type: object
|
|
properties:
|
|
max:
|
|
type: number
|
|
expiry_duration_type:
|
|
type: string
|
|
enum:
|
|
- month
|
|
- forever
|
|
expiry_duration_length:
|
|
type: number
|
|
required:
|
|
- max
|
|
- expiry_duration_type
|
|
required:
|
|
- feature_id
|
|
free_trial:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration_type:
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
duration_length:
|
|
type: number
|
|
card_required:
|
|
type: boolean
|
|
required:
|
|
- duration_type
|
|
- duration_length
|
|
- card_required
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- name
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Plan"
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.plans.create({ id: 'id', name:
|
|
'name' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
plan = autumn.plans.create(
|
|
id="id",
|
|
name="name",
|
|
)
|
|
|
|
print(plan.id)
|
|
/plans/{plan_id}:
|
|
get:
|
|
summary: Get Plan
|
|
tags:
|
|
- plans
|
|
parameters:
|
|
- in: path
|
|
name: plan_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Plan"
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.plans.get('plan_id');
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
plan = autumn.plans.get(
|
|
"plan_id",
|
|
)
|
|
|
|
print(plan.id)
|
|
post:
|
|
summary: Update Plan
|
|
tags:
|
|
- plans
|
|
parameters:
|
|
- in: path
|
|
name: plan_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
pattern: ^[a-zA-Z0-9_-]+$
|
|
group:
|
|
default: ""
|
|
type: string
|
|
name:
|
|
type: string
|
|
description:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
version:
|
|
type: number
|
|
add_on:
|
|
default: false
|
|
type: boolean
|
|
default:
|
|
default: false
|
|
type: boolean
|
|
archived:
|
|
default: false
|
|
type: boolean
|
|
price:
|
|
type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
features:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
granted_balance:
|
|
type: number
|
|
unlimited:
|
|
type: boolean
|
|
reset:
|
|
type: object
|
|
properties:
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
reset_when_enabled:
|
|
type: boolean
|
|
required:
|
|
- interval
|
|
price:
|
|
type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
tiers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
default: 1
|
|
type: number
|
|
billing_units:
|
|
default: 1
|
|
type: number
|
|
usage_model:
|
|
type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
max_purchase:
|
|
type: number
|
|
required:
|
|
- interval
|
|
- usage_model
|
|
proration:
|
|
type: object
|
|
properties:
|
|
on_increase:
|
|
type: string
|
|
enum:
|
|
- bill_immediately
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- bill_next_cycle
|
|
on_decrease:
|
|
type: string
|
|
enum:
|
|
- prorate
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- none
|
|
- no_prorations
|
|
required:
|
|
- on_increase
|
|
- on_decrease
|
|
rollover:
|
|
type: object
|
|
properties:
|
|
max:
|
|
type: number
|
|
expiry_duration_type:
|
|
type: string
|
|
enum:
|
|
- month
|
|
- forever
|
|
expiry_duration_length:
|
|
type: number
|
|
required:
|
|
- max
|
|
- expiry_duration_type
|
|
required:
|
|
- feature_id
|
|
free_trial:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration_type:
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
duration_length:
|
|
type: number
|
|
card_required:
|
|
type: boolean
|
|
required:
|
|
- duration_type
|
|
- duration_length
|
|
- card_required
|
|
- type: "null"
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Plan"
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.plans.update('plan_id');
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
plan = autumn.plans.update(
|
|
plan_id="plan_id",
|
|
)
|
|
|
|
print(plan.id)
|
|
delete:
|
|
summary: Delete Plan
|
|
tags:
|
|
- plans
|
|
parameters:
|
|
- in: path
|
|
name: plan_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
- in: query
|
|
name: all_versions
|
|
schema:
|
|
type: boolean
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
success:
|
|
type: boolean
|
|
required:
|
|
- success
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.plans.delete('plan_id');
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
plan = autumn.plans.delete(
|
|
plan_id="plan_id",
|
|
)
|
|
|
|
print(plan.success)
|
|
/customers:
|
|
post:
|
|
summary: Create Customer
|
|
tags:
|
|
- customers
|
|
parameters:
|
|
- in: query
|
|
name: expand
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: string
|
|
enum:
|
|
- invoices
|
|
- trials_used
|
|
- rewards
|
|
- entities
|
|
- referrals
|
|
- payment_method
|
|
- upcoming_invoice
|
|
- subscriptions.plan
|
|
- scheduled_subscriptions.plan
|
|
- balances.feature
|
|
- in: query
|
|
name: with_autumn_id
|
|
schema:
|
|
internal: true
|
|
default: false
|
|
type: boolean
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: Your unique identifier for the customer
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
name:
|
|
description: Customer's name
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
email:
|
|
description: Customer's email address
|
|
anyOf:
|
|
- type: string
|
|
format: email
|
|
pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
|
|
- type: "null"
|
|
fingerprint:
|
|
description: Unique identifier (eg, serial number) to detect duplicate customers
|
|
and prevent free trial abuse
|
|
type: string
|
|
metadata:
|
|
description: Additional metadata for the customer
|
|
anyOf:
|
|
- type: object
|
|
propertyNames:
|
|
type: string
|
|
additionalProperties: {}
|
|
- type: "null"
|
|
stripe_id:
|
|
description: Stripe customer ID if you already have one
|
|
type: string
|
|
required:
|
|
- id
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Customer"
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.customers.create({ id: 'id' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
customer = autumn.customers.create(
|
|
id="id",
|
|
)
|
|
|
|
print(customer.id)
|
|
/customers/list:
|
|
post:
|
|
summary: List Customers
|
|
tags:
|
|
- customers
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
offset:
|
|
description: Number of items to skip
|
|
default: 0
|
|
type: integer
|
|
limit:
|
|
description: Number of items to return. Default 10, max 1000.
|
|
default: 10
|
|
type: integer
|
|
plans:
|
|
description: Filter by plan ID and version. Returns customers with active
|
|
subscriptions to this plan.
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
versions:
|
|
type: array
|
|
items:
|
|
type: number
|
|
required:
|
|
- id
|
|
subscription_status:
|
|
description: Filter by customer product status. Defaults to active and scheduled
|
|
type: string
|
|
enum:
|
|
- active
|
|
- scheduled
|
|
search:
|
|
description: Search customers by id, name, or email
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
list:
|
|
description: Array of items for current page
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/BaseCustomer"
|
|
has_more:
|
|
description: Whether more results exist after this page
|
|
type: boolean
|
|
offset:
|
|
description: Current offset position
|
|
type: number
|
|
limit:
|
|
description: Limit passed in the request
|
|
type: number
|
|
total:
|
|
description: Total number of items returned in the current page
|
|
type: number
|
|
required:
|
|
- list
|
|
- has_more
|
|
- offset
|
|
- limit
|
|
- total
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.customers.list();
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
customers = autumn.customers.list()
|
|
|
|
print(customers.has_more)
|
|
/customers/{customer_id}:
|
|
get:
|
|
summary: Get Customer
|
|
tags:
|
|
- customers
|
|
parameters:
|
|
- in: path
|
|
name: customer_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
- in: query
|
|
name: expand
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: string
|
|
enum:
|
|
- invoices
|
|
- trials_used
|
|
- rewards
|
|
- entities
|
|
- referrals
|
|
- payment_method
|
|
- upcoming_invoice
|
|
- subscriptions.plan
|
|
- scheduled_subscriptions.plan
|
|
- balances.feature
|
|
- in: query
|
|
name: skip_cache
|
|
schema:
|
|
internal: true
|
|
type: boolean
|
|
- in: query
|
|
name: with_autumn_id
|
|
schema:
|
|
internal: true
|
|
default: false
|
|
type: boolean
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Customer"
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.customers.get('customer_id');
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
customer = autumn.customers.get(
|
|
customer_id="customer_id",
|
|
)
|
|
|
|
print(customer.id)
|
|
post:
|
|
summary: Update Customer
|
|
tags:
|
|
- customers
|
|
parameters:
|
|
- in: path
|
|
name: customer_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
- in: query
|
|
name: expand
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: New unique identifier for the customer.
|
|
type: string
|
|
name:
|
|
description: The customer's name.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
email:
|
|
description: Customer's email address
|
|
anyOf:
|
|
- type: string
|
|
format: email
|
|
pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
|
|
- type: "null"
|
|
fingerprint:
|
|
description: Unique identifier (eg, serial number) to detect duplicate
|
|
customers.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
metadata:
|
|
description: Additional metadata for the customer (set individual keys to null
|
|
to delete them).
|
|
anyOf:
|
|
- type: object
|
|
propertyNames: {}
|
|
additionalProperties: {}
|
|
- type: "null"
|
|
stripe_id:
|
|
description: Stripe customer ID.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Customer"
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await
|
|
autumn.customers.update('customer_id');
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
customer = autumn.customers.update(
|
|
customer_id="customer_id",
|
|
)
|
|
|
|
print(customer.id)
|
|
delete:
|
|
summary: Delete Customer
|
|
tags:
|
|
- customers
|
|
parameters:
|
|
- in: path
|
|
name: customer_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
success:
|
|
type: boolean
|
|
required:
|
|
- success
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await
|
|
autumn.customers.delete('customer_id');
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
customer = autumn.customers.delete(
|
|
"customer_id",
|
|
)
|
|
|
|
print(customer.success)
|
|
/customers/{customer_id}/entities:
|
|
post:
|
|
summary: Create Entity
|
|
tags:
|
|
- entities
|
|
parameters:
|
|
- in: path
|
|
name: customer_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the entity
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
name:
|
|
description: The name of the entity
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
feature_id:
|
|
description: The ID of the feature this entity is associated with
|
|
type: string
|
|
customer_data:
|
|
$ref: "#/components/schemas/CustomerData"
|
|
required:
|
|
- id
|
|
- feature_id
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Entity"
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.entities.create('customer_id',
|
|
{ id: 'id', feature_id: 'feature_id' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
entity = autumn.entities.create(
|
|
customer_id="customer_id",
|
|
id="id",
|
|
feature_id="feature_id",
|
|
)
|
|
|
|
print(entity.id)
|
|
/customers/{customer_id}/entities/{entity_id}:
|
|
get:
|
|
summary: Get Entity
|
|
tags:
|
|
- entities
|
|
parameters:
|
|
- in: path
|
|
name: customer_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
- in: path
|
|
name: entity_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
- in: query
|
|
name: expand
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: string
|
|
enum:
|
|
- invoices
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Entity"
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.entities.get("entity_id",
|
|
"customer_id");
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
entity = autumn.entities.get(
|
|
entity_id="entity_id",
|
|
customer_id="customer_id",
|
|
)
|
|
|
|
print(entity.id)
|
|
delete:
|
|
summary: Delete Entity
|
|
tags:
|
|
- entities
|
|
parameters:
|
|
- in: path
|
|
name: customer_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
- in: path
|
|
name: entity_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
success:
|
|
type: boolean
|
|
required:
|
|
- success
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.entities.delete("entity_id",
|
|
"customer_id");
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
entity = autumn.entities.delete(
|
|
entity_id="entity_id",
|
|
customer_id="customer_id",
|
|
)
|
|
|
|
print(entity.success)
|
|
/referrals/code:
|
|
post:
|
|
summary: Create a referral code
|
|
tags:
|
|
- referrals
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
description: The unique identifier of the customer
|
|
example: cus_123
|
|
type: string
|
|
program_id:
|
|
description: ID of your referral program
|
|
example: prog_123
|
|
type: string
|
|
required:
|
|
- customer_id
|
|
- program_id
|
|
responses:
|
|
"200":
|
|
description: Referral code generated successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/ReferralCode"
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.referrals.createCode({
|
|
customer_id: 'cus_123',
|
|
program_id: 'prog_123',
|
|
});
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
response = autumn.referrals.create_code(
|
|
customer_id="cus_123",
|
|
program_id="prog_123",
|
|
)
|
|
|
|
print(response.customer_id)
|
|
/referrals/redeem:
|
|
post:
|
|
summary: Redeem a referral code
|
|
tags:
|
|
- referrals
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
code:
|
|
description: The referral code to redeem
|
|
example: REF123ABC
|
|
type: string
|
|
customer_id:
|
|
description: The unique identifier of the customer redeeming the code
|
|
example: cus_456
|
|
type: string
|
|
required:
|
|
- code
|
|
- customer_id
|
|
responses:
|
|
"200":
|
|
description: Referral code redeemed successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/RedeemReferralCodeResponse"
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.referrals.redeemCode({ code:
|
|
'REF123ABC', customer_id: 'cus_456' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
response = autumn.referrals.redeem_code(
|
|
code="REF123ABC",
|
|
customer_id="cus_456",
|
|
)
|
|
|
|
print(response.id)
|
|
/attach:
|
|
post:
|
|
summary: Attach Product
|
|
description: Enables a product for a customer and processes payment if their
|
|
payment method is already on file.
|
|
tags:
|
|
- core
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
type: string
|
|
product_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
entity_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_data:
|
|
anyOf:
|
|
- $ref: "#/components/schemas/CustomerData"
|
|
- type: "null"
|
|
entity_data:
|
|
$ref: "#/components/schemas/EntityData"
|
|
product_ids:
|
|
anyOf:
|
|
- minItems: 1
|
|
type: array
|
|
items:
|
|
type: string
|
|
- type: "null"
|
|
options:
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
quantity:
|
|
type: number
|
|
upcoming_quantity:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
adjustable_quantity:
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
internal_feature_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
required:
|
|
- feature_id
|
|
- quantity
|
|
- type: "null"
|
|
free_trial:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
length:
|
|
anyOf:
|
|
- type: string
|
|
- type: number
|
|
unique_fingerprint:
|
|
default: false
|
|
type: boolean
|
|
duration:
|
|
default: day
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
card_required:
|
|
default: true
|
|
type: boolean
|
|
required:
|
|
- length
|
|
- type: boolean
|
|
success_url:
|
|
type: string
|
|
force_checkout:
|
|
type: boolean
|
|
checkout_session_params: {}
|
|
reward:
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
type: string
|
|
invoice:
|
|
type: boolean
|
|
setup_payment:
|
|
type: boolean
|
|
new_billing_subscription:
|
|
type: boolean
|
|
is_custom:
|
|
type: boolean
|
|
items:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
type:
|
|
description: The type of the product item.
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- feature
|
|
- priced_feature
|
|
- price
|
|
- type: "null"
|
|
feature_id:
|
|
description: The feature ID of the product item. Should be null for fixed price
|
|
items.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
included_usage:
|
|
description: The amount of usage included for this feature (per interval).
|
|
anyOf:
|
|
- anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
- type: "null"
|
|
interval:
|
|
description: The reset or billing interval of the product item. If null, feature
|
|
will have no reset date, and if there's a price, it
|
|
will be billed one-off.
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: "null"
|
|
interval_count:
|
|
description: Interval count of the feature.
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
entity_feature_id:
|
|
description: The feature ID of the entity (like seats) to track sub-balances
|
|
for.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
usage_model:
|
|
description: Whether the feature should be prepaid upfront or billed for how
|
|
much they use end of billing period.
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
- type: "null"
|
|
price:
|
|
description: The price of the product item. Should be null if tiered pricing is
|
|
set.
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
tiers:
|
|
description: Tiered pricing for the product item. Not applicable for fixed price
|
|
items.
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
description: The maximum amount of usage for this tier.
|
|
example: 100
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
description: The price of the product item for this tier.
|
|
example: 10
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
- type: "null"
|
|
billing_units:
|
|
description: The billing units of the product item (eg $1 for 30 credits).
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset_usage_when_enabled:
|
|
description: Whether the usage should be reset when the product is enabled.
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
version:
|
|
type: number
|
|
invoice_only:
|
|
type: boolean
|
|
metadata: {}
|
|
billing_cycle_anchor:
|
|
type: number
|
|
enable_product_immediately:
|
|
type: boolean
|
|
finalize_invoice:
|
|
type: boolean
|
|
required:
|
|
- customer_id
|
|
examples:
|
|
basic:
|
|
summary: Attach a product immediately
|
|
description: Enable a product for a customer with immediate activation
|
|
value:
|
|
customer_id: cus_123
|
|
product_id: pro_plan
|
|
responses:
|
|
"200":
|
|
description: Product attached successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
success:
|
|
type: boolean
|
|
customer_id:
|
|
type: string
|
|
product_ids:
|
|
type: array
|
|
items:
|
|
type: string
|
|
code:
|
|
type: string
|
|
message:
|
|
type: string
|
|
checkout_url:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
invoice:
|
|
anyOf:
|
|
- {}
|
|
- type: "null"
|
|
required:
|
|
- success
|
|
- customer_id
|
|
- product_ids
|
|
- code
|
|
- message
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.attach({ customer_id:
|
|
'cus_123', product_id: 'pro_plan' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
response = autumn.attach(
|
|
customer_id="cus_123",
|
|
product_id="pro_plan",
|
|
)
|
|
|
|
print(response.customer_id)
|
|
/checkout:
|
|
post:
|
|
summary: Checkout
|
|
description: Creates a checkout session for a customer to purchase a product
|
|
with payment collection.
|
|
tags:
|
|
- core
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
type: string
|
|
product_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
entity_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_data:
|
|
anyOf:
|
|
- $ref: "#/components/schemas/CustomerData"
|
|
- type: "null"
|
|
entity_data:
|
|
$ref: "#/components/schemas/EntityData"
|
|
product_ids:
|
|
anyOf:
|
|
- minItems: 1
|
|
type: array
|
|
items:
|
|
type: string
|
|
- type: "null"
|
|
options:
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
quantity:
|
|
type: number
|
|
upcoming_quantity:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
adjustable_quantity:
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
internal_feature_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
required:
|
|
- feature_id
|
|
- quantity
|
|
- type: "null"
|
|
free_trial:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
length:
|
|
anyOf:
|
|
- type: string
|
|
- type: number
|
|
unique_fingerprint:
|
|
default: false
|
|
type: boolean
|
|
duration:
|
|
default: day
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
card_required:
|
|
default: true
|
|
type: boolean
|
|
required:
|
|
- length
|
|
- type: boolean
|
|
success_url:
|
|
type: string
|
|
force_checkout:
|
|
type: boolean
|
|
checkout_session_params: {}
|
|
reward:
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
type: string
|
|
invoice:
|
|
type: boolean
|
|
setup_payment:
|
|
type: boolean
|
|
new_billing_subscription:
|
|
type: boolean
|
|
is_custom:
|
|
type: boolean
|
|
items:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
type:
|
|
description: The type of the product item.
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- feature
|
|
- priced_feature
|
|
- price
|
|
- type: "null"
|
|
feature_id:
|
|
description: The feature ID of the product item. Should be null for fixed price
|
|
items.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
included_usage:
|
|
description: The amount of usage included for this feature (per interval).
|
|
anyOf:
|
|
- anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
- type: "null"
|
|
interval:
|
|
description: The reset or billing interval of the product item. If null, feature
|
|
will have no reset date, and if there's a price, it
|
|
will be billed one-off.
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: "null"
|
|
interval_count:
|
|
description: Interval count of the feature.
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
entity_feature_id:
|
|
description: The feature ID of the entity (like seats) to track sub-balances
|
|
for.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
usage_model:
|
|
description: Whether the feature should be prepaid upfront or billed for how
|
|
much they use end of billing period.
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
- type: "null"
|
|
price:
|
|
description: The price of the product item. Should be null if tiered pricing is
|
|
set.
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
tiers:
|
|
description: Tiered pricing for the product item. Not applicable for fixed price
|
|
items.
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
description: The maximum amount of usage for this tier.
|
|
example: 100
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
description: The price of the product item for this tier.
|
|
example: 10
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
- type: "null"
|
|
billing_units:
|
|
description: The billing units of the product item (eg $1 for 30 credits).
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset_usage_when_enabled:
|
|
description: Whether the usage should be reset when the product is enabled.
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
version:
|
|
type: number
|
|
invoice_only:
|
|
type: boolean
|
|
metadata: {}
|
|
billing_cycle_anchor:
|
|
type: number
|
|
enable_product_immediately:
|
|
type: boolean
|
|
finalize_invoice:
|
|
type: boolean
|
|
required:
|
|
- customer_id
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
url:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_id:
|
|
type: string
|
|
lines:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
description:
|
|
type: string
|
|
amount:
|
|
type: number
|
|
item:
|
|
anyOf:
|
|
- $ref: "#/components/schemas/ProductItem"
|
|
- type: "null"
|
|
required:
|
|
- description
|
|
- amount
|
|
additionalProperties: false
|
|
product:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the product you set when creating the product
|
|
type: string
|
|
name:
|
|
description: The name of the product
|
|
type: string
|
|
group:
|
|
description: Product group which this product belongs to
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
env:
|
|
description: The environment of the product
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
is_add_on:
|
|
description: Whether the product is an add-on and can be purchased alongside
|
|
other products
|
|
type: boolean
|
|
is_default:
|
|
description: Whether the product is the default product
|
|
type: boolean
|
|
archived:
|
|
description: Whether this product has been archived and is no longer available
|
|
type: boolean
|
|
version:
|
|
description: The current version of the product
|
|
type: number
|
|
created_at:
|
|
description: The timestamp of when the product was created in milliseconds since
|
|
epoch
|
|
type: number
|
|
items:
|
|
description: Array of product items that define the product's features and
|
|
pricing
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/ProductItem"
|
|
free_trial:
|
|
description: Free trial configuration for this product, if available
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration:
|
|
description: The duration type of the free trial
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
length:
|
|
description: The length of the duration type specified
|
|
type: number
|
|
unique_fingerprint:
|
|
description: Whether the free trial is limited to one per customer fingerprint
|
|
type: boolean
|
|
card_required:
|
|
description: Whether the free trial requires a card. If false, the customer can
|
|
attach the product without going through a
|
|
checkout flow or having a card on file.
|
|
type: boolean
|
|
trial_available:
|
|
description: Used in customer context. Whether the free trial is available for
|
|
the customer if they were to attach the
|
|
product.
|
|
default: true
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- duration
|
|
- length
|
|
- unique_fingerprint
|
|
- card_required
|
|
- trial_available
|
|
additionalProperties: false
|
|
- type: "null"
|
|
base_variant_id:
|
|
description: ID of the base variant this product is derived from
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
scenario:
|
|
description: Scenario for when this product is used in attach flows
|
|
type: string
|
|
enum:
|
|
- scheduled
|
|
- active
|
|
- new
|
|
- renew
|
|
- upgrade
|
|
- downgrade
|
|
- cancel
|
|
- expired
|
|
- past_due
|
|
properties:
|
|
type: object
|
|
properties:
|
|
is_free:
|
|
description: True if the product has no base price or usage prices
|
|
example: false
|
|
type: boolean
|
|
is_one_off:
|
|
description: True if the product only contains a one-time price
|
|
example: false
|
|
type: boolean
|
|
interval_group:
|
|
description: The billing interval group for recurring products (e.g., 'monthly',
|
|
'yearly')
|
|
example: monthly
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
has_trial:
|
|
description: True if the product includes a free trial
|
|
example: true
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
updateable:
|
|
description: True if the product can be updated after creation (only applicable
|
|
if there are prepaid recurring prices)
|
|
example: true
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- is_free
|
|
- is_one_off
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- group
|
|
- env
|
|
- is_add_on
|
|
- is_default
|
|
- archived
|
|
- version
|
|
- created_at
|
|
- items
|
|
- free_trial
|
|
- base_variant_id
|
|
additionalProperties: false
|
|
- type: "null"
|
|
current_product:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the product you set when creating the product
|
|
type: string
|
|
name:
|
|
description: The name of the product
|
|
type: string
|
|
group:
|
|
description: Product group which this product belongs to
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
env:
|
|
description: The environment of the product
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
is_add_on:
|
|
description: Whether the product is an add-on and can be purchased alongside
|
|
other products
|
|
type: boolean
|
|
is_default:
|
|
description: Whether the product is the default product
|
|
type: boolean
|
|
archived:
|
|
description: Whether this product has been archived and is no longer available
|
|
type: boolean
|
|
version:
|
|
description: The current version of the product
|
|
type: number
|
|
created_at:
|
|
description: The timestamp of when the product was created in milliseconds since
|
|
epoch
|
|
type: number
|
|
items:
|
|
description: Array of product items that define the product's features and
|
|
pricing
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/ProductItem"
|
|
free_trial:
|
|
description: Free trial configuration for this product, if available
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration:
|
|
description: The duration type of the free trial
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
length:
|
|
description: The length of the duration type specified
|
|
type: number
|
|
unique_fingerprint:
|
|
description: Whether the free trial is limited to one per customer fingerprint
|
|
type: boolean
|
|
card_required:
|
|
description: Whether the free trial requires a card. If false, the customer can
|
|
attach the product without going through a
|
|
checkout flow or having a card on file.
|
|
type: boolean
|
|
trial_available:
|
|
description: Used in customer context. Whether the free trial is available for
|
|
the customer if they were to attach the
|
|
product.
|
|
default: true
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- duration
|
|
- length
|
|
- unique_fingerprint
|
|
- card_required
|
|
- trial_available
|
|
additionalProperties: false
|
|
- type: "null"
|
|
base_variant_id:
|
|
description: ID of the base variant this product is derived from
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
scenario:
|
|
description: Scenario for when this product is used in attach flows
|
|
type: string
|
|
enum:
|
|
- scheduled
|
|
- active
|
|
- new
|
|
- renew
|
|
- upgrade
|
|
- downgrade
|
|
- cancel
|
|
- expired
|
|
- past_due
|
|
properties:
|
|
type: object
|
|
properties:
|
|
is_free:
|
|
description: True if the product has no base price or usage prices
|
|
example: false
|
|
type: boolean
|
|
is_one_off:
|
|
description: True if the product only contains a one-time price
|
|
example: false
|
|
type: boolean
|
|
interval_group:
|
|
description: The billing interval group for recurring products (e.g., 'monthly',
|
|
'yearly')
|
|
example: monthly
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
has_trial:
|
|
description: True if the product includes a free trial
|
|
example: true
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
updateable:
|
|
description: True if the product can be updated after creation (only applicable
|
|
if there are prepaid recurring prices)
|
|
example: true
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- is_free
|
|
- is_one_off
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- group
|
|
- env
|
|
- is_add_on
|
|
- is_default
|
|
- archived
|
|
- version
|
|
- created_at
|
|
- items
|
|
- free_trial
|
|
- base_variant_id
|
|
additionalProperties: false
|
|
- type: "null"
|
|
options:
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
quantity:
|
|
type: number
|
|
upcoming_quantity:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
adjustable_quantity:
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
internal_feature_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
required:
|
|
- feature_id
|
|
- quantity
|
|
additionalProperties: false
|
|
- type: "null"
|
|
total:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
currency:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
has_prorations:
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
next_cycle:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
starts_at:
|
|
type: number
|
|
total:
|
|
type: number
|
|
required:
|
|
- starts_at
|
|
- total
|
|
additionalProperties: false
|
|
- type: "null"
|
|
required:
|
|
- customer_id
|
|
- lines
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.checkout({ customer_id:
|
|
'customer_id' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
response = autumn.checkout(
|
|
customer_id="customer_id",
|
|
)
|
|
|
|
print(response.customer_id)
|
|
/cancel:
|
|
post:
|
|
summary: Cancel Product
|
|
description: Cancel a customer's subscription to a product.
|
|
tags:
|
|
- core
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
description: The ID of the customer
|
|
example: cus_123
|
|
type: string
|
|
product_id:
|
|
description: The ID of the product to cancel
|
|
example: pro_plan
|
|
type: string
|
|
entity_id:
|
|
description: The ID of the entity (optional)
|
|
example: entity_123
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
cancel_immediately:
|
|
description: Whether to cancel the product immediately or at period end
|
|
example: false
|
|
type: boolean
|
|
prorate:
|
|
description: Whether to prorate the cancellation (defaults to true if not
|
|
specified)
|
|
example: true
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- customer_id
|
|
- product_id
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
success:
|
|
description: Whether the cancellation was successful
|
|
example: true
|
|
type: boolean
|
|
customer_id:
|
|
description: The ID of the customer
|
|
example: cus_123
|
|
type: string
|
|
product_id:
|
|
description: The ID of the canceled product
|
|
example: pro_plan
|
|
type: string
|
|
required:
|
|
- success
|
|
- customer_id
|
|
- product_id
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.cancel({ customer_id:
|
|
'cus_123', product_id: 'pro_plan' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
response = autumn.cancel(
|
|
customer_id="cus_123",
|
|
product_id="pro_plan",
|
|
)
|
|
|
|
print(response.customer_id)
|
|
/track:
|
|
post:
|
|
summary: Track Event
|
|
tags:
|
|
- core
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
description: ID which you provided when creating the customer
|
|
type: string
|
|
feature_id:
|
|
description: ID of the feature to track usage for. Required if event_name is not
|
|
provided. Use this for direct feature tracking.
|
|
type: string
|
|
event_name:
|
|
description: An [event name](/features/tracking-usage#using-event-names) can be
|
|
used in place of feature_id. This can be used if multiple
|
|
features are tracked in the same event.
|
|
type: string
|
|
value:
|
|
description: The amount of usage to record. Defaults to 1. Can be negative to
|
|
increase the balance (e.g., when removing a seat).
|
|
type: number
|
|
properties:
|
|
description: Additional properties to attach to this usage event.
|
|
type: object
|
|
propertyNames:
|
|
type: string
|
|
additionalProperties: {}
|
|
idempotency_key:
|
|
description: Unique key to prevent duplicate event recording. Use this to safely
|
|
retry requests without creating duplicate usage records.
|
|
type: string
|
|
customer_data:
|
|
description: Additional customer properties. These will be used to create or
|
|
update the customer if they don't exist or their properties
|
|
are not already set.
|
|
$ref: "#/components/schemas/CustomerData"
|
|
entity_id:
|
|
description: If using [entity balances](/features/feature-entities) (eg, seats),
|
|
the entity ID to track usage for.
|
|
type: string
|
|
overage_behavior:
|
|
description: How to handle usage when balance is insufficient. 'cap' limits
|
|
usage to available balance, 'reject' prevents the usage
|
|
entirely.
|
|
type: string
|
|
enum:
|
|
- cap
|
|
- reject
|
|
required:
|
|
- customer_id
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
description: The ID of the customer
|
|
type: string
|
|
entity_id:
|
|
description: The ID of the entity (if provided)
|
|
type: string
|
|
event_name:
|
|
description: The name of the event
|
|
type: string
|
|
value:
|
|
type: number
|
|
balance:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- boolean
|
|
- metered
|
|
- credit_system
|
|
consumable:
|
|
type: boolean
|
|
event_names:
|
|
type: array
|
|
items:
|
|
type: string
|
|
credit_schema:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
type: string
|
|
credit_cost:
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
display:
|
|
type: object
|
|
properties:
|
|
singular:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
plural:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
additionalProperties: false
|
|
archived:
|
|
type: boolean
|
|
required:
|
|
- id
|
|
- name
|
|
- type
|
|
- consumable
|
|
- archived
|
|
additionalProperties: false
|
|
unlimited:
|
|
type: boolean
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
breakdown:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
default: ""
|
|
type: string
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
prepaid_quantity:
|
|
default: 0
|
|
type: number
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- plan_id
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- prepaid_quantity
|
|
- expires_at
|
|
additionalProperties: false
|
|
rollovers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
balance:
|
|
type: number
|
|
expires_at:
|
|
type: number
|
|
required:
|
|
- balance
|
|
- expires_at
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- unlimited
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- plan_id
|
|
additionalProperties: false
|
|
- type: "null"
|
|
balances:
|
|
type: object
|
|
propertyNames:
|
|
type: string
|
|
additionalProperties:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- boolean
|
|
- metered
|
|
- credit_system
|
|
consumable:
|
|
type: boolean
|
|
event_names:
|
|
type: array
|
|
items:
|
|
type: string
|
|
credit_schema:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
type: string
|
|
credit_cost:
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
display:
|
|
type: object
|
|
properties:
|
|
singular:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
plural:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
additionalProperties: false
|
|
archived:
|
|
type: boolean
|
|
required:
|
|
- id
|
|
- name
|
|
- type
|
|
- consumable
|
|
- archived
|
|
additionalProperties: false
|
|
unlimited:
|
|
type: boolean
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
breakdown:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
default: ""
|
|
type: string
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
prepaid_quantity:
|
|
default: 0
|
|
type: number
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- plan_id
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- prepaid_quantity
|
|
- expires_at
|
|
additionalProperties: false
|
|
rollovers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
balance:
|
|
type: number
|
|
expires_at:
|
|
type: number
|
|
required:
|
|
- balance
|
|
- expires_at
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- unlimited
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- plan_id
|
|
additionalProperties: false
|
|
required:
|
|
- customer_id
|
|
- value
|
|
- balance
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.track({ customer_id: 'x' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
response = autumn.track(
|
|
customer_id="x",
|
|
)
|
|
|
|
print(response.customer_id)
|
|
/query:
|
|
post:
|
|
summary: Query Analytics
|
|
description: Query usage analytics for a customer's features over a specified
|
|
time range.
|
|
tags:
|
|
- core
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
description: The ID of the customer to query analytics for
|
|
example: cus_123
|
|
type: string
|
|
feature_id:
|
|
description: The feature ID(s) to query
|
|
example: api_calls
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
type: string
|
|
range:
|
|
description: Time range for the query (defaults to last_cycle if not provided)
|
|
example: 7d
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- 24h
|
|
- 7d
|
|
- 30d
|
|
- 90d
|
|
- last_cycle
|
|
- type: "null"
|
|
required:
|
|
- customer_id
|
|
- feature_id
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
list:
|
|
description: List of usage data points
|
|
example:
|
|
- period: 1717000000000
|
|
count: 100
|
|
type: array
|
|
items: {}
|
|
required:
|
|
- list
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.query({ customer_id: 'cus_123',
|
|
feature_id: 'api_calls' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
response = autumn.query(
|
|
customer_id="cus_123",
|
|
feature_id="api_calls",
|
|
)
|
|
|
|
print(response.list)
|
|
/check:
|
|
post:
|
|
summary: Check Feature Access
|
|
description: Creates a checkout session for a customer to purchase a product
|
|
with payment collection.
|
|
tags:
|
|
- core
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
description: ID which you provided when creating the customer
|
|
type: string
|
|
feature_id:
|
|
description: ID of the feature to check access to. Required if product_id is not
|
|
provided.
|
|
type: string
|
|
entity_id:
|
|
description: If using entity balances (eg, seats), the entity ID to check access
|
|
for.
|
|
type: string
|
|
customer_data:
|
|
description: Properties used if customer is automatically created. Will also
|
|
update if the name or email is not already set.
|
|
$ref: "#/components/schemas/CustomerData"
|
|
required_balance:
|
|
description: If you know the amount of the feature the end user is consuming in
|
|
advance. If their balance is below this quantity, allowed
|
|
will be false.
|
|
type: number
|
|
send_event:
|
|
description: If true, a usage event will be recorded together with checking
|
|
access. The required_balance field will be used as the usage
|
|
value.
|
|
type: boolean
|
|
with_preview:
|
|
description: If true, the response will include a preview object, which can be
|
|
used to display information such as a paywall or upgrade
|
|
confirmation.
|
|
type: boolean
|
|
required:
|
|
- customer_id
|
|
- feature_id
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
allowed:
|
|
type: boolean
|
|
customer_id:
|
|
type: string
|
|
entity_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
required_balance:
|
|
type: number
|
|
balance:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- boolean
|
|
- metered
|
|
- credit_system
|
|
consumable:
|
|
type: boolean
|
|
event_names:
|
|
type: array
|
|
items:
|
|
type: string
|
|
credit_schema:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
type: string
|
|
credit_cost:
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
display:
|
|
type: object
|
|
properties:
|
|
singular:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
plural:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
additionalProperties: false
|
|
archived:
|
|
type: boolean
|
|
required:
|
|
- id
|
|
- name
|
|
- type
|
|
- consumable
|
|
- archived
|
|
additionalProperties: false
|
|
unlimited:
|
|
type: boolean
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
breakdown:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
default: ""
|
|
type: string
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
prepaid_quantity:
|
|
default: 0
|
|
type: number
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- plan_id
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- prepaid_quantity
|
|
- expires_at
|
|
additionalProperties: false
|
|
rollovers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
balance:
|
|
type: number
|
|
expires_at:
|
|
type: number
|
|
required:
|
|
- balance
|
|
- expires_at
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- unlimited
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- plan_id
|
|
additionalProperties: false
|
|
- type: "null"
|
|
preview:
|
|
type: object
|
|
properties:
|
|
scenario:
|
|
type: string
|
|
enum:
|
|
- usage_limit
|
|
- feature_flag
|
|
title:
|
|
type: string
|
|
message:
|
|
type: string
|
|
feature_id:
|
|
type: string
|
|
feature_name:
|
|
type: string
|
|
products:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the product you set when creating the product
|
|
type: string
|
|
name:
|
|
description: The name of the product
|
|
type: string
|
|
group:
|
|
description: Product group which this product belongs to
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
env:
|
|
description: The environment of the product
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
is_add_on:
|
|
description: Whether the product is an add-on and can be purchased alongside
|
|
other products
|
|
type: boolean
|
|
is_default:
|
|
description: Whether the product is the default product
|
|
type: boolean
|
|
archived:
|
|
description: Whether this product has been archived and is no longer available
|
|
type: boolean
|
|
version:
|
|
description: The current version of the product
|
|
type: number
|
|
created_at:
|
|
description: The timestamp of when the product was created in milliseconds since
|
|
epoch
|
|
type: number
|
|
items:
|
|
description: Array of product items that define the product's features and
|
|
pricing
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/ProductItem"
|
|
free_trial:
|
|
description: Free trial configuration for this product, if available
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration:
|
|
description: The duration type of the free trial
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
length:
|
|
description: The length of the duration type specified
|
|
type: number
|
|
unique_fingerprint:
|
|
description: Whether the free trial is limited to one per customer fingerprint
|
|
type: boolean
|
|
card_required:
|
|
description: Whether the free trial requires a card. If false, the customer can
|
|
attach the product without going through
|
|
a checkout flow or having a card on
|
|
file.
|
|
type: boolean
|
|
trial_available:
|
|
description: Used in customer context. Whether the free trial is available for
|
|
the customer if they were to attach the
|
|
product.
|
|
default: true
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- duration
|
|
- length
|
|
- unique_fingerprint
|
|
- card_required
|
|
- trial_available
|
|
additionalProperties: false
|
|
- type: "null"
|
|
base_variant_id:
|
|
description: ID of the base variant this product is derived from
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
scenario:
|
|
description: Scenario for when this product is used in attach flows
|
|
type: string
|
|
enum:
|
|
- scheduled
|
|
- active
|
|
- new
|
|
- renew
|
|
- upgrade
|
|
- downgrade
|
|
- cancel
|
|
- expired
|
|
- past_due
|
|
properties:
|
|
type: object
|
|
properties:
|
|
is_free:
|
|
description: True if the product has no base price or usage prices
|
|
example: false
|
|
type: boolean
|
|
is_one_off:
|
|
description: True if the product only contains a one-time price
|
|
example: false
|
|
type: boolean
|
|
interval_group:
|
|
description: The billing interval group for recurring products (e.g., 'monthly',
|
|
'yearly')
|
|
example: monthly
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
has_trial:
|
|
description: True if the product includes a free trial
|
|
example: true
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
updateable:
|
|
description: True if the product can be updated after creation (only applicable
|
|
if there are prepaid recurring prices)
|
|
example: true
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- is_free
|
|
- is_one_off
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- group
|
|
- env
|
|
- is_add_on
|
|
- is_default
|
|
- archived
|
|
- version
|
|
- created_at
|
|
- items
|
|
- free_trial
|
|
- base_variant_id
|
|
additionalProperties: false
|
|
required:
|
|
- scenario
|
|
- title
|
|
- message
|
|
- feature_id
|
|
- feature_name
|
|
- products
|
|
additionalProperties: false
|
|
required:
|
|
- allowed
|
|
- customer_id
|
|
- balance
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.check({ customer_id:
|
|
'customer_id', feature_id: 'feature_id' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
response = autumn.check(
|
|
customer_id="customer_id",
|
|
feature_id="feature_id",
|
|
)
|
|
|
|
print(response.customer_id)
|
|
/setup_payment:
|
|
post:
|
|
summary: Setup Payment Method
|
|
description: Creates a session for a customer to add or update their payment method.
|
|
tags:
|
|
- core
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
description: The ID of the customer
|
|
type: string
|
|
success_url:
|
|
description: URL to redirect to after successful payment setup. Must start with
|
|
either http:// or https://
|
|
type: string
|
|
customer_data:
|
|
$ref: "#/components/schemas/CustomerData"
|
|
checkout_session_params:
|
|
description: Additional parameters for the checkout session
|
|
type: object
|
|
propertyNames:
|
|
type: string
|
|
additionalProperties: {}
|
|
required:
|
|
- customer_id
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
description: The ID of the customer
|
|
type: string
|
|
url:
|
|
description: URL to the payment setup page
|
|
type: string
|
|
required:
|
|
- customer_id
|
|
- url
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.setupPayment({ customer_id:
|
|
'customer_id' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
response = autumn.setup_payment(
|
|
customer_id="customer_id",
|
|
)
|
|
|
|
print(response.customer_id)
|
|
/customers/{customer_id}/billing_portal:
|
|
post:
|
|
summary: Create Billing Portal Session
|
|
description: Creates a billing portal session where customers can manage their
|
|
subscription and payment methods.
|
|
tags:
|
|
- core
|
|
parameters:
|
|
- in: path
|
|
name: customer_id
|
|
schema:
|
|
type: string
|
|
required: true
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
configuration_id:
|
|
description: Stripe billing portal configuration ID. Create configurations in
|
|
your Stripe dashboard.
|
|
type: string
|
|
return_url:
|
|
description: URL to redirect to when back button is clicked in the billing
|
|
portal
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: 200 OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
description: The ID of the customer
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
url:
|
|
description: URL to the billing portal
|
|
type: string
|
|
required:
|
|
- customer_id
|
|
- url
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.billingPortal('customer_id');
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
response = autumn.billing_portal(
|
|
customer_id="customer_id",
|
|
)
|
|
|
|
print(response.customer_id)
|
|
/balances/update:
|
|
post:
|
|
summary: Update Balance
|
|
description: Update or set the balance or usage for a specific feature for a
|
|
customer. Either current_balance or usage must be provided, but not
|
|
both.
|
|
tags:
|
|
- balances
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
description: The ID of the customer.
|
|
type: string
|
|
entity_id:
|
|
description: The ID of the entity to update balance for (if using entity
|
|
balances).
|
|
type: string
|
|
feature_id:
|
|
description: The ID of the feature to update balance for.
|
|
type: string
|
|
current_balance:
|
|
description: The new balance value to set.
|
|
type: number
|
|
interval:
|
|
description: The interval to update balance for.
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
required:
|
|
- customer_id
|
|
- feature_id
|
|
responses:
|
|
"200":
|
|
description: Balance updated successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
success:
|
|
type: boolean
|
|
required:
|
|
- success
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.balances.update({
|
|
customer_id: 'customer_id',
|
|
feature_id: 'feature_id',
|
|
});
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
balance = autumn.balances.update(
|
|
customer_id="customer_id",
|
|
feature_id="feature_id",
|
|
)
|
|
|
|
print(balance.success)
|
|
/balances/create:
|
|
post:
|
|
summary: Create Balance
|
|
description: Create a new balance for a specific feature for a customer.
|
|
tags:
|
|
- balances
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
description: The feature ID to create the balance for
|
|
type: string
|
|
customer_id:
|
|
description: The customer ID to assign the balance to
|
|
type: string
|
|
entity_id:
|
|
description: Entity ID for entity-scoped balances
|
|
type: string
|
|
granted_balance:
|
|
description: The initial balance amount to grant
|
|
type: number
|
|
unlimited:
|
|
description: Whether the balance is unlimited
|
|
type: boolean
|
|
reset:
|
|
description: Reset configuration for the balance
|
|
type: object
|
|
properties:
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
required:
|
|
- interval
|
|
expires_at:
|
|
description: Unix timestamp (milliseconds) when the balance expires
|
|
type: number
|
|
required:
|
|
- feature_id
|
|
- customer_id
|
|
responses:
|
|
"200":
|
|
description: Balance created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
success:
|
|
type: boolean
|
|
required:
|
|
- success
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.balances.create({
|
|
customer_id: 'customer_id',
|
|
feature_id: 'feature_id',
|
|
});
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
balance = autumn.balances.create(
|
|
customer_id="customer_id",
|
|
feature_id="feature_id",
|
|
)
|
|
|
|
print(balance.success)
|
|
/events/list:
|
|
post:
|
|
summary: List Events
|
|
tags:
|
|
- events
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
offset:
|
|
description: Number of items to skip
|
|
default: 0
|
|
type: integer
|
|
limit:
|
|
description: Number of items to return. Default 100, max 1000.
|
|
default: 100
|
|
type: integer
|
|
customer_id:
|
|
description: Filter events by customer ID
|
|
type: string
|
|
feature_id:
|
|
description: Filter by specific feature ID(s)
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
type: string
|
|
custom_range:
|
|
description: Filter events by time range
|
|
type: object
|
|
properties:
|
|
start:
|
|
description: Filter events after this timestamp (epoch milliseconds)
|
|
type: number
|
|
end:
|
|
description: Filter events before this timestamp (epoch milliseconds)
|
|
type: number
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
content:
|
|
application/json:
|
|
schema:
|
|
example:
|
|
list:
|
|
- id: evt_36xpk2TmuQX5zVPPQ8tCtnR5Weg
|
|
timestamp: 1765958215459
|
|
feature_id: credits
|
|
customer_id: 0pCIbS4AMAFDB1iBMNhARWZt2gDtVwQx
|
|
value: 30
|
|
properties: {}
|
|
- id: evt_36xmHxxjAkqxufDf9yHAPNfRrLM
|
|
timestamp: 1765956512057
|
|
feature_id: credits
|
|
customer_id: 0pCIbS4AMAFDB1iBMNhARWZt2gDtVwQx
|
|
value: 49
|
|
properties: {}
|
|
total: 2
|
|
has_more: false
|
|
offset: 0
|
|
limit: 100
|
|
type: object
|
|
properties:
|
|
list:
|
|
description: Array of items for current page
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: Event ID (KSUID)
|
|
type: string
|
|
timestamp:
|
|
description: Event timestamp (epoch milliseconds)
|
|
type: number
|
|
feature_id:
|
|
description: ID of the feature that the event belongs to
|
|
type: string
|
|
customer_id:
|
|
description: Customer identifier
|
|
type: string
|
|
value:
|
|
description: Event value/count
|
|
type: number
|
|
properties:
|
|
description: Event properties (JSONB)
|
|
type: object
|
|
properties: {}
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- timestamp
|
|
- feature_id
|
|
- customer_id
|
|
- value
|
|
- properties
|
|
additionalProperties: false
|
|
has_more:
|
|
description: Whether more results exist after this page
|
|
type: boolean
|
|
offset:
|
|
description: Current offset position
|
|
type: number
|
|
limit:
|
|
description: Limit passed in the request
|
|
type: number
|
|
total:
|
|
description: Total number of items returned in the current page
|
|
type: number
|
|
required:
|
|
- list
|
|
- has_more
|
|
- offset
|
|
- limit
|
|
- total
|
|
additionalProperties: false
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: |-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
const autumn = new Autumn();
|
|
|
|
const { data, error } = await autumn.events.list();
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
events = autumn.events.list()
|
|
|
|
print(events.has_more)
|
|
/events/aggregate:
|
|
post:
|
|
summary: Aggregate Events
|
|
tags:
|
|
- events
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
customer_id:
|
|
description: Customer ID to aggregate events for
|
|
type: string
|
|
feature_id:
|
|
description: Feature ID(s) to aggregate events for
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
type: string
|
|
group_by:
|
|
description: Property to group events by. If provided, each key in the response
|
|
will be an object with distinct groups as the keys
|
|
type: string
|
|
pattern: ^properties\..*
|
|
range:
|
|
description: Time range to aggregate events for. Either range or custom_range
|
|
must be provided
|
|
type: string
|
|
enum:
|
|
- 24h
|
|
- 7d
|
|
- 30d
|
|
- 90d
|
|
- last_cycle
|
|
- 1bc
|
|
- 3bc
|
|
bin_size:
|
|
description: Size of the time bins to aggregate events for. Defaults to hour if
|
|
range is 24h, otherwise day
|
|
default: day
|
|
type: string
|
|
enum:
|
|
- day
|
|
- hour
|
|
- month
|
|
custom_range:
|
|
description: Custom time range to aggregate events for. If provided, range must
|
|
not be provided
|
|
type: object
|
|
properties:
|
|
start:
|
|
type: number
|
|
end:
|
|
type: number
|
|
required:
|
|
- start
|
|
- end
|
|
required:
|
|
- customer_id
|
|
- feature_id
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
content:
|
|
application/json:
|
|
schema:
|
|
example:
|
|
list:
|
|
- timestamp: 1762905600000
|
|
messages: 10
|
|
seats: 3
|
|
- timestamp: 1762992000000
|
|
messages: 3
|
|
seats: 12
|
|
total:
|
|
messages:
|
|
count: 2
|
|
sum: 13
|
|
seats:
|
|
count: 2
|
|
sum: 15
|
|
anyOf:
|
|
- $ref: "#/components/schemas/EventAggregateResponseFlat"
|
|
- $ref: "#/components/schemas/EventAggregateResponseGrouped"
|
|
x-codeSamples:
|
|
- lang: TypeScript
|
|
source: >-
|
|
import { Autumn } from 'autumn-js';
|
|
|
|
|
|
const autumn = new Autumn();
|
|
|
|
|
|
const { data, error } = await autumn.events.aggregate({ customer_id:
|
|
'x', feature_id: 'x' });
|
|
- lang: Python
|
|
source: >-
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
from autumn import Autumn
|
|
|
|
|
|
client = Autumn(
|
|
secret_key=os.environ.get("AUTUMN_SECRET_KEY"), # This is the default and can be omitted
|
|
)
|
|
|
|
response = autumn.events.aggregate(
|
|
customer_id="x",
|
|
feature_id="x",
|
|
)
|
|
|
|
print(response)
|
|
components:
|
|
schemas:
|
|
CustomerData:
|
|
description: Customer details to set when creating a customer
|
|
type: object
|
|
properties:
|
|
name:
|
|
description: Customer's name
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
email:
|
|
description: Customer's email address
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
EntityData:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
description: The feature ID that this entity is associated with
|
|
type: string
|
|
name:
|
|
description: Name of the entity
|
|
type: string
|
|
required:
|
|
- feature_id
|
|
ReferralCode:
|
|
description: Referral code object returned by the API
|
|
type: object
|
|
properties:
|
|
code:
|
|
description: The referral code that can be shared with customers
|
|
example: REF123ABC
|
|
type: string
|
|
customer_id:
|
|
description: Your unique identifier for the customer
|
|
example: cus_123
|
|
type: string
|
|
created_at:
|
|
description: The timestamp of when the referral code was created
|
|
example: 1717000000
|
|
type: number
|
|
required:
|
|
- code
|
|
- customer_id
|
|
- created_at
|
|
additionalProperties: false
|
|
RedeemReferralCodeResponse:
|
|
description: Redemption response object returned by the API
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the redemption event
|
|
example: red_123
|
|
type: string
|
|
customer_id:
|
|
description: Your unique identifier for the customer
|
|
example: cus_456
|
|
type: string
|
|
reward_id:
|
|
description: The ID of the reward that will be granted
|
|
example: reward_789
|
|
type: string
|
|
required:
|
|
- id
|
|
- customer_id
|
|
- reward_id
|
|
additionalProperties: false
|
|
ProductItem:
|
|
description: Product item defining features and pricing within a product
|
|
type: object
|
|
properties:
|
|
type:
|
|
description: The type of the product item
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- feature
|
|
- priced_feature
|
|
- price
|
|
- type: "null"
|
|
feature_id:
|
|
description: The feature ID of the product item. If the item is a fixed price,
|
|
should be `null`
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
feature_type:
|
|
description: Single use features are used once and then depleted, like API calls
|
|
or credits. Continuous use features are those being used on an
|
|
ongoing-basis, like storage or seats.
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- single_use
|
|
- continuous_use
|
|
- boolean
|
|
- static
|
|
- type: "null"
|
|
included_usage:
|
|
description: The amount of usage included for this feature.
|
|
anyOf:
|
|
- anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
- type: "null"
|
|
interval:
|
|
description: The reset or billing interval of the product item. If null, feature
|
|
will have no reset date, and if there's a price, it will be billed
|
|
one-off.
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: "null"
|
|
interval_count:
|
|
description: The interval count of the product item.
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
price:
|
|
description: The price of the product item. Should be `null` if tiered pricing
|
|
is set.
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
tiers:
|
|
description: Tiered pricing for the product item. Not applicable for fixed price
|
|
items.
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
description: The maximum amount of usage for this tier.
|
|
example: 100
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
description: The price of the product item for this tier.
|
|
example: 10
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
additionalProperties: false
|
|
- type: "null"
|
|
usage_model:
|
|
description: Whether the feature should be prepaid upfront or billed for how
|
|
much they use end of billing period.
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
- type: "null"
|
|
billing_units:
|
|
description: The amount per billing unit (eg. $9 / 250 units)
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset_usage_when_enabled:
|
|
description: Whether the usage should be reset when the product is enabled.
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
entity_feature_id:
|
|
description: The entity feature ID of the product item if applicable.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
display:
|
|
description: The display of the product item.
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
- type: "null"
|
|
quantity:
|
|
description: Used in customer context. Quantity of the feature the customer has
|
|
prepaid for.
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
next_cycle_quantity:
|
|
description: Used in customer context. Quantity of the feature the customer will
|
|
prepay for in the next cycle.
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
config:
|
|
description: Configuration for rollover and proration behavior of the feature.
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
rollover:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
max:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
duration:
|
|
default: month
|
|
type: string
|
|
enum:
|
|
- month
|
|
- forever
|
|
length:
|
|
type: number
|
|
required:
|
|
- max
|
|
- duration
|
|
- length
|
|
additionalProperties: false
|
|
- type: "null"
|
|
on_increase:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- bill_immediately
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- bill_next_cycle
|
|
- type: "null"
|
|
on_decrease:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- prorate
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- none
|
|
- no_prorations
|
|
- type: "null"
|
|
additionalProperties: false
|
|
- type: "null"
|
|
additionalProperties: false
|
|
EventAggregateResponseFlat:
|
|
title: No Group
|
|
description: Response when group_by is not provided. Feature values are numbers.
|
|
allOf:
|
|
- type: object
|
|
properties:
|
|
list:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
period:
|
|
type: number
|
|
required:
|
|
- period
|
|
additionalProperties:
|
|
type: number
|
|
required:
|
|
- list
|
|
additionalProperties: false
|
|
- type: object
|
|
properties:
|
|
total:
|
|
type: object
|
|
propertyNames:
|
|
type: string
|
|
additionalProperties:
|
|
type: object
|
|
properties:
|
|
count:
|
|
type: number
|
|
sum:
|
|
type: number
|
|
required:
|
|
- count
|
|
- sum
|
|
additionalProperties: false
|
|
required:
|
|
- total
|
|
additionalProperties: false
|
|
EventAggregateResponseGrouped:
|
|
title: With Group
|
|
description: Response when group_by is provided. Feature values are objects with
|
|
group values as keys.
|
|
allOf:
|
|
- type: object
|
|
properties:
|
|
list:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
period:
|
|
type: number
|
|
required:
|
|
- period
|
|
additionalProperties:
|
|
type: object
|
|
propertyNames:
|
|
type: string
|
|
additionalProperties:
|
|
type: number
|
|
required:
|
|
- list
|
|
additionalProperties: false
|
|
- type: object
|
|
properties:
|
|
total:
|
|
type: object
|
|
propertyNames:
|
|
type: string
|
|
additionalProperties:
|
|
type: object
|
|
properties:
|
|
count:
|
|
type: number
|
|
sum:
|
|
type: number
|
|
required:
|
|
- count
|
|
- sum
|
|
additionalProperties: false
|
|
required:
|
|
- total
|
|
additionalProperties: false
|
|
Plan:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
description:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
group:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
version:
|
|
type: number
|
|
add_on:
|
|
type: boolean
|
|
default:
|
|
type: boolean
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
required:
|
|
- amount
|
|
- interval
|
|
additionalProperties: false
|
|
- type: "null"
|
|
features:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the feature, used to refer to it in other API calls like
|
|
/track or /check.
|
|
type: string
|
|
name:
|
|
description: The name of the feature.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
type:
|
|
description: The type of the feature
|
|
type: string
|
|
enum:
|
|
- static
|
|
- boolean
|
|
- single_use
|
|
- continuous_use
|
|
- credit_system
|
|
display:
|
|
description: Singular and plural display names for the feature.
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
singular:
|
|
description: The singular display name for the feature.
|
|
type: string
|
|
plural:
|
|
description: The plural display name for the feature.
|
|
type: string
|
|
required:
|
|
- singular
|
|
- plural
|
|
additionalProperties: false
|
|
- type: "null"
|
|
credit_schema:
|
|
description: Credit cost schema for credit system features.
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
description: The ID of the metered feature (should be a single_use feature).
|
|
type: string
|
|
credit_cost:
|
|
description: The credit cost of the metered feature.
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
- type: "null"
|
|
archived:
|
|
description: Whether or not the feature is archived.
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- type
|
|
additionalProperties: false
|
|
granted_balance:
|
|
type: number
|
|
unlimited:
|
|
type: boolean
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
reset_when_enabled:
|
|
type: boolean
|
|
required:
|
|
- interval
|
|
- reset_when_enabled
|
|
additionalProperties: false
|
|
- type: "null"
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
tiers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
additionalProperties: false
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
billing_units:
|
|
type: number
|
|
usage_model:
|
|
type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- billing_units
|
|
- usage_model
|
|
- max_purchase
|
|
additionalProperties: false
|
|
- type: "null"
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
rollover:
|
|
type: object
|
|
properties:
|
|
max:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expiry_duration_type:
|
|
type: string
|
|
enum:
|
|
- month
|
|
- forever
|
|
expiry_duration_length:
|
|
type: number
|
|
required:
|
|
- max
|
|
- expiry_duration_type
|
|
additionalProperties: false
|
|
proration:
|
|
type: object
|
|
properties:
|
|
on_increase:
|
|
type: string
|
|
enum:
|
|
- bill_immediately
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- bill_next_cycle
|
|
on_decrease:
|
|
type: string
|
|
enum:
|
|
- prorate
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- none
|
|
- no_prorations
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- granted_balance
|
|
- unlimited
|
|
- reset
|
|
- price
|
|
additionalProperties: false
|
|
free_trial:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration_type:
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
duration_length:
|
|
type: number
|
|
card_required:
|
|
type: boolean
|
|
required:
|
|
- duration_type
|
|
- duration_length
|
|
- card_required
|
|
additionalProperties: false
|
|
- type: "null"
|
|
created_at:
|
|
type: number
|
|
env:
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
archived:
|
|
type: boolean
|
|
base_variant_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_eligibility:
|
|
type: object
|
|
properties:
|
|
trial_available:
|
|
type: boolean
|
|
scenario:
|
|
type: string
|
|
enum:
|
|
- scheduled
|
|
- active
|
|
- new
|
|
- renew
|
|
- upgrade
|
|
- downgrade
|
|
- cancel
|
|
- expired
|
|
- past_due
|
|
required:
|
|
- scenario
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- description
|
|
- group
|
|
- version
|
|
- add_on
|
|
- default
|
|
- price
|
|
- features
|
|
- created_at
|
|
- env
|
|
- archived
|
|
- base_variant_id
|
|
additionalProperties: false
|
|
Customer:
|
|
type: object
|
|
properties:
|
|
id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
name:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
email:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
created_at:
|
|
type: number
|
|
fingerprint:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
stripe_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
env:
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
metadata:
|
|
type: object
|
|
propertyNames: {}
|
|
additionalProperties: {}
|
|
subscriptions:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
plan:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
description:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
group:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
version:
|
|
type: number
|
|
add_on:
|
|
type: boolean
|
|
default:
|
|
type: boolean
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
required:
|
|
- amount
|
|
- interval
|
|
additionalProperties: false
|
|
- type: "null"
|
|
features:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the feature, used to refer to it in other API calls like
|
|
/track or /check.
|
|
type: string
|
|
name:
|
|
description: The name of the feature.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
type:
|
|
description: The type of the feature
|
|
type: string
|
|
enum:
|
|
- static
|
|
- boolean
|
|
- single_use
|
|
- continuous_use
|
|
- credit_system
|
|
display:
|
|
description: Singular and plural display names for the feature.
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
singular:
|
|
description: The singular display name for the feature.
|
|
type: string
|
|
plural:
|
|
description: The plural display name for the feature.
|
|
type: string
|
|
required:
|
|
- singular
|
|
- plural
|
|
additionalProperties: false
|
|
- type: "null"
|
|
credit_schema:
|
|
description: Credit cost schema for credit system features.
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
description: The ID of the metered feature (should be a single_use feature).
|
|
type: string
|
|
credit_cost:
|
|
description: The credit cost of the metered feature.
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
- type: "null"
|
|
archived:
|
|
description: Whether or not the feature is archived.
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- type
|
|
additionalProperties: false
|
|
granted_balance:
|
|
type: number
|
|
unlimited:
|
|
type: boolean
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
reset_when_enabled:
|
|
type: boolean
|
|
required:
|
|
- interval
|
|
- reset_when_enabled
|
|
additionalProperties: false
|
|
- type: "null"
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
tiers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
additionalProperties: false
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
billing_units:
|
|
type: number
|
|
usage_model:
|
|
type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- billing_units
|
|
- usage_model
|
|
- max_purchase
|
|
additionalProperties: false
|
|
- type: "null"
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
rollover:
|
|
type: object
|
|
properties:
|
|
max:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expiry_duration_type:
|
|
type: string
|
|
enum:
|
|
- month
|
|
- forever
|
|
expiry_duration_length:
|
|
type: number
|
|
required:
|
|
- max
|
|
- expiry_duration_type
|
|
additionalProperties: false
|
|
proration:
|
|
type: object
|
|
properties:
|
|
on_increase:
|
|
type: string
|
|
enum:
|
|
- bill_immediately
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- bill_next_cycle
|
|
on_decrease:
|
|
type: string
|
|
enum:
|
|
- prorate
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- none
|
|
- no_prorations
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- granted_balance
|
|
- unlimited
|
|
- reset
|
|
- price
|
|
additionalProperties: false
|
|
free_trial:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration_type:
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
duration_length:
|
|
type: number
|
|
card_required:
|
|
type: boolean
|
|
required:
|
|
- duration_type
|
|
- duration_length
|
|
- card_required
|
|
additionalProperties: false
|
|
- type: "null"
|
|
created_at:
|
|
type: number
|
|
env:
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
archived:
|
|
type: boolean
|
|
base_variant_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_eligibility:
|
|
type: object
|
|
properties:
|
|
trial_available:
|
|
type: boolean
|
|
scenario:
|
|
type: string
|
|
enum:
|
|
- scheduled
|
|
- active
|
|
- new
|
|
- renew
|
|
- upgrade
|
|
- downgrade
|
|
- cancel
|
|
- expired
|
|
- past_due
|
|
required:
|
|
- scenario
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- description
|
|
- group
|
|
- version
|
|
- add_on
|
|
- default
|
|
- price
|
|
- features
|
|
- created_at
|
|
- env
|
|
- archived
|
|
- base_variant_id
|
|
additionalProperties: false
|
|
plan_id:
|
|
type: string
|
|
default:
|
|
type: boolean
|
|
add_on:
|
|
type: boolean
|
|
status:
|
|
type: string
|
|
enum:
|
|
- active
|
|
- scheduled
|
|
- expired
|
|
past_due:
|
|
type: boolean
|
|
canceled_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
trial_ends_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
started_at:
|
|
type: number
|
|
current_period_start:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
current_period_end:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
quantity:
|
|
type: number
|
|
required:
|
|
- plan_id
|
|
- default
|
|
- add_on
|
|
- status
|
|
- past_due
|
|
- canceled_at
|
|
- expires_at
|
|
- trial_ends_at
|
|
- started_at
|
|
- current_period_start
|
|
- current_period_end
|
|
- quantity
|
|
additionalProperties: false
|
|
scheduled_subscriptions:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
plan:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
description:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
group:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
version:
|
|
type: number
|
|
add_on:
|
|
type: boolean
|
|
default:
|
|
type: boolean
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
required:
|
|
- amount
|
|
- interval
|
|
additionalProperties: false
|
|
- type: "null"
|
|
features:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the feature, used to refer to it in other API calls like
|
|
/track or /check.
|
|
type: string
|
|
name:
|
|
description: The name of the feature.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
type:
|
|
description: The type of the feature
|
|
type: string
|
|
enum:
|
|
- static
|
|
- boolean
|
|
- single_use
|
|
- continuous_use
|
|
- credit_system
|
|
display:
|
|
description: Singular and plural display names for the feature.
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
singular:
|
|
description: The singular display name for the feature.
|
|
type: string
|
|
plural:
|
|
description: The plural display name for the feature.
|
|
type: string
|
|
required:
|
|
- singular
|
|
- plural
|
|
additionalProperties: false
|
|
- type: "null"
|
|
credit_schema:
|
|
description: Credit cost schema for credit system features.
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
description: The ID of the metered feature (should be a single_use feature).
|
|
type: string
|
|
credit_cost:
|
|
description: The credit cost of the metered feature.
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
- type: "null"
|
|
archived:
|
|
description: Whether or not the feature is archived.
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- type
|
|
additionalProperties: false
|
|
granted_balance:
|
|
type: number
|
|
unlimited:
|
|
type: boolean
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
reset_when_enabled:
|
|
type: boolean
|
|
required:
|
|
- interval
|
|
- reset_when_enabled
|
|
additionalProperties: false
|
|
- type: "null"
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
tiers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
additionalProperties: false
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
billing_units:
|
|
type: number
|
|
usage_model:
|
|
type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- billing_units
|
|
- usage_model
|
|
- max_purchase
|
|
additionalProperties: false
|
|
- type: "null"
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
rollover:
|
|
type: object
|
|
properties:
|
|
max:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expiry_duration_type:
|
|
type: string
|
|
enum:
|
|
- month
|
|
- forever
|
|
expiry_duration_length:
|
|
type: number
|
|
required:
|
|
- max
|
|
- expiry_duration_type
|
|
additionalProperties: false
|
|
proration:
|
|
type: object
|
|
properties:
|
|
on_increase:
|
|
type: string
|
|
enum:
|
|
- bill_immediately
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- bill_next_cycle
|
|
on_decrease:
|
|
type: string
|
|
enum:
|
|
- prorate
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- none
|
|
- no_prorations
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- granted_balance
|
|
- unlimited
|
|
- reset
|
|
- price
|
|
additionalProperties: false
|
|
free_trial:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration_type:
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
duration_length:
|
|
type: number
|
|
card_required:
|
|
type: boolean
|
|
required:
|
|
- duration_type
|
|
- duration_length
|
|
- card_required
|
|
additionalProperties: false
|
|
- type: "null"
|
|
created_at:
|
|
type: number
|
|
env:
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
archived:
|
|
type: boolean
|
|
base_variant_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_eligibility:
|
|
type: object
|
|
properties:
|
|
trial_available:
|
|
type: boolean
|
|
scenario:
|
|
type: string
|
|
enum:
|
|
- scheduled
|
|
- active
|
|
- new
|
|
- renew
|
|
- upgrade
|
|
- downgrade
|
|
- cancel
|
|
- expired
|
|
- past_due
|
|
required:
|
|
- scenario
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- description
|
|
- group
|
|
- version
|
|
- add_on
|
|
- default
|
|
- price
|
|
- features
|
|
- created_at
|
|
- env
|
|
- archived
|
|
- base_variant_id
|
|
additionalProperties: false
|
|
plan_id:
|
|
type: string
|
|
default:
|
|
type: boolean
|
|
add_on:
|
|
type: boolean
|
|
status:
|
|
type: string
|
|
enum:
|
|
- active
|
|
- scheduled
|
|
- expired
|
|
past_due:
|
|
type: boolean
|
|
canceled_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
trial_ends_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
started_at:
|
|
type: number
|
|
current_period_start:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
current_period_end:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
quantity:
|
|
type: number
|
|
required:
|
|
- plan_id
|
|
- default
|
|
- add_on
|
|
- status
|
|
- past_due
|
|
- canceled_at
|
|
- expires_at
|
|
- trial_ends_at
|
|
- started_at
|
|
- current_period_start
|
|
- current_period_end
|
|
- quantity
|
|
additionalProperties: false
|
|
balances:
|
|
type: object
|
|
propertyNames:
|
|
type: string
|
|
additionalProperties:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- boolean
|
|
- metered
|
|
- credit_system
|
|
consumable:
|
|
type: boolean
|
|
event_names:
|
|
type: array
|
|
items:
|
|
type: string
|
|
credit_schema:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
type: string
|
|
credit_cost:
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
display:
|
|
type: object
|
|
properties:
|
|
singular:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
plural:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
additionalProperties: false
|
|
archived:
|
|
type: boolean
|
|
required:
|
|
- id
|
|
- name
|
|
- type
|
|
- consumable
|
|
- archived
|
|
additionalProperties: false
|
|
unlimited:
|
|
type: boolean
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
breakdown:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
default: ""
|
|
type: string
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
prepaid_quantity:
|
|
default: 0
|
|
type: number
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- plan_id
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- prepaid_quantity
|
|
- expires_at
|
|
additionalProperties: false
|
|
rollovers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
balance:
|
|
type: number
|
|
expires_at:
|
|
type: number
|
|
required:
|
|
- balance
|
|
- expires_at
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- unlimited
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- plan_id
|
|
additionalProperties: false
|
|
invoices:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
plan_ids:
|
|
description: Array of plan IDs included in this invoice
|
|
example:
|
|
- pro_plan
|
|
- addon_feature
|
|
type: array
|
|
items:
|
|
type: string
|
|
stripe_id:
|
|
description: The Stripe invoice ID
|
|
example: in_1A2B3C4D5E6F7G8H
|
|
type: string
|
|
status:
|
|
description: The status of the invoice
|
|
example: paid
|
|
type: string
|
|
total:
|
|
description: The total amount of the invoice
|
|
example: 2999
|
|
type: number
|
|
currency:
|
|
description: The currency code for the invoice
|
|
example: usd
|
|
type: string
|
|
created_at:
|
|
description: Timestamp when the invoice was created
|
|
example: 1759247877000
|
|
type: number
|
|
hosted_invoice_url:
|
|
description: URL to the Stripe-hosted invoice page
|
|
example: https://invoice.stripe.com/i/acct_123/test_456
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
required:
|
|
- plan_ids
|
|
- stripe_id
|
|
- status
|
|
- total
|
|
- currency
|
|
- created_at
|
|
additionalProperties: false
|
|
entities:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
autumn_id:
|
|
type: string
|
|
id:
|
|
description: The unique identifier of the entity
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
name:
|
|
description: The name of the entity
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_id:
|
|
description: The customer ID this entity belongs to
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
feature_id:
|
|
description: The feature ID this entity belongs to
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
created_at:
|
|
description: Unix timestamp when the entity was created
|
|
type: number
|
|
env:
|
|
description: The environment (sandbox/live)
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
required:
|
|
- id
|
|
- name
|
|
- created_at
|
|
- env
|
|
additionalProperties: false
|
|
trials_used:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
plan_id:
|
|
type: string
|
|
customer_id:
|
|
type: string
|
|
fingerprint:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
required:
|
|
- plan_id
|
|
- customer_id
|
|
additionalProperties: false
|
|
rewards:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
discounts:
|
|
description: Array of active discounts applied to the customer
|
|
example:
|
|
- id: disc_123456
|
|
name: SUMMER20
|
|
type: percentage
|
|
discount_value: 20
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The unique identifier for this discount
|
|
example: disc_123456
|
|
type: string
|
|
name:
|
|
description: The name of the discount or coupon
|
|
example: SUMMER20
|
|
type: string
|
|
type:
|
|
description: The type of reward
|
|
example: percentage
|
|
type: string
|
|
enum:
|
|
- percentage_discount
|
|
- fixed_discount
|
|
- free_product
|
|
- invoice_credits
|
|
discount_value:
|
|
description: The discount value (percentage or fixed amount)
|
|
example: 20
|
|
type: number
|
|
duration_type:
|
|
description: How long the discount lasts
|
|
example: forever
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- months
|
|
- forever
|
|
duration_value:
|
|
description: Number of billing periods the discount applies for repeating
|
|
durations
|
|
example: 3
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
currency:
|
|
description: The currency code for fixed amount discounts
|
|
example: usd
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
start:
|
|
description: Timestamp when the discount becomes active
|
|
example: 1759247877000
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
end:
|
|
description: Timestamp when the discount expires
|
|
example: 1761839877000
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
subscription_id:
|
|
description: The Stripe subscription ID this discount is applied to
|
|
example: sub_1A2B3C4D5E6F7G8H
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
total_discount_amount:
|
|
description: Total amount saved from this discount
|
|
example: 599
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- name
|
|
- type
|
|
- discount_value
|
|
- duration_type
|
|
additionalProperties: false
|
|
required:
|
|
- discounts
|
|
additionalProperties: false
|
|
- type: "null"
|
|
referrals:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
program_id:
|
|
type: string
|
|
customer:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
email:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
additionalProperties: false
|
|
reward_applied:
|
|
type: boolean
|
|
created_at:
|
|
type: number
|
|
required:
|
|
- program_id
|
|
- customer
|
|
- reward_applied
|
|
- created_at
|
|
additionalProperties: false
|
|
payment_method:
|
|
anyOf:
|
|
- {}
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- name
|
|
- email
|
|
- created_at
|
|
- fingerprint
|
|
- stripe_id
|
|
- env
|
|
- metadata
|
|
- subscriptions
|
|
- scheduled_subscriptions
|
|
- balances
|
|
additionalProperties: false
|
|
BaseCustomer:
|
|
type: object
|
|
properties:
|
|
id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
name:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
email:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
created_at:
|
|
type: number
|
|
fingerprint:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
stripe_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
env:
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
metadata:
|
|
type: object
|
|
propertyNames: {}
|
|
additionalProperties: {}
|
|
subscriptions:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
plan:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
description:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
group:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
version:
|
|
type: number
|
|
add_on:
|
|
type: boolean
|
|
default:
|
|
type: boolean
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
required:
|
|
- amount
|
|
- interval
|
|
additionalProperties: false
|
|
- type: "null"
|
|
features:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the feature, used to refer to it in other API calls like
|
|
/track or /check.
|
|
type: string
|
|
name:
|
|
description: The name of the feature.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
type:
|
|
description: The type of the feature
|
|
type: string
|
|
enum:
|
|
- static
|
|
- boolean
|
|
- single_use
|
|
- continuous_use
|
|
- credit_system
|
|
display:
|
|
description: Singular and plural display names for the feature.
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
singular:
|
|
description: The singular display name for the feature.
|
|
type: string
|
|
plural:
|
|
description: The plural display name for the feature.
|
|
type: string
|
|
required:
|
|
- singular
|
|
- plural
|
|
additionalProperties: false
|
|
- type: "null"
|
|
credit_schema:
|
|
description: Credit cost schema for credit system features.
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
description: The ID of the metered feature (should be a single_use feature).
|
|
type: string
|
|
credit_cost:
|
|
description: The credit cost of the metered feature.
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
- type: "null"
|
|
archived:
|
|
description: Whether or not the feature is archived.
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- type
|
|
additionalProperties: false
|
|
granted_balance:
|
|
type: number
|
|
unlimited:
|
|
type: boolean
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
reset_when_enabled:
|
|
type: boolean
|
|
required:
|
|
- interval
|
|
- reset_when_enabled
|
|
additionalProperties: false
|
|
- type: "null"
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
tiers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
additionalProperties: false
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
billing_units:
|
|
type: number
|
|
usage_model:
|
|
type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- billing_units
|
|
- usage_model
|
|
- max_purchase
|
|
additionalProperties: false
|
|
- type: "null"
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
rollover:
|
|
type: object
|
|
properties:
|
|
max:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expiry_duration_type:
|
|
type: string
|
|
enum:
|
|
- month
|
|
- forever
|
|
expiry_duration_length:
|
|
type: number
|
|
required:
|
|
- max
|
|
- expiry_duration_type
|
|
additionalProperties: false
|
|
proration:
|
|
type: object
|
|
properties:
|
|
on_increase:
|
|
type: string
|
|
enum:
|
|
- bill_immediately
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- bill_next_cycle
|
|
on_decrease:
|
|
type: string
|
|
enum:
|
|
- prorate
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- none
|
|
- no_prorations
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- granted_balance
|
|
- unlimited
|
|
- reset
|
|
- price
|
|
additionalProperties: false
|
|
free_trial:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration_type:
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
duration_length:
|
|
type: number
|
|
card_required:
|
|
type: boolean
|
|
required:
|
|
- duration_type
|
|
- duration_length
|
|
- card_required
|
|
additionalProperties: false
|
|
- type: "null"
|
|
created_at:
|
|
type: number
|
|
env:
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
archived:
|
|
type: boolean
|
|
base_variant_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_eligibility:
|
|
type: object
|
|
properties:
|
|
trial_available:
|
|
type: boolean
|
|
scenario:
|
|
type: string
|
|
enum:
|
|
- scheduled
|
|
- active
|
|
- new
|
|
- renew
|
|
- upgrade
|
|
- downgrade
|
|
- cancel
|
|
- expired
|
|
- past_due
|
|
required:
|
|
- scenario
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- description
|
|
- group
|
|
- version
|
|
- add_on
|
|
- default
|
|
- price
|
|
- features
|
|
- created_at
|
|
- env
|
|
- archived
|
|
- base_variant_id
|
|
additionalProperties: false
|
|
plan_id:
|
|
type: string
|
|
default:
|
|
type: boolean
|
|
add_on:
|
|
type: boolean
|
|
status:
|
|
type: string
|
|
enum:
|
|
- active
|
|
- scheduled
|
|
- expired
|
|
past_due:
|
|
type: boolean
|
|
canceled_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
trial_ends_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
started_at:
|
|
type: number
|
|
current_period_start:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
current_period_end:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
quantity:
|
|
type: number
|
|
required:
|
|
- plan_id
|
|
- default
|
|
- add_on
|
|
- status
|
|
- past_due
|
|
- canceled_at
|
|
- expires_at
|
|
- trial_ends_at
|
|
- started_at
|
|
- current_period_start
|
|
- current_period_end
|
|
- quantity
|
|
additionalProperties: false
|
|
scheduled_subscriptions:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
plan:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
description:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
group:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
version:
|
|
type: number
|
|
add_on:
|
|
type: boolean
|
|
default:
|
|
type: boolean
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
required:
|
|
- amount
|
|
- interval
|
|
additionalProperties: false
|
|
- type: "null"
|
|
features:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the feature, used to refer to it in other API calls like
|
|
/track or /check.
|
|
type: string
|
|
name:
|
|
description: The name of the feature.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
type:
|
|
description: The type of the feature
|
|
type: string
|
|
enum:
|
|
- static
|
|
- boolean
|
|
- single_use
|
|
- continuous_use
|
|
- credit_system
|
|
display:
|
|
description: Singular and plural display names for the feature.
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
singular:
|
|
description: The singular display name for the feature.
|
|
type: string
|
|
plural:
|
|
description: The plural display name for the feature.
|
|
type: string
|
|
required:
|
|
- singular
|
|
- plural
|
|
additionalProperties: false
|
|
- type: "null"
|
|
credit_schema:
|
|
description: Credit cost schema for credit system features.
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
description: The ID of the metered feature (should be a single_use feature).
|
|
type: string
|
|
credit_cost:
|
|
description: The credit cost of the metered feature.
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
- type: "null"
|
|
archived:
|
|
description: Whether or not the feature is archived.
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- type
|
|
additionalProperties: false
|
|
granted_balance:
|
|
type: number
|
|
unlimited:
|
|
type: boolean
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
reset_when_enabled:
|
|
type: boolean
|
|
required:
|
|
- interval
|
|
- reset_when_enabled
|
|
additionalProperties: false
|
|
- type: "null"
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
tiers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
additionalProperties: false
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
billing_units:
|
|
type: number
|
|
usage_model:
|
|
type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- billing_units
|
|
- usage_model
|
|
- max_purchase
|
|
additionalProperties: false
|
|
- type: "null"
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
rollover:
|
|
type: object
|
|
properties:
|
|
max:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expiry_duration_type:
|
|
type: string
|
|
enum:
|
|
- month
|
|
- forever
|
|
expiry_duration_length:
|
|
type: number
|
|
required:
|
|
- max
|
|
- expiry_duration_type
|
|
additionalProperties: false
|
|
proration:
|
|
type: object
|
|
properties:
|
|
on_increase:
|
|
type: string
|
|
enum:
|
|
- bill_immediately
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- bill_next_cycle
|
|
on_decrease:
|
|
type: string
|
|
enum:
|
|
- prorate
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- none
|
|
- no_prorations
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- granted_balance
|
|
- unlimited
|
|
- reset
|
|
- price
|
|
additionalProperties: false
|
|
free_trial:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration_type:
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
duration_length:
|
|
type: number
|
|
card_required:
|
|
type: boolean
|
|
required:
|
|
- duration_type
|
|
- duration_length
|
|
- card_required
|
|
additionalProperties: false
|
|
- type: "null"
|
|
created_at:
|
|
type: number
|
|
env:
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
archived:
|
|
type: boolean
|
|
base_variant_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_eligibility:
|
|
type: object
|
|
properties:
|
|
trial_available:
|
|
type: boolean
|
|
scenario:
|
|
type: string
|
|
enum:
|
|
- scheduled
|
|
- active
|
|
- new
|
|
- renew
|
|
- upgrade
|
|
- downgrade
|
|
- cancel
|
|
- expired
|
|
- past_due
|
|
required:
|
|
- scenario
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- description
|
|
- group
|
|
- version
|
|
- add_on
|
|
- default
|
|
- price
|
|
- features
|
|
- created_at
|
|
- env
|
|
- archived
|
|
- base_variant_id
|
|
additionalProperties: false
|
|
plan_id:
|
|
type: string
|
|
default:
|
|
type: boolean
|
|
add_on:
|
|
type: boolean
|
|
status:
|
|
type: string
|
|
enum:
|
|
- active
|
|
- scheduled
|
|
- expired
|
|
past_due:
|
|
type: boolean
|
|
canceled_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
trial_ends_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
started_at:
|
|
type: number
|
|
current_period_start:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
current_period_end:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
quantity:
|
|
type: number
|
|
required:
|
|
- plan_id
|
|
- default
|
|
- add_on
|
|
- status
|
|
- past_due
|
|
- canceled_at
|
|
- expires_at
|
|
- trial_ends_at
|
|
- started_at
|
|
- current_period_start
|
|
- current_period_end
|
|
- quantity
|
|
additionalProperties: false
|
|
balances:
|
|
type: object
|
|
propertyNames:
|
|
type: string
|
|
additionalProperties:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- boolean
|
|
- metered
|
|
- credit_system
|
|
consumable:
|
|
type: boolean
|
|
event_names:
|
|
type: array
|
|
items:
|
|
type: string
|
|
credit_schema:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
type: string
|
|
credit_cost:
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
display:
|
|
type: object
|
|
properties:
|
|
singular:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
plural:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
additionalProperties: false
|
|
archived:
|
|
type: boolean
|
|
required:
|
|
- id
|
|
- name
|
|
- type
|
|
- consumable
|
|
- archived
|
|
additionalProperties: false
|
|
unlimited:
|
|
type: boolean
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
breakdown:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
default: ""
|
|
type: string
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
prepaid_quantity:
|
|
default: 0
|
|
type: number
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- plan_id
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- prepaid_quantity
|
|
- expires_at
|
|
additionalProperties: false
|
|
rollovers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
balance:
|
|
type: number
|
|
expires_at:
|
|
type: number
|
|
required:
|
|
- balance
|
|
- expires_at
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- unlimited
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- plan_id
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- email
|
|
- created_at
|
|
- fingerprint
|
|
- stripe_id
|
|
- env
|
|
- metadata
|
|
- subscriptions
|
|
- scheduled_subscriptions
|
|
- balances
|
|
additionalProperties: false
|
|
Entity:
|
|
type: object
|
|
properties:
|
|
autumn_id:
|
|
type: string
|
|
id:
|
|
description: The unique identifier of the entity
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
name:
|
|
description: The name of the entity
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_id:
|
|
description: The customer ID this entity belongs to
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
feature_id:
|
|
description: The feature ID this entity belongs to
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
created_at:
|
|
description: Unix timestamp when the entity was created
|
|
type: number
|
|
env:
|
|
description: The environment (sandbox/live)
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
subscriptions:
|
|
description: Plans associated with this entity
|
|
example: []
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
plan:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
description:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
group:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
version:
|
|
type: number
|
|
add_on:
|
|
type: boolean
|
|
default:
|
|
type: boolean
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
required:
|
|
- amount
|
|
- interval
|
|
additionalProperties: false
|
|
- type: "null"
|
|
features:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the feature, used to refer to it in other API calls like
|
|
/track or /check.
|
|
type: string
|
|
name:
|
|
description: The name of the feature.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
type:
|
|
description: The type of the feature
|
|
type: string
|
|
enum:
|
|
- static
|
|
- boolean
|
|
- single_use
|
|
- continuous_use
|
|
- credit_system
|
|
display:
|
|
description: Singular and plural display names for the feature.
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
singular:
|
|
description: The singular display name for the feature.
|
|
type: string
|
|
plural:
|
|
description: The plural display name for the feature.
|
|
type: string
|
|
required:
|
|
- singular
|
|
- plural
|
|
additionalProperties: false
|
|
- type: "null"
|
|
credit_schema:
|
|
description: Credit cost schema for credit system features.
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
description: The ID of the metered feature (should be a single_use feature).
|
|
type: string
|
|
credit_cost:
|
|
description: The credit cost of the metered feature.
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
- type: "null"
|
|
archived:
|
|
description: Whether or not the feature is archived.
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- type
|
|
additionalProperties: false
|
|
granted_balance:
|
|
type: number
|
|
unlimited:
|
|
type: boolean
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
reset_when_enabled:
|
|
type: boolean
|
|
required:
|
|
- interval
|
|
- reset_when_enabled
|
|
additionalProperties: false
|
|
- type: "null"
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
tiers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
additionalProperties: false
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
billing_units:
|
|
type: number
|
|
usage_model:
|
|
type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- billing_units
|
|
- usage_model
|
|
- max_purchase
|
|
additionalProperties: false
|
|
- type: "null"
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
rollover:
|
|
type: object
|
|
properties:
|
|
max:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expiry_duration_type:
|
|
type: string
|
|
enum:
|
|
- month
|
|
- forever
|
|
expiry_duration_length:
|
|
type: number
|
|
required:
|
|
- max
|
|
- expiry_duration_type
|
|
additionalProperties: false
|
|
proration:
|
|
type: object
|
|
properties:
|
|
on_increase:
|
|
type: string
|
|
enum:
|
|
- bill_immediately
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- bill_next_cycle
|
|
on_decrease:
|
|
type: string
|
|
enum:
|
|
- prorate
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- none
|
|
- no_prorations
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- granted_balance
|
|
- unlimited
|
|
- reset
|
|
- price
|
|
additionalProperties: false
|
|
free_trial:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration_type:
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
duration_length:
|
|
type: number
|
|
card_required:
|
|
type: boolean
|
|
required:
|
|
- duration_type
|
|
- duration_length
|
|
- card_required
|
|
additionalProperties: false
|
|
- type: "null"
|
|
created_at:
|
|
type: number
|
|
env:
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
archived:
|
|
type: boolean
|
|
base_variant_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_eligibility:
|
|
type: object
|
|
properties:
|
|
trial_available:
|
|
type: boolean
|
|
scenario:
|
|
type: string
|
|
enum:
|
|
- scheduled
|
|
- active
|
|
- new
|
|
- renew
|
|
- upgrade
|
|
- downgrade
|
|
- cancel
|
|
- expired
|
|
- past_due
|
|
required:
|
|
- scenario
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- description
|
|
- group
|
|
- version
|
|
- add_on
|
|
- default
|
|
- price
|
|
- features
|
|
- created_at
|
|
- env
|
|
- archived
|
|
- base_variant_id
|
|
additionalProperties: false
|
|
plan_id:
|
|
type: string
|
|
default:
|
|
type: boolean
|
|
add_on:
|
|
type: boolean
|
|
status:
|
|
type: string
|
|
enum:
|
|
- active
|
|
- scheduled
|
|
- expired
|
|
past_due:
|
|
type: boolean
|
|
canceled_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
trial_ends_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
started_at:
|
|
type: number
|
|
current_period_start:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
current_period_end:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
quantity:
|
|
type: number
|
|
required:
|
|
- plan_id
|
|
- default
|
|
- add_on
|
|
- status
|
|
- past_due
|
|
- canceled_at
|
|
- expires_at
|
|
- trial_ends_at
|
|
- started_at
|
|
- current_period_start
|
|
- current_period_end
|
|
- quantity
|
|
additionalProperties: false
|
|
scheduled_subscriptions:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
plan:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
description:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
group:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
version:
|
|
type: number
|
|
add_on:
|
|
type: boolean
|
|
default:
|
|
type: boolean
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
required:
|
|
- amount
|
|
- interval
|
|
additionalProperties: false
|
|
- type: "null"
|
|
features:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the feature, used to refer to it in other API calls like
|
|
/track or /check.
|
|
type: string
|
|
name:
|
|
description: The name of the feature.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
type:
|
|
description: The type of the feature
|
|
type: string
|
|
enum:
|
|
- static
|
|
- boolean
|
|
- single_use
|
|
- continuous_use
|
|
- credit_system
|
|
display:
|
|
description: Singular and plural display names for the feature.
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
singular:
|
|
description: The singular display name for the feature.
|
|
type: string
|
|
plural:
|
|
description: The plural display name for the feature.
|
|
type: string
|
|
required:
|
|
- singular
|
|
- plural
|
|
additionalProperties: false
|
|
- type: "null"
|
|
credit_schema:
|
|
description: Credit cost schema for credit system features.
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
description: The ID of the metered feature (should be a single_use feature).
|
|
type: string
|
|
credit_cost:
|
|
description: The credit cost of the metered feature.
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
- type: "null"
|
|
archived:
|
|
description: Whether or not the feature is archived.
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- type
|
|
additionalProperties: false
|
|
granted_balance:
|
|
type: number
|
|
unlimited:
|
|
type: boolean
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
reset_when_enabled:
|
|
type: boolean
|
|
required:
|
|
- interval
|
|
- reset_when_enabled
|
|
additionalProperties: false
|
|
- type: "null"
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
tiers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
additionalProperties: false
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
billing_units:
|
|
type: number
|
|
usage_model:
|
|
type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- billing_units
|
|
- usage_model
|
|
- max_purchase
|
|
additionalProperties: false
|
|
- type: "null"
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
rollover:
|
|
type: object
|
|
properties:
|
|
max:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expiry_duration_type:
|
|
type: string
|
|
enum:
|
|
- month
|
|
- forever
|
|
expiry_duration_length:
|
|
type: number
|
|
required:
|
|
- max
|
|
- expiry_duration_type
|
|
additionalProperties: false
|
|
proration:
|
|
type: object
|
|
properties:
|
|
on_increase:
|
|
type: string
|
|
enum:
|
|
- bill_immediately
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- bill_next_cycle
|
|
on_decrease:
|
|
type: string
|
|
enum:
|
|
- prorate
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- none
|
|
- no_prorations
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- granted_balance
|
|
- unlimited
|
|
- reset
|
|
- price
|
|
additionalProperties: false
|
|
free_trial:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
duration_type:
|
|
type: string
|
|
enum:
|
|
- day
|
|
- month
|
|
- year
|
|
duration_length:
|
|
type: number
|
|
card_required:
|
|
type: boolean
|
|
required:
|
|
- duration_type
|
|
- duration_length
|
|
- card_required
|
|
additionalProperties: false
|
|
- type: "null"
|
|
created_at:
|
|
type: number
|
|
env:
|
|
type: string
|
|
enum:
|
|
- sandbox
|
|
- live
|
|
archived:
|
|
type: boolean
|
|
base_variant_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
customer_eligibility:
|
|
type: object
|
|
properties:
|
|
trial_available:
|
|
type: boolean
|
|
scenario:
|
|
type: string
|
|
enum:
|
|
- scheduled
|
|
- active
|
|
- new
|
|
- renew
|
|
- upgrade
|
|
- downgrade
|
|
- cancel
|
|
- expired
|
|
- past_due
|
|
required:
|
|
- scenario
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- description
|
|
- group
|
|
- version
|
|
- add_on
|
|
- default
|
|
- price
|
|
- features
|
|
- created_at
|
|
- env
|
|
- archived
|
|
- base_variant_id
|
|
additionalProperties: false
|
|
plan_id:
|
|
type: string
|
|
default:
|
|
type: boolean
|
|
add_on:
|
|
type: boolean
|
|
status:
|
|
type: string
|
|
enum:
|
|
- active
|
|
- scheduled
|
|
- expired
|
|
past_due:
|
|
type: boolean
|
|
canceled_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
trial_ends_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
started_at:
|
|
type: number
|
|
current_period_start:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
current_period_end:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
quantity:
|
|
type: number
|
|
required:
|
|
- plan_id
|
|
- default
|
|
- add_on
|
|
- status
|
|
- past_due
|
|
- canceled_at
|
|
- expires_at
|
|
- trial_ends_at
|
|
- started_at
|
|
- current_period_start
|
|
- current_period_end
|
|
- quantity
|
|
additionalProperties: false
|
|
balances:
|
|
description: Features associated with this entity
|
|
type: object
|
|
propertyNames:
|
|
type: string
|
|
additionalProperties:
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- boolean
|
|
- metered
|
|
- credit_system
|
|
consumable:
|
|
type: boolean
|
|
event_names:
|
|
type: array
|
|
items:
|
|
type: string
|
|
credit_schema:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
type: string
|
|
credit_cost:
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
display:
|
|
type: object
|
|
properties:
|
|
singular:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
plural:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
additionalProperties: false
|
|
archived:
|
|
type: boolean
|
|
required:
|
|
- id
|
|
- name
|
|
- type
|
|
- consumable
|
|
- archived
|
|
additionalProperties: false
|
|
unlimited:
|
|
type: boolean
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
breakdown:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
default: ""
|
|
type: string
|
|
plan_id:
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
granted_balance:
|
|
type: number
|
|
purchased_balance:
|
|
type: number
|
|
current_balance:
|
|
type: number
|
|
usage:
|
|
type: number
|
|
overage_allowed:
|
|
type: boolean
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
- type: string
|
|
const: multiple
|
|
interval_count:
|
|
type: number
|
|
resets_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- resets_at
|
|
additionalProperties: false
|
|
- type: "null"
|
|
prepaid_quantity:
|
|
default: 0
|
|
type: number
|
|
expires_at:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- plan_id
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- prepaid_quantity
|
|
- expires_at
|
|
additionalProperties: false
|
|
rollovers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
balance:
|
|
type: number
|
|
expires_at:
|
|
type: number
|
|
required:
|
|
- balance
|
|
- expires_at
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- unlimited
|
|
- granted_balance
|
|
- purchased_balance
|
|
- current_balance
|
|
- usage
|
|
- overage_allowed
|
|
- max_purchase
|
|
- reset
|
|
- plan_id
|
|
additionalProperties: false
|
|
invoices:
|
|
description: Invoices for this entity (only included when expand=invoices)
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
plan_ids:
|
|
description: Array of plan IDs included in this invoice
|
|
example:
|
|
- pro_plan
|
|
- addon_feature
|
|
type: array
|
|
items:
|
|
type: string
|
|
stripe_id:
|
|
description: The Stripe invoice ID
|
|
example: in_1A2B3C4D5E6F7G8H
|
|
type: string
|
|
status:
|
|
description: The status of the invoice
|
|
example: paid
|
|
type: string
|
|
total:
|
|
description: The total amount of the invoice
|
|
example: 2999
|
|
type: number
|
|
currency:
|
|
description: The currency code for the invoice
|
|
example: usd
|
|
type: string
|
|
created_at:
|
|
description: Timestamp when the invoice was created
|
|
example: 1759247877000
|
|
type: number
|
|
hosted_invoice_url:
|
|
description: URL to the Stripe-hosted invoice page
|
|
example: https://invoice.stripe.com/i/acct_123/test_456
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
required:
|
|
- plan_ids
|
|
- stripe_id
|
|
- status
|
|
- total
|
|
- currency
|
|
- created_at
|
|
additionalProperties: false
|
|
required:
|
|
- id
|
|
- name
|
|
- created_at
|
|
- env
|
|
- scheduled_subscriptions
|
|
additionalProperties: false
|
|
PlanFeature:
|
|
description: Plan feature object returned by the API
|
|
example:
|
|
feature_id: "123"
|
|
granted_balance: 100
|
|
unlimited: false
|
|
price: null
|
|
type: object
|
|
properties:
|
|
feature_id:
|
|
type: string
|
|
feature:
|
|
type: object
|
|
properties:
|
|
id:
|
|
description: The ID of the feature, used to refer to it in other API calls like
|
|
/track or /check.
|
|
type: string
|
|
name:
|
|
description: The name of the feature.
|
|
anyOf:
|
|
- type: string
|
|
- type: "null"
|
|
type:
|
|
description: The type of the feature
|
|
type: string
|
|
enum:
|
|
- static
|
|
- boolean
|
|
- single_use
|
|
- continuous_use
|
|
- credit_system
|
|
display:
|
|
description: Singular and plural display names for the feature.
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
singular:
|
|
description: The singular display name for the feature.
|
|
type: string
|
|
plural:
|
|
description: The plural display name for the feature.
|
|
type: string
|
|
required:
|
|
- singular
|
|
- plural
|
|
additionalProperties: false
|
|
- type: "null"
|
|
credit_schema:
|
|
description: Credit cost schema for credit system features.
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
metered_feature_id:
|
|
description: The ID of the metered feature (should be a single_use feature).
|
|
type: string
|
|
credit_cost:
|
|
description: The credit cost of the metered feature.
|
|
type: number
|
|
required:
|
|
- metered_feature_id
|
|
- credit_cost
|
|
additionalProperties: false
|
|
- type: "null"
|
|
archived:
|
|
description: Whether or not the feature is archived.
|
|
anyOf:
|
|
- type: boolean
|
|
- type: "null"
|
|
required:
|
|
- id
|
|
- type
|
|
additionalProperties: false
|
|
granted_balance:
|
|
type: number
|
|
unlimited:
|
|
type: boolean
|
|
reset:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- minute
|
|
- hour
|
|
- day
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
reset_when_enabled:
|
|
type: boolean
|
|
required:
|
|
- interval
|
|
- reset_when_enabled
|
|
additionalProperties: false
|
|
- type: "null"
|
|
price:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
tiers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
to:
|
|
anyOf:
|
|
- type: number
|
|
- type: string
|
|
const: inf
|
|
amount:
|
|
type: number
|
|
required:
|
|
- to
|
|
- amount
|
|
additionalProperties: false
|
|
interval:
|
|
type: string
|
|
enum:
|
|
- one_off
|
|
- week
|
|
- month
|
|
- quarter
|
|
- semi_annual
|
|
- year
|
|
interval_count:
|
|
type: number
|
|
billing_units:
|
|
type: number
|
|
usage_model:
|
|
type: string
|
|
enum:
|
|
- prepaid
|
|
- pay_per_use
|
|
max_purchase:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
required:
|
|
- interval
|
|
- billing_units
|
|
- usage_model
|
|
- max_purchase
|
|
additionalProperties: false
|
|
- type: "null"
|
|
display:
|
|
type: object
|
|
properties:
|
|
primary_text:
|
|
type: string
|
|
secondary_text:
|
|
type: string
|
|
required:
|
|
- primary_text
|
|
additionalProperties: false
|
|
rollover:
|
|
type: object
|
|
properties:
|
|
max:
|
|
anyOf:
|
|
- type: number
|
|
- type: "null"
|
|
expiry_duration_type:
|
|
type: string
|
|
enum:
|
|
- month
|
|
- forever
|
|
expiry_duration_length:
|
|
type: number
|
|
required:
|
|
- max
|
|
- expiry_duration_type
|
|
additionalProperties: false
|
|
proration:
|
|
type: object
|
|
properties:
|
|
on_increase:
|
|
type: string
|
|
enum:
|
|
- bill_immediately
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- bill_next_cycle
|
|
on_decrease:
|
|
type: string
|
|
enum:
|
|
- prorate
|
|
- prorate_immediately
|
|
- prorate_next_cycle
|
|
- none
|
|
- no_prorations
|
|
additionalProperties: false
|
|
required:
|
|
- feature_id
|
|
- granted_balance
|
|
- unlimited
|
|
- reset
|
|
- price
|
|
additionalProperties: false
|
|
securitySchemes:
|
|
secretKey:
|
|
type: http
|
|
scheme: bearer
|
|
bearerFormat: JWT
|