Skip to content
Book a demoContact usGet started

Change Subscription Rate Card

post/subscriptions/{subscription_id}/change-rate-card

Change Subscription Rate Card

Path ParametersExpand Collapse
subscription_id: string
Body ParametersExpand Collapse
rate_card_id: string

The ID of the rate card to change the subscription to.

checkout_callback_urls: optional CheckoutCallback { cancelled_url, success_url }

The URLs to redirect to after the checkout is completed or cancelled, if a checkout is required.

cancelled_url: string

The URL to redirect to after the checkout is cancelled.

minLength1
formaturi
success_url: string

The URL to redirect to after the checkout is successful.

minLength1
formaturi
upgrade_behavior: optional "prorate" or "rate_difference"

The behavior to use when upgrading the subscription. If 'prorate', the customer will be charged for the prorated difference. If 'rate_difference', the customer will be charged for the difference in the rate cards without respect to time.

Accepts one of the following:
"prorate"
"rate_difference"
ReturnsExpand Collapse
result: object { action, type } or object { subscription, type }

The result of the request. If the request is successful, the subscription resource will be returned. If the request is requires action, the action to take to complete the request will be returned.

Accepts one of the following:
RequiresAction = object { action, type }
action: object { checkout_url, type }

The action to take to complete the request.

checkout_url: string

The URL of the checkout page to redirect to in order to complete the request.

type: "checkout"
type: "requires_action"
Success = object { subscription, type }
subscription: SubscriptionResource { id, cancels_at_end_of_cycle, current_period, 8 more }

The updated subscription resource.

id: string

The ID of the subscription.

cancels_at_end_of_cycle: boolean

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

current_period: object { end, start, inclusive_end, inclusive_start }

The current period of the subscription if it is active.

end: string
formatdate-time
start: string
formatdate-time
inclusive_end: optional boolean
inclusive_start: optional boolean
cycles_next_at: string

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

formatdate-time
effective_at: string

The date and time the subscription became effective.

formatdate-time
fixed_rate_quantities: map[string]

The quantities of the fixed rates of the subscription.

metadata: map[string]
rate_card_id: string

The ID of the rate card of the subscription.

rate_price_multipliers: map[string]

The price multipliers of the rates of the subscription.

status: "active" or "cancelled" or "paused"

The status of the subscription.

Accepts one of the following:
"active"
"cancelled"
"paused"
subject_id: string

The ID of the subject that the subscription is for.

type: "success"
Change Subscription Rate Card
curl https://api.uselark.ai/subscriptions/$SUBSCRIPTION_ID/change-rate-card \
    -H 'Content-Type: application/json' \
    -H "X-API-Key: $LARK_API_KEY" \
    -d '{
          "rate_card_id": "rc_jQK2n0wutCj6bBcAIrL6o07g"
        }'
{
  "result": {
    "action": {
      "checkout_url": "https://checkout.uselark.ai/...",
      "type": "checkout"
    },
    "type": "requires_action"
  }
}
Returns Examples
{
  "result": {
    "action": {
      "checkout_url": "https://checkout.uselark.ai/...",
      "type": "checkout"
    },
    "type": "requires_action"
  }
}