Change Subscription Rate Card
client.subscriptions.changeRateCard(stringsubscriptionID, SubscriptionChangeRateCardParams { rate_card_id, checkout_callback_urls, upgrade_behavior } body, RequestOptionsoptions?): SubscriptionChangeRateCardResponse { result }
/subscriptions/{subscription_id}/change-rate-card
Change Subscription Rate Card
Parameters
subscriptionID: string
Returns
Change Subscription Rate Card
import Lark from 'lark-billing';
const client = new Lark({
apiKey: process.env['LARK_API_KEY'], // This is the default and can be omitted
});
const response = await client.subscriptions.changeRateCard('subscription_id', {
rate_card_id: 'rc_jQK2n0wutCj6bBcAIrL6o07g',
checkout_callback_urls: {
cancelled_url: 'https://example.com/try-again',
success_url: 'https://example.com/completed',
},
upgrade_behavior: 'prorate',
});
console.log(response.result);
{
"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"
}
}