Skip to content
Join our SlackContact usGet started

Subscriptions

List Subscriptions
client.Subscriptions.List(ctx, query) (*SubscriptionListResponse, error)
get/subscriptions
Create Subscription
client.Subscriptions.New(ctx, body) (*SubscriptionNewResponse, error)
post/subscriptions
Get Subscription
client.Subscriptions.Get(ctx, subscriptionID) (*SubscriptionResource, error)
get/subscriptions/{subscription_id}
Cancel Subscription
client.Subscriptions.Cancel(ctx, subscriptionID, body) (*SubscriptionResource, error)
post/subscriptions/{subscription_id}/cancel
Change Subscription Rate Card
client.Subscriptions.ChangeRateCard(ctx, subscriptionID, body) (*SubscriptionChangeRateCardResponse, error)
post/subscriptions/{subscription_id}/change-rate-card
ModelsExpand Collapse
type CheckoutCallback struct{…}
CancelledURL string

The URL to redirect to after the checkout is cancelled.

minLength1
formaturi
SuccessURL string

The URL to redirect to after the checkout is successful.

minLength1
formaturi
type SubscriptionResource struct{…}
ID string

The ID of the subscription.

CancelsAtEndOfCycle bool

Whether the subscription will be cancelled at the end of the current cycle.

CurrentPeriod SubscriptionResourceCurrentPeriod

The current period of the subscription if it is active.

End Time
formatdate-time
Start Time
formatdate-time
InclusiveEnd booloptional
InclusiveStart booloptional
CyclesNextAt Time

The date and time the next cycle of the subscription will start.

formatdate-time
EffectiveAt Time

The date and time the subscription became effective.

formatdate-time
Metadata map[string, string]
RateCardID string

The ID of the rate card of the subscription.

Status SubscriptionResourceStatus

The status of the subscription.

Accepts one of the following:
const SubscriptionResourceStatusActive SubscriptionResourceStatus = "active"
const SubscriptionResourceStatusCancelled SubscriptionResourceStatus = "cancelled"
const SubscriptionResourceStatusPaused SubscriptionResourceStatus = "paused"
SubjectID string

The ID of the subject that the subscription is for.