Change Subscription Rate Card
client.Subscriptions.ChangeRateCard(ctx, subscriptionID, body) (*SubscriptionChangeRateCardResponse, error)
/subscriptions/{subscription_id}/change-rate-card
Change Subscription Rate Card
Parameters
subscriptionID string
Returns
Change Subscription Rate Card
package main
import (
"context"
"fmt"
"github.com/stainless-sdks/lark-go"
"github.com/stainless-sdks/lark-go/option"
)
func main() {
client := lark.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Subscriptions.ChangeRateCard(
context.TODO(),
"subscription_id",
lark.SubscriptionChangeRateCardParams{
RateCardID: "rc_jQK2n0wutCj6bBcAIrL6o07g",
CheckoutCallbackURLs: lark.CheckoutCallbackParam{
CancelledURL: "https://example.com/try-again",
SuccessURL: "https://example.com/completed",
},
UpgradeBehavior: lark.SubscriptionChangeRateCardParamsUpgradeBehaviorProrate,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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"
}
}