Skip to main content
POST
Create a subscription

Authorizations

X-API-KEY
string
header
required

Body

application/json

Subscription to create

clientId
string

ClientID is the client the subscription bills. Exactly one of clientId, companyId, or recipientId must be provided.

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

collectionMethod
enum<string>

CollectionMethod is how invoices for the subscription are collected.

Available options:
sendInvoice,
chargeAutomatically
Example:

"sendInvoice"

companyId
string

CompanyID is the company the subscription bills. Exactly one of clientId, companyId, or recipientId must be provided.

Example:

"f0e1d2c3-b4a5-6789-0123-456789abcdef"

currency
string

Currency is the ISO currency code.

Example:

"usd"

daysUntilDue
integer

DaysUntilDue sets the invoice due date relative to issuance.

Example:

30

interval
enum<string>

Interval is the billing period.

Available options:
day,
week,
month,
quarterly,
biannually,
year,
semiannually
Example:

"month"

intervalCount
integer

IntervalCount is the number of intervals between billings.

Example:

1

lineItems
object[]

LineItems are the subscription line items. Required unless templateId is provided, in which case the template's line items are used when omitted. Must contain at least one item when provided.

Minimum array length: 1
memo
string

Memo is an optional note shown on generated invoices.

Example:

"Monthly retainer"

paymentMethodPreferences
object[]

PaymentMethodPreferences restricts which payment methods are offered.

recipientId
string

RecipientID is the recipient (client or company) of the subscription. Exactly one of clientId, companyId, or recipientId must be provided.

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

taxPercentage
number

TaxPercentage is an optional tax rate applied to generated invoices.

Example:

8.25

templateId
string

TemplateID optionally seeds the subscription from a subscription template.

Example:

"a7c3e9f1-2b4d-4e6a-8c0f-1d2e3f4a5b6c"

Response

OK

additionalFields
object

StripeObject would hold field from stripe's subscription or subscription schedule object

cancelledAt
string<date-time>

CancelledAt is the RFC 3339 timestamp at which the subscription was cancelled; absent while active.

Example:

"2024-02-20T14:05:00Z"

clientId
string

ClientID is the ID of the client user the subscription bills.

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

collectionMethod
enum<string>

CollectionMethod determines how the subscription's invoices are collected.

Available options:
sendInvoice,
chargeAutomatically
Example:

"sendInvoice"

companyId
string

CompanyID is the ID of the company the subscription bills.

Example:

"f0e1d2c3-b4a5-6789-0123-456789abcdef"

createdAt
string
creatorId
string
currency
string

Currency is the ISO 4217 currency code the subscription is billed in.

Example:

"usd"

data
string
daysUntilDue
integer

DaysUntilDue is the number of days a recipient has to pay an invoice when collected by sending an invoice.

Example:

30

fields
object
filteredListIndexPkey
string

{client_id}/INBOX_NOTIFICATION

forcePaused
boolean

ForcePaused indicates the subscription was paused because the workspace plan lapsed.

Example:

false

id
string
identityId
string
interval
enum<string>

Interval is the billing period the subscription recurs on.

Available options:
day,
week,
month,
quarterly,
biannually,
year,
semiannually
Example:

"monthly"

intervalCount
integer

IntervalCount is the number of intervals between each billing cycle.

Example:

1

lineItems
object[]

LineItems are the products and ad-hoc charges billed on each cycle.

memo
string

Memo is an optional note shown to the recipient on generated invoices.

Example:

"Monthly retainer"

object
string
paymentMethodPreferences
object[]

field is only used for platform api and should not be used anywhere else on FE/BE

paymentSourceId
string

PaymentSourceId is the ID of the saved payment source charged for automatically-collected subscriptions.

Example:

"card_1a2b3c"

previousAttributes
object
recipientId
string

RecipientID is the ID of the client or company the subscription bills. Deprecated: use ClientID and CompanyID instead

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

ref
string
status
string

Status is the current lifecycle status of the subscription, mirrored from Stripe.

Example:

"active"

taxPercentage
number | null

TaxPercentage is the tax rate applied to the subscription, as a percentage.

Example:

8.25

templateId
string

TemplateID is the ID of the subscription template the subscription was created from, when applicable.

Example:

"a7c3e9f1-2b4d-4e6a-8c0f-1d2e3f4a5b6c"

updatedAt
string